egeulgen / pathfindR

pathfindR: Enrichment Analysis Utilizing Active Subnetworks
https://egeulgen.github.io/pathfindR/
Other
178 stars 25 forks source link

object 'GO_all_terms_df' not found, go_df <- pathfindR:::GO_all_terms_df #53

Closed choijamtsmunkhzul closed 4 years ago

choijamtsmunkhzul commented 4 years ago

Hello, egeulgen

I want to do perform single gene set GO analysis using pathfindR -> enrciment() but i got following ERRORs:

1. First here is gene lists:

genes <- read.table("genes.txt", header=TRUE)
head(genes)
#                    genes
#1                 Cdc37l1
#2                  Slc4a4
#3                  Smurf1
#4                 Akap17b

And here is the execution with enrichment {pathfindR}:

library(pathfindR)

go_df <- pathfindR:::GO_all_terms_df
go_all_descriptions <- go_df$GO_term
names(go_all_descriptions) <- go_df$GO_ID

result_df <- enrichment(input_genes = genes$genes,
                        genes_by_term = go_all_genes,
                        term_descriptions = go_all_descriptions,
                        adj_method = "bonferroni", 
                        enrichment_threshold = 0.05, 
                        sig_genes_vec = genes$genes
                        background_genes = unique(unlist(go_all_genes)))

But I got follwoing ERRORs:

go_df <- pathfindR:::GO_all_terms_df
Error in get(name, envir = asNamespace(pkg), inherits = FALSE) : 
  object 'GO_all_terms_df' not found

Also I tried to do other way:

result_df1 <- enrichment(input_genes = genes$genes,
                        genes_by_term = pathfindR.data::go_all_genes,
                        term_descriptions = pathfindR.data::go_all_descriptions,
                        adj_method = "bonferroni", 
                        enrichment_threshold = 0.05, # 
                        sig_genes_vec = genes$genes
                        background_genes = unique(unlist(pathfindR.data::go_all_genes)))

But I got following ERRORs:

`Error: 'go_all_descriptions' is not an exported object from 'namespace:pathfindR.data' ` How can i check GO all data: -> single gene set enrichment analysis?

Thank you

egeulgen commented 4 years ago

hey @choijamtsmunkhzul

There is no object called go_all_descriptions. GO_all_terms_df is now part of pathfindR.data, if you change that line to pathfindR.data:::GO_all_terms_df, it should work fine.

However, I would suggest using the function fetch_gene_set() to obtain the genes list and the descriptions as it also filters the gene set. You can find the documentation for fetch_gene_set() here