hbc / bcbioRNASeq

R package for bcbio RNA-seq analysis.
https://bioinformatics.sph.harvard.edu/bcbioRNASeq
GNU Affero General Public License v3.0
58 stars 21 forks source link

How to display the gene symbols on the volcano plot in the differential expression template? #99

Closed hliu2016 closed 6 years ago

hliu2016 commented 6 years ago

Hi, I have successfully run the differential expression rmarkdown template. It worked quite well. But I found that the volcano plot for the differentially expressed genes does not display the gene symbols. Is there any method to do this?

mjsteinbaugh commented 6 years ago

Indeed there is! Check out the documentation here: http://bioinformatics.sph.harvard.edu/bcbioRNASeq/reference/plotVolcano.html

You can label specific genes with the genes argument or label the top genes automatically using the ntop argument. Note that for the genes argument, we're requiring the Ensembl gene IDs instead of the gene symbols, which is better for code reproducibility.

The DESeqDataSet needs to be created using as(bcb, "DESeqDataSet") in order to contain the gene symbols. This information is saved in rowRanges() (GRanges object; see also mcols() function for working with GRanges metadata). The gene-to-symbol mappings are also accessible with the rowData() function and will return a DataFrame. These are mapped between the geneID and geneName (symbol) columns. Those are the values that will be used automatically in the volcano and MA plots.

hliu2016 commented 6 years ago

Thanks very much. The ntop parameter works well.