Question: No subscript and hgnc symbols display in volcano plots
0
gravatar for Nicky
14 days ago by
Nicky0
Nicky0 wrote:

hi guys, I am making a volcano plot and so far have this: (I am new in R, just a couple of days of experience so excuse me if I made something silly).

setwd("Gene_R_coding")

padj<- RNAseq[RNAseq$padj<=0.01,]

FC<- subset(padj,abs(log2FoldChange)>=1)

write.csv(FC,file="CMP_FC.csv")

plot<- with(RNAseq,plot(RNAseq$log2FoldChange,-log10(RNAseq$padj),
                            main="VolcanoPlot",
                            xlab="Effect size: fold-change (Log[2])",
                            ylab="-Log[10] (adj.p-value)",
                            ylim=c(0,90), 
                            pch=20,                
                            abline(h=-log10(0.01),
                                   col="blue",
                                   lty="1343",
                                   lwd="2",
                                   abline(v=c(-2,2),
                                          col="blue",
                                          lty= "1343",
                                          lwd= "2",
                                          abline(v=c(0),
                                                 col="blue",
                                                 lty= "1343",


                                          )))))

            with(subset(RNAseq,padj<0.01),points(log2FoldChange,-log10(padj),pch=20,col="red"))
                  with(subset(RNAseq,padj<0.01 & abs(log2FoldChange)<2),points(log2FoldChange,-log10(padj),pch=20,col="lightgrey"))
                  with(subset(RNAseq,padj<0.01 & log2FoldChange>2),points(log2FoldChange,-log10(padj),pch=20,col="green3"))
                         with(subset(RNAseq,padj>0.01),points(log2FoldChange,-log10(padj),pch=20,col="lightgrey"))


                            hgnc_symbol <- abs(RNAseq$log2FoldChange) > 5 & RNAseq$padj<0.001
                                text(RNAseq$log2FoldChange[hgnc_symbol],
                                   -log10(RNAseq$padj)[hgnc_symbol],
                                               lab=rownames(RNAseq)[hgnc_symbol], cex=0.5)

for some reasons the volcano plot do not display the subscript even after brakets addition in log[2] and log[10] any idea why?

the other problem is that the volcano plot does not display the hgnc_symbol, it gave me numbers instead!

my data set has the following headers

    ensembl HGNC.ID NCBI.gene.ID    Predicted.HGNC.symbol   hgnc_symbol baseMean    log2FoldChange  lfcSE   stat    pvalue  padj
volcano plot rna-seq gene • 118 views
ADD COMMENTlink modified 12 days ago • written 14 days ago by Nicky0

Nicky

Try this for subscript issues:

plot(1:10,xlab=expression('Effect size: fold-change (Log'[2]*')'), ylab=expression('-Log'[10]*'(adj.p-value)'))

For hgnc_symbol, looking at the df structure may help.

Rplot

ADD REPLYlink modified 13 days ago • written 13 days ago by cpad011211k

Hi, thank you very much,

The subscript actually worked!

I haven't been lucky to get the gene name, what do you mean by "looking at the df structure"

thanks again

ADD REPLYlink written 12 days ago by Nicky0

try printing this: rownames(RNAseq)[hgnc_symbol] and str(rownames(RNAseq)[hgnc_symbol])

ADD REPLYlink modified 12 days ago • written 12 days ago by cpad011211k
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: 1652 users visited in the last hour