Git Product home page Git Product logo

Comments (12)

camillethuyentruong avatar camillethuyentruong commented on September 4, 2024

Hi Laura,
I can't access the data of the graphic

  1. you need to save it into .csv
  2. you need to put it into the data folder
  3. In your R code you need to import these data

from lncrna_bc.

cristoichkov avatar cristoichkov commented on September 4, 2024

Hi laura

To import .csv files you have to do this

name_df <- read.csv("name_your_file.csv")

from lncrna_bc.

camillethuyentruong avatar camillethuyentruong commented on September 4, 2024

Hi Cris,

The command to export a table is:
write.csv(table_in_R$columns, "name.csv")

from lncrna_bc.

LauraMCE avatar LauraMCE commented on September 4, 2024

Hi! I've already uploaded the .csv file

and also I corrected the script. Thank you!!

from lncrna_bc.

VeroIarrachtai avatar VeroIarrachtai commented on September 4, 2024

May be you can check this if you have header and others considers:
ERROR: Nine number changed by )
read.table(file, header = FALSE, sep = "", quote = ""'"9
TRUE:
read.table(file, header = FALSE, sep = "", quote = ""'")

from lncrna_bc.

LauraMCE avatar LauraMCE commented on September 4, 2024

Hi! I've indicated the header but I don't know how to indicate rownames... help!

from lncrna_bc.

camillethuyentruong avatar camillethuyentruong commented on September 4, 2024

https://github.com/opetchey/RREEBES/wiki/Reading-data-and-code-from-an-online-github-repository

How to upload a file in R from Github

from lncrna_bc.

LauraMCE avatar LauraMCE commented on September 4, 2024

Hi! I added a line in the script,
VPSol <- data.frame(BCresultsNR$log2FoldChange, BCresultsNR$sig, row.names = rownames(BCresultsNR)) ##Creates a data frame with coordinates##
This generates a data frame with coordinates data. For colors, I would like to categorize data following this:

Color 1: $log2FC > 1.5, $sig <0.05
Color 2: $log2FC < -1.5, $sig <0.05
Color 3: $log2FC > 1.5, $sig > 0.05
Color 4: $log2FC < -1.5, $sig >0.05
Color 5: 0 < $log2FC< 1.5, $sig > 0.05
Color 6: -1.5 < $log2FC < 0
Thanks!!!

from lncrna_bc.

cristoichkov avatar cristoichkov commented on September 4, 2024

Hi Laura

I have the answer, you have to do this:

##Rename the columns to simplify the dataframe##

VPSol <- VPSol %>% rename(FoldChange = BCresultsNR.log2FoldChange, p_value = BCresultsNR.sig)

##Create a column with colors depending on the value of Fold Change and p-value##  

VPSol$color <- ifelse((VPSol$FoldChange > 1.5) & (VPSol$p_value < 0.05), "Col_1",
                      ifelse((VPSol$FoldChange < -1.5) & (VPSol$p_value < 0.05), "Col_2",
                             ifelse((VPSol$FoldChange > 1.5) & (VPSol$p_value > 0.05), "Col_3",
                                    ifelse((VPSol$FoldChange < -1.5) & (VPSol$p_value > 0.05), "Col_4",
                                           ifelse((VPSol$FoldChange < 1.5) & (VPSol$p_value > 0.05), "Col_5", "Col_6")))))

##Create plot##
ggplot(VPSol, aes(x=FoldChange, y=p_value)) +
  geom_point(aes(colour = color)) 

I can run it on my computer, I hope you can also run it. In ggplot we can put the lines to divide the grid, but I don't know how to you want it.

from lncrna_bc.

camillethuyentruong avatar camillethuyentruong commented on September 4, 2024

Hi Laura

I finally found a way to upload the dataframe in R from GitHub!

# upload the csv file
# the first column need to have a name - I modified the csv file by adding "sample" on the first column 
# the link need to be the raw data by clicking "view raw"

library (readr)
urlfile="https://raw.githubusercontent.com/LauraMCE/lncRNA_BC/master/Transcriptome/Data_1_Diff_genes.csv"
BCData<-read_csv(url(urlfile))

# transform the table into a dataframe, indicating that the first column is the row names
BCData <- as.data.frame(BCData)
rownames(BCData) <- BCData[, 1]
BCData <- BCData[, -1]

#verify that the data are correct
head(BCData)
row.names(BCData)
colnames(BCData)

It works on my computer. Try on your own and if it works, modify the code in Github so that everyone can access the data and make the graphic.

Good job everyone, we are getting close!

from lncrna_bc.

camillethuyentruong avatar camillethuyentruong commented on September 4, 2024

Hi Laura,
Don't forget to reply and if no further issues occur, close the issue!

from lncrna_bc.

LauraMCE avatar LauraMCE commented on September 4, 2024

Hi, @camillethuyentruong ! The code you provided me worked perfectly, and it is already uploaded in the code. Thanks!
Hi, @cristoichkov ! Thanks for the script. I did some changes that you can see here, but... It worked!! I have now a very nice Volcano Plot with a lot of colors. Thanks everybody @VeroIarrachtai @camillethuyentruong for helping me!!
VP

from lncrna_bc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.