Example from TissueEnrich documentation throws error
0
0
Entering edit mode
@sarveshnikumbh-13961
Last seen 2.1 years ago
United Kingdom

The examples in the documentation of TissueEnrich doesn't seem to work. See output below.

I first got the same error with my own GeneSet object, so tried the example but that too throws the same error.

> packageVersion("TissueEnrich")
[1] ??1.14.0??
> library(dplyr)

Attaching package: ??dplyr??

The following objects are masked from ??package:stats??:

    filter, lag

The following objects are masked from ??package:base??:

    intersect, setdiff, setequal, union

> library(ggplot2)
> genes<-system.file('extdata', 'inputGenes.txt', package = 'TissueEnrich')
> inputGenes<-scan(genes,character())
Read 97 items
> gs<-GSEABase::GeneSet(geneIds=inputGenes,organism='Homo Sapiens',
+             geneIdType=GSEABase::SymbolIdentifier())
> output<-teEnrichment(gs)
Error in teEnrichment(gs) : could not find function "teEnrichment"
> library(dplyr)
> library(ggplot2)
> genes<-system.file('extdata', 'inputGenes.txt', package = 'TissueEnrich')
> inputGenes<-scan(genes,character())
Read 97 items
> gs<-GSEABase::GeneSet(geneIds=inputGenes,organism='Homo Sapiens',
+             geneIdType=GSEABase::SymbolIdentifier())
> output<-TissueEnrich::teEnrichment(gs)
Error: conditions failed for call 'TissueEnrich::teEnrichment(gs)':
     * !is.null(.) && (is(., "GeneSet")) && !is.null(geneIds(.))
 Description: Please enter correct inputGenes.
                    It should be a Gene set object.

> is(gs, "GeneSet")
[1] TRUE
> class(gs)
[1] "GeneSet"
attr(,"package")
[1] "GSEABase"

Session Information is as below.

> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux bookworm/sid

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.18.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_DK.UTF-8       
 [4] LC_COLLATE=C               LC_MONETARY=en_DK.UTF-8    LC_MESSAGES=en_DK.UTF-8   
 [7] LC_PAPER=en_DK.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_DK.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_3.3.5 dplyr_1.0.7  

loaded via a namespace (and not attached):
 [1] SummarizedExperiment_1.24.0 KEGGREST_1.34.0             tidyselect_1.1.1           
 [4] purrr_0.3.4                 lattice_0.20-45             colorspace_2.0-2           
 [7] vctrs_0.3.8                 generics_0.1.1              stats4_4.1.1               
[10] utf8_1.2.2                  blob_1.2.2                  XML_3.99-0.8               
[13] rlang_0.4.12                TissueEnrich_1.14.0         pillar_1.6.4               
[16] glue_1.4.2                  withr_2.4.2                 DBI_1.1.1                  
[19] BiocGenerics_0.40.0         bit64_4.0.5                 matrixStats_0.61.0         
[22] GenomeInfoDbData_1.2.7      lifecycle_1.0.1             MatrixGenerics_1.6.0       
[25] zlibbioc_1.40.0             Biostrings_2.62.0           munsell_0.5.0              
[28] gtable_0.3.0                memoise_2.0.0               Biobase_2.54.0             
[31] IRanges_2.28.0              fastmap_1.1.0               GenomeInfoDb_1.30.0        
[34] ensurer_1.1                 AnnotationDbi_1.56.0        fansi_0.5.0                
[37] GSEABase_1.56.0             Rcpp_1.0.7                  xtable_1.8-4               
[40] scales_1.1.1                BiocManager_1.30.16         DelayedArray_0.20.0        
[43] cachem_1.0.6                S4Vectors_0.32.0            graph_1.72.0               
[46] annotate_1.72.0             XVector_0.34.0              bit_4.0.4                  
[49] png_0.1-7                   GenomicRanges_1.46.0        grid_4.1.1                 
[52] tools_4.1.1                 bitops_1.0-7                magrittr_2.0.1             
[55] RCurl_1.98-1.5              tibble_3.1.5                RSQLite_2.2.8              
[58] tidyr_1.1.4                 crayon_1.4.1                pkgconfig_2.0.3            
[61] Matrix_1.3-4                ellipsis_0.3.2              assertthat_0.2.1           
[64] httr_1.4.2                  rstudioapi_0.13             R6_2.5.1                   
[67] compiler_4.1.1
TissueEnrich • 998 views
ADD COMMENT
0
Entering edit mode

I realized that that the error is caused due to call to geneIds function from the GSEABase package but is not imported in the package.

This statement

ensurer::ensure_that(gs, !is.null(gs) && (is(gs, "GeneSet")) && !is.null(geneIds(gs)))

works only if GSEABase is loaded with library(GSEABase) before running the example. If this call is not made, then the said error is thrown.

Maybe importing this function from GSEABase will resolve this.

ADD REPLY
1
Entering edit mode

I see that you are not loading the TissueEnrich package before running the teEnrichment function. Can you please load it first and then try it again? All the dependencies will automatically load after loading TissueEnrich. I will also update my documentation with library(TissueEnrich) in the example.

ADD REPLY
0
Entering edit mode

Oh right. Good catch. I tend to use functions with :: so that it is easier to note the package from which the function is used.

Thanks for the quick response, Ashish!

ADD REPLY

Login before adding your answer.

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