Enrichment plot in R with custom pathways
2
0
Entering edit mode
2.9 years ago
User000 ▴ 720

Dear all,

I have a file of differentially expressed genes like this which I created myself, with log2foldchange, padj value ad pathway lists.

gene    log2FoldChange  padj    symbol  geneID  PathwayName
ENSG00000005961 2.73694625177063    1.75838486189159e-09    ITGA2B  3674    DAP12 signaling
ENSG00000005961 2.73694625177063    1.75838486189159e-09    ITGA2B  3674    Developmental Biology
ENSG00000005961 2.73694625177063    1.75838486189159e-09    ITGA2B  3674    Dilated cardiomyopathy
ENSG00000005961 2.73694625177063    1.75838486189159e-09    ITGA2B  3674    Disease
ENSG00000007372 8.71303535934225    1.15609406376212e-42    PAX6    5080    Activation of anterior HOX genes in hindbrain development during early embryogenesis
ENSG00000007372 8.71303535934225    1.15609406376212e-42    PAX6    5080    Activation of HOX genes during differentiation
ENSG00000007372 8.71303535934225    1.15609406376212e-42    PAX6    5080    Developmental Biology
ENSG00000007372 8.71303535934225    1.15609406376212e-42    PAX6    5080    Incretin synthesis, secretion, and inactivation
ENSG00000008394 2.63354759009892    6.24693304719323e-06    MGST1   4257    Aflatoxin activation and detoxification
ENSG00000008394 2.63354759009892    6.24693304719323e-06    MGST1   4257    Aflatoxin activation and detoxification
ENSG00000008394 2.63354759009892    6.24693304719323e-06    MGST1   4257    Biological oxidations
ENSG00000008394 2.63354759009892    6.24693304719323e-06    MGST1   4257    Biological oxidations
ENSG00000008394 2.63354759009892    6.24693304719323e-06    MGST1   4257    Chemical carcinogenesis
ENSG00000008394 2.63354759009892    6.24693304719323e-06    MGST1   4257    Chemical carcinogenesis

I would like to plot an enrichment plot for the pathways in my list in R using values of log2foldchange and p-adj values, similar to this one. How to do this? EDIT: I would like to use my custom table in order to calculate the pathway enrichment, not just plot the table. enter image description here.

RNAseq DESeq2 enrichplot R • 1.6k views
ADD COMMENT
2
Entering edit mode

if you clean up your data, you can it easily. with limited data of yours, I could do this with following script:

ggplot(df, aes(log2FoldChange, PathwayName, size=log2FoldChange, color=gene))+
    geom_point()

enter image description here

ADD REPLY
2
Entering edit mode
2.9 years ago
fracarb8 ★ 1.7k

ggplot2 gives you all the arrows you need.

library(ggplot2)
ggplot(yourDF, aes(PathwayName,log2FoldChange, fill=padj)) +
    geom_point(stat = "identity") + 
    scale_fill_gradient( low="blue", high="red" ) +
    labs(y = "log2Fold", x='')  +
    coord_flip()
ADD COMMENT
1
Entering edit mode
2.9 years ago

Check the dotplot() function in the enrichplot Bioconductor package. See example in the Biomedical Knowledge Mining book.

ADD COMMENT
0
Entering edit mode

Thanks a lot. This does not work with a data.frame although, right?

ADD REPLY
0
Entering edit mode

Indeed but as pointed out in the other answers, this can also be easily accomplished with ggplot. Alternatively, enrichPlot(..., type = "dot") takes a data frame similar to the one produced by the getEnrich() function.

ADD REPLY

Login before adding your answer.

Traffic: 2839 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6