Entering edit mode
5.4 years ago
fatimarasool135
▴
90
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)
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))
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
Hi fabio, colours are not shown in PC graph and valcano graph. kindly set the code
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
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 ?
Can you share the first couple of lines of the dataset including your genes, FC and FDR?
Hi Fabio, please reply me . awaiting.
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.