Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_gene_overrepresentation: visualising results #47

Open
mblue9 opened this issue May 31, 2020 · 7 comments
Open

test_gene_overrepresentation: visualising results #47

mblue9 opened this issue May 31, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@mblue9
Copy link
Collaborator

mblue9 commented May 31, 2020

Do you have any recommendations for visualising the output of test_gene_overrepresentation?

Can it/should it use a clusterprofiler viz method: https://yulab-smu.github.io/clusterProfiler-book/ or a ggplot2 one?

@stemangiola
Copy link
Owner

Good question

in the past I have done something like this, for upregulated and downregulated, but is not so great

image

But on the website there is better examples, I'm wondering if I'm erasing key information that allows to build such plots.

@mblue9
Copy link
Collaborator Author

mblue9 commented Jun 8, 2020

Just to follow up here, don't think this issue is a high priority (for workshop anyway) as may not have time for any pathway analyses, but if needed we could maybe have this below as a suggestion for how to visualise results. It's not using test_gene_overrepresentation it's using clusterProfiler itself with tidybulk test_differential_abundance output and tidyverse style and can get all the clusterprofiler plots.

library(clusterProfiler)
library(org.Hs.eg.db)

# extract all genes tested for DE
res <- counts_de_pretty %>% 
    pivot_transcript() %>% 
    filter(!lowly_abundant)

# GO terms
egoCC <- res %>%
    filter(FDR < 0.1 & logFC > 0 ) %>%
    pull( "transcript" ) %>%
    enrichGO(
      OrgDb = org.Hs.eg.db,
      keyType = 'SYMBOL',
      ont = "BP",
      universe = (res %>% pull( "transcript" ) ) )

dotplot(egoCC)
goplot(egoCC)
emapplot(egoCC)


# MSigDB Hallmark
gmtH <- read.gmt( "https://data.broadinstitute.org/gsea-msigdb/msigdb/release/6.2/h.all.v6.2.symbols.gmt" )
enrH <- enricher(
   gene = ( res %>% filter(FDR < 0.1 & logFC > 0) %>%
    pull( "transcript" ) ),
   TERM2GENE = gmtH,
   universe = ( res %>% pull( "transcript" ) ) )

dotplot( enrH )
emapplot(enrH)

@stemangiola
Copy link
Owner

I'm lost with this issue? Is it still relevant?

@mblue9
Copy link
Collaborator Author

mblue9 commented Oct 17, 2020

Well I think we should have a tidybulk pathway/gene set analysis section at some point for a workshop.

For the moment I just put some info in the supplementary here
https://stemangiola.github.io/biocasia2020_tidytranscriptomics/articles/supplementary.html#how-to-perform-gene-enrichment-analysis-1

But it doesn't use the tidybulk pathway analysis, it just uses tidybulk de results and then clusterprofiler viz:

dotplot(egoCC)
goplot(egoCC)
emapplot(egoCC)

Not sure whether better to use clusterprofiler for the viz or try to visualise tidybulk pathway results?

@stemangiola
Copy link
Owner

tidybulk can be used for calculation and attr(..., "") can be used to extract raw results and plotting them. Now sure if it's too messy. OK let's try to keep thinking about this

@stemangiola
Copy link
Owner

Is this still relevant? @mblue9 any interest in doing a blog post on pathway analyses with tidybulk? so there would be a real application for me to get this improved.

@mblue9
Copy link
Collaborator Author

mblue9 commented Jun 27, 2022

For me at the moment it's not a very high priority but I'd be happy to write a blog post if you want to focus on improving this aspect. Or we can wait til we have more time to work on it.

Just noting here I have a tiny bit on tidybulk pathway analysis here which we could build on using that dataset or airway or another
https://mblue9.github.io/RNAseq-R-tidyverse/articles/tidytranscriptomics.html#gene-set-testing-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants