MAST invalid Hypothesis, class objectORconnection error
0
0
Entering edit mode
TriS ▴ 200
@tris-5635
Last seen 3.7 years ago
United States

hi all

I'm using MAST to run DEG analysis for treated vs. untreated samples.

I use the following code:

cond <- factor(df$Group) cond <- relevel(cond, "CTR")
colData(sca)$condition <- cond
zlmCond <- zlm(~ condition, sca)

followign the example here: https://bioconductor.org/packages/release/bioc/vignettes/MAST/inst/doc/MAITAnalysis.html#4differentialexpressionusingahurdlemodel

however, when I have to run lrTest with:

summaryCond <- summary(zlmCond, doLRT='conditionTREAT')

I get the following error:

invalid class “Hypothesis” object: superclass "characterORconnection" not defined in the environment of the object's class

my colData(sca) look like this:

DataFrame with 3872 rows and 2 columns
                                                wellKey condition
                                            <character>  <factor>
CTR_CC30_CC30_TAGAGTCCACCCAATA-1 CTR_CC30_CC30_TAGAGT..       CTR
CTR_CC30_CC30_CCTAACCAGCTAGCCC-1 CTR_CC30_CC30_CCTAAC..       CTR
CTR_CC30_CC30_CTACCCAGTGACACGA-1 CTR_CC30_CC30_CTACCC..       CTR
CTR_CC30_CC30_TGACCCTCACTAGTAC-1 CTR_CC30_CC30_TGACCC..       CTR
CTR_CC30_CC30_GGGACCTGTACTGAGG-1 CTR_CC30_CC30_GGGACC..       CTR
...                                                 ...       ...
TREAT_TG1_AGCGTCGTCGGCTGAC-1    TREAT_TG1_AGCGTCGTC..    TREAT
TREAT_TG1_TTGACCCCACTTGACA-1    TREAT_TG1_TTGACCCCA..    TREAT
TREAT_TG1_TTGCATTGTTCCAAAC-1    TREAT_TG1_TTGCATTGT..    TREAT
TREAT_TG1_GTCGTAAGTCACTCTC-1    TREAT_TG1_GTCGTAAGT..    TREAT
TREAT_TG1_ACGGGTCGTATCGTGT-1    TREAT_TG1_ACGGGTCGT..    TREAT

and my zlmCond looks as follows:

print(summary(zlmCond), n=5)
Combining coefficients and standard errors
Calculating log-fold changes
Fitted zlm with top 5 genes per contrast:
( log fold change Z-score )
 primerid  conditionTREAT
 Elf4_(+)     5.8*        
 Ep300_(+)    5.7*        
 Ikzf1_(+)    6.1*        
 Stat1_(+)    6.1*        
 Stat2_(+)    5.5*

I tried re-installing MAST and restarting the R session but it didn't help...

traceback()

gives:

15: h(simpleError(msg, call))
14: .handleSimpleError(function (cond) 
    .Internal(C_tryCatchHelper(addr, 1L, cond)), "invalid class “CoefficientHypothesis” object: superclass \"characterORconnection\" not defined in the environment of the object's class", 
        base::quote(validObject(.Object)))
13: stop(msg, ": ", errors, domain = NA)
12: validObject(.Object)
11: initialize(value, ...)
10: initialize(value, ...)
9: new(whoami, .Data = hypothesis)
8: CoefficientHypothesis(x)
7: lrTest(object, CoefficientHypothesis(x))
6: FUN(X[[i]], ...)
5: lapply(doLRT, function(x) lrTest(object, CoefficientHypothesis(x))[, 
       , "Pr(>Chisq)"])
4: lapply(doLRT, function(x) lrTest(object, CoefficientHypothesis(x))[, 
       , "Pr(>Chisq)"])
3: .local(object, ...)
2: summary(zlmCond, doLRT = "conditionTREAT")
1: summary(zlmCond, doLRT = "conditionTREAT")

and sessionInfo() is:

R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] MAST_1.15.0                 SingleCellExperiment_1.11.6 SummarizedExperiment_1.19.6
 [4] DelayedArray_0.15.7         matrixStats_0.56.0          Matrix_1.2-18              
 [7] Biobase_2.49.0              GenomicRanges_1.41.6        GenomeInfoDb_1.25.10       
[10] IRanges_2.23.10             S4Vectors_0.27.12           BiocGenerics_0.35.4        

