Question: graphs plotong by R
0
gravatar for fatimarasool135
14 months ago by
fatimarasool13560 wrote:

Hi, I need help in drawing the graphs by using the R. I have generated the graphs for genes by following code as but colours for each plot are not appeared in graph. In first code, I have generated the bocplot for 6 samples i want each sample should be in colored but all are black. same as for PC and volcano graph. I am very thank full some one resole my problem.

boxplot(gene_expr_data + 0.01, col = pData(bg_data)$Color, log= "y", las = 2, names = pData(bg_data)$ID, ylim = c(0.01, 1E9))

plot(pc$x[,1:2], pch = 21, bg = pData(bg_data)$Color, cex = 2, ylim = c(-100, 100), xlim = c(-100, 100), xlab = "PC1", ylab = "PC2", cex.lab = 1.4, cex.axis = 1.3)

plot(-log10(pval) ~ log2(fc), data = results_genes, pch = 21, main = "Volcano plot of differentially expressed genes", xlab = "log2 Fold Change", ylab = "-log10(P Value)", bg = "darkgrey", xlim = c(-8, 8), ylim=c(0, 19), cex.lab = 1.3, cex.axis = 1.3)
rna-seq R • 373 views
ADD COMMENTlink modified 14 months ago by h.mon31k • written 14 months ago by fatimarasool13560
2

Can you post the output of the command head(pData(bg_data)$Color)?

As an alternative, you can use this command to use six colors for the boxplot: boxplot(gene_expr_data + 0.01, col = c("red","blue","green","yellow","brown","pink"), log= "y", las = 2, names = pData(bg_data)$ID, ylim = c(0.01, 1E9))

ADD REPLYlink modified 14 months ago • written 14 months ago by Fabio Marroni2.6k

Hi Fabio, Thank you. code you gave me functional and it resolve my problem. but I am stuck for PC and volcano graph.same issue colours are not show in graphs.code for PC and volcano graph shown in above post.

I have run this commad. head(pData(bg_data)$Color) out put was NULL

ADD REPLYlink modified 14 months ago • written 14 months ago by fatimarasool13560

Hi fabio, colours are not shown in PC graph and valcano graph. kindly set the code

ADD REPLYlink written 14 months ago by fatimarasool13560

Hi Fatima, changing the colors of a volcano plot implies that you know which points you want to be of different colors. I refer you to some examples that may help you:

How to change colour of points in volcano plot by common genes?

https://stackoverflow.com/questions/46197561/different-colors-of-points-in-volcano-plot-using-r

ADD REPLYlink modified 14 months ago • written 14 months ago by Fabio Marroni2.6k

Yes got it. Thanks . Now I want to extract the list of genes (significant results) having FDR <0.05 and FC > 10.0 or FC<0.10 from file which have all expressed genes. how can i do it ?

ADD REPLYlink written 14 months ago by fatimarasool13560

Can you share the first couple of lines of the dataset including your genes, FC and FDR?

ADD REPLYlink written 14 months ago by Fabio Marroni2.6k

head subsetq.csv "GeneName","feature","id","fc","pval","qval","Drought_sensitive_G1","Drought_sensitive_G2","Drought_tolerant_G3","Drought_tolerant_G4","Drought_tolerant_G5","Drought_tolerant_G6" ".","gene","MSTRG.10469",0.329488903619917,0.00142832748896338,0.259910259261526,2.5003,2.232766,0.135729,0,0,0.190792 ".","gene","MSTRG.10698",0.241268839517611,0.000317188508969446,0.136790531924965,2.923064,3.810668,0,0,0,0 ".","gene","MSTRG.13119",0.352790048999932,0.000539677563831664,0.180199910439792,1.701282,2.229747,0,0,0,0 ".","gene","MSTRG.13337",0.681896653988615,0.00204281315386956,0.295375398034284,19.546333,15.836477,12.656379,13.152587,15.144008,12.34343 ".","gene","MSTRG.14016",0.25669290807353,0.00196804175129006,0.29428213874073,4.482871,4.906847,0.389837,0.673042,1.040834,0.530697

ADD REPLYlink written 14 months ago by fatimarasool13560

Hi Fabio, please reply me . awaiting.

ADD REPLYlink written 14 months ago by fatimarasool13560

Hi Fatima, I guess you have read the file subsetq.csv as an R object (data.frame or something else). I would need to see the first couple of lines of that object to be able to help you.

ADD REPLYlink written 14 months ago by Fabio Marroni2.6k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1556 users visited in the last hour