visualizing GSEA showCategory question
1
0
Entering edit mode
@12661823
Last seen 11 months ago
United States
#make a gene network from enriched pathways
options(ggrepel.max.overlaps = Inf)
## convert gene ID to Symbol
edox <- setReadable(gse, 'org.Mm.eg.db', 'ENSEMBL')
p2 <- cnetplot(edox, categorySize="pvalue", showCategory=16, foldChange=gene_list, node_label="category")

I'm using the above code to try to make a gene network for some pathways enriched in my GSEA data analysis, however one of the pathways that I am interested in including is the 16th pathway in the list. Because of the number of genes involved, plotting with showCategory=16 is too cluttered. I want to write some sort of ifelse statement to plot just the 16th pathway. Or does anyone know how to specify show category as a range where the first included pathway is not the first pathway? I'm using the enrichplot library with DOSE dependencies.

Thank you for your help!

enrichplot • 581 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 16 hours ago
United States

There might be a more direct method, but this works. Note that it's better to show a self-contained example that other people can run, like I do below, using the example from ?cnetplot

> library(DOSE)
> data(geneList)
> de <- names(geneList)[1:100]
> x <- enrichDO(de)
> x2 <- pairwise_termsim(x)
> as.data.frame(x2)$Description[1:16]
 [1] "urinary bladder cancer"                   
 [2] "esophageal carcinoma"                     
 [3] "stomach cancer"                           
 [4] "microcephaly"                             
 [5] "interstitial lung disease"                
 [6] "esophageal cancer"                        
 [7] "sarcoidosis"                              
 [8] "biliary tract cancer"                     
 [9] "pre-malignant neoplasm"                   
[10] "breast ductal carcinoma"                  
[11] "pulmonary sarcoidosis"                    
[12] "hypersensitivity reaction type IV disease"
[13] "endometrial carcinoma"                    
[14] "bronchiolitis obliterans"                 
[15] "in situ carcinoma"                        
[16] "thoracic aortic aneurysm"     
> cnetplot(x2, showCategory = "thoracic aortic aneurysm" )
## or let's say you want three terms, 
> cnetplot(x2, showCategory = as.data.frame(x2)$Description[c(1,5,16)])

Note that this is explained in the help page

showCategory: A number or a vector of terms. If it is a number, the
          first n terms will be displayed. If it is a vector of terms,
          the selected terms will be displayed.

The trick is figuring out how to get the terms.

ADD COMMENT

Login before adding your answer.

Traffic: 465 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