loaded via a namespace (and not attached):
  [1] reticulate_1.16           tidyselect_1.1.0          fftw_1.0-6               
  [4] htmlwidgets_1.5.1         grid_4.0.2                BiocParallel_1.23.2      
  [7] Rtsne_0.15                devtools_2.3.1            munsell_0.5.0            
 [10] codetools_0.2-16          ica_1.0-2                 future_1.18.0            
 [13] miniUI_0.1.1.1            withr_2.2.0               colorspace_1.4-1         
 [16] rstudioapi_0.11           Seurat_3.2.0              ROCR_1.0-11              
 [19] tensor_1.5                listenv_0.8.0             emmeans_1.4.8            
 [22] GenomeInfoDbData_1.2.3    polyclip_1.10-0           bit64_4.0.2              
 [25] rprojroot_1.3-2           coda_0.19-3               vctrs_0.3.2              
 [28] generics_0.0.2            TH.data_1.0-10            R6_2.4.1                 
 [31] ggbeeswarm_0.6.0          clue_0.3-57               rsvd_1.0.3               
 [34] hdf5r_1.3.2               bitops_1.0-6              spatstat.utils_1.17-0    
 [37] assertthat_0.2.1          promises_1.1.1            scales_1.1.1             
 [40] multcomp_1.4-13           beeswarm_0.2.3            gtable_0.3.0             
 [43] globals_0.12.5            processx_3.4.3            goftest_1.2-2            
 [46] sandwich_2.5-1            rlang_0.4.7               GlobalOptions_0.1.2      
 [49] splines_4.0.2             lazyeval_0.2.2            BiocManager_1.30.10      
 [52] yaml_2.2.1                reshape2_1.4.4            abind_1.4-5              
 [55] backports_1.1.8           httpuv_1.5.4              tools_4.0.2              
 [58] usethis_1.6.1             ggplot2_3.3.2             qusage_2.23.0            
 [61] ellipsis_0.3.1            gplots_3.0.4              RColorBrewer_1.1-2       
 [64] sessioninfo_1.1.1         ggridges_0.5.2            Rcpp_1.0.5               
 [67] plyr_1.8.6                progress_1.2.2            zlibbioc_1.35.0          
 [70] purrr_0.3.4               RCurl_1.98-1.2            ps_1.3.4                 
 [73] prettyunits_1.1.1         rpart_4.1-15              deldir_0.1-28            
 [76] pbapply_1.4-2             GetoptLong_1.0.2          viridis_0.5.1            
 [79] cowplot_1.0.0             zoo_1.8-8                 ggrepel_0.8.2            
 [82] cluster_2.1.0             fs_1.5.0                  magrittr_1.5             
 [85] data.table_1.13.0         circlize_0.4.10           lmtest_0.9-37            
 [88] RANN_2.6.1                mvtnorm_1.1-1             fitdistrplus_1.1-1       
 [91] pkgload_1.1.0             hms_0.5.3                 patchwork_1.0.1          
 [94] mime_0.9                  xtable_1.8-4              gridExtra_2.3            
 [97] shape_1.4.4               testthat_2.3.2            compiler_4.0.2           
[100] scater_1.17.4             tibble_3.0.3              KernSmooth_2.23-17       
[103] crayon_1.3.4              R.oo_1.23.0               htmltools_0.5.0          
[106] mgcv_1.8-31               later_1.1.0.1             tidyr_1.1.1              
[109] ComplexHeatmap_2.5.5      MASS_7.3-51.6             cli_2.0.2                
[112] R.methodsS3_1.8.0         gdata_2.18.0              igraph_1.2.5             
[115] pkgconfig_2.0.3           plotly_4.9.2.1            scuttle_0.99.12          
[118] vipor_0.4.5               XVector_0.29.3            estimability_1.3         
[121] stringr_1.4.0             callr_3.4.3               digest_0.6.25            
[124] sctransform_0.2.1         RcppAnnoy_0.0.16          spatstat.data_1.4-3      
[127] leiden_0.3.3              uwot_0.1.8                DelayedMatrixStats_1.11.1
[130] shiny_1.5.0               gtools_3.8.2              rjson_0.2.20             
[133] lifecycle_0.2.0           nlme_3.1-148              jsonlite_1.7.0           
[136] BiocNeighbors_1.7.0       desc_1.2.0                viridisLite_0.3.0        
[139] limma_3.45.10             fansi_0.4.1               pillar_1.4.6             
[142] lattice_0.20-41           fastmap_1.0.1             httr_1.4.2               
[145] pkgbuild_1.1.0            survival_3.2-3            glue_1.4.1               
[148] remotes_2.2.0             spatstat_1.64-1           png_0.1-7                
[151] bit_4.0.4                 stringi_1.4.6             BiocSingular_1.5.0       
[154] caTools_1.18.0            memoise_1.1.0             dplyr_1.0.1              
[157] irlba_2.3.3               future.apply_1.6.0        ape_5.4-1

thanks

R MAST scRNASeq • 1.5k views
ADD COMMENT
0
Entering edit mode
  1. The final output you included makes it look like coefficient associated with the condition term is named conditionMCTP39, is that what you expect? You can figure out what all the coefficients are named by colnames(coef(zlmCond, 'D')).
  2. Assuming the answers to (1) don't solve your problem, what does traceback() say right after you get the error, and what is your sessionInfo()?
ADD REPLY
0
Entering edit mode

The name is actually correct, I manually changed it to TREAT just for the sake of this post, to make it easier to understand that it was the treatment group .

traceback() and sessionInfo()are above tnx

ADD REPLY
0
Entering edit mode

I am unable to replicate (R 4.0.2, MAST_1.15.0, macOS Mojave 10.14.6). See below for a working example. Can you provide a reproducible example.

library(MAST)
example(zlm)
summary(zlmVbeta, doLRT = 'Stim.ConditionUnstim')

Combining coefficients and standard errors Calculating log-fold changes Calculating likelihood ratio tests Refitting on reduced model... Done!

ADD REPLY

Login before adding your answer.

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