hansenlab / minfi

Devel repository for minfi
58 stars 68 forks source link

Issues with estimateCellCounts #99

Closed sirselim closed 7 years ago

sirselim commented 7 years ago

Hi there, I am currently trying to run the estimateCellCounts function across several different experiments and am hitting an error (shown below). I am using the developer version of both R and Bioconductor (session info at the bottom).

> if(require(FlowSorted.Blood.450k)) {
+     wh.WBC <- which(FlowSorted.Blood.450k$CellType == "WBC")
+     wh.PBMC <- which(FlowSorted.Blood.450k$CellType == "PBMC")
+     RGset <- FlowSorted.Blood.450k[, c(wh.WBC, wh.PBMC)]
+     ## The following line is purely to work around an issue with repeated
+     ## sampleNames and Biobase::combine()
+     sampleNames(RGset) <- paste(RGset$CellType,
+                                 c(seq(along = wh.WBC), seq(along = wh.PBMC)), sep = "_")
+     counts <- estimateCellCounts(RGset, meanPlot = FALSE)
+     round(counts, 2)
+ }
[estimateCellCounts] Combining user data with reference (flow sorted) data.

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘colData<-’ for signature ‘"RGChannelSet", "data.frame"’

I was receiving the above error when trying to look at different data sets of my own (both 450K and EPIC data), so thought I'd run through the example provided with the function to check - I end up with the same error.

I've tried working through the source code line by line and have come across a few issues:

I've got further ahead but am now finding issues with missing functions such as pickCompProbes, which I found here but am unable to see how this is sourced via the minfi package itself. I've added these functions manually but am hitting a series of other issues now, so I'm beginning to wonder if I'm missing something obvious.

Hopefully this is somewhat coherent and helpful, as always I'm more than happy to help/test where I can and really appreciate the work you guys put into this great package.

R session information:

> sessionInfo()
R Under development (unstable) (2017-03-22 r72384)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux stretch/sid

Matrix products: default
BLAS: /home/miles/svn/R/r-devel/build/lib/libRblas.so
LAPACK: /home/miles/svn/R/r-devel/build/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] quadprog_1.5-5                                      genefilter_1.57.0                                  
 [3] minfiDataEPIC_1.1.1                                 IlluminaHumanMethylationEPICanno.ilm10b2.hg19_0.6.0
 [5] IlluminaHumanMethylationEPICmanifest_0.3.0          minfiData_0.21.1                                   
 [7] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.0  IlluminaHumanMethylation450kmanifest_0.4.0         
 [9] FlowSorted.Blood.450k_1.13.1                        minfi_1.21.5                                       
[11] bumphunter_1.15.0                                   locfit_1.5-9.1                                     
[13] iterators_1.0.8                                     foreach_1.4.3                                      
[15] Biostrings_2.43.6                                   XVector_0.15.2                                     
[17] SummarizedExperiment_1.5.7                          DelayedArray_0.1.7                                 
[19] matrixStats_0.51.0                                  Biobase_2.35.1                                     
[21] GenomicRanges_1.27.23                               GenomeInfoDb_1.11.9                                
[23] IRanges_2.9.19                                      S4Vectors_0.13.15                                  
[25] BiocGenerics_0.21.3                                 BiocInstaller_1.25.3                               

loaded via a namespace (and not attached):
 [1] mclust_5.2.3              base64_2.0                Rcpp_0.12.10              lattice_0.20-35           Rsamtools_1.27.13        
 [6] digest_0.6.12             R6_2.2.0                  plyr_1.8.4                RSQLite_1.1-2             httr_1.2.1               
[11] zlibbioc_1.21.0           GenomicFeatures_1.27.10   data.table_1.10.4         annotate_1.53.1           Matrix_1.2-9             
[16] preprocessCore_1.37.0     splines_3.4.0             BiocParallel_1.9.5        stringr_1.2.0             RCurl_1.95-4.8           
[21] biomaRt_2.31.4            compiler_3.4.0            rtracklayer_1.35.9        multtest_2.31.0           pkgmaker_0.22            
[26] openssl_0.9.6             GEOquery_2.41.0           GenomeInfoDbData_0.99.0   codetools_0.2-15          XML_3.98-1.5             
[31] reshape_0.8.6             GenomicAlignments_1.11.12 MASS_7.3-47               bitops_1.0-6              grid_3.4.0               
[36] nlme_3.1-131              xtable_1.8-2              registry_0.3              DBI_0.6                   magrittr_1.5             
[41] stringi_1.1.3             doRNG_1.6                 limma_3.31.19             nor1mix_1.2-2             RColorBrewer_1.1-2       
[46] siggenes_1.49.0           tools_3.4.0               illuminaio_0.17.0         rngtools_1.2.4            survival_2.41-2          
[51] yaml_2.1.14               AnnotationDbi_1.37.4      beanplot_1.2              memoise_1.0.0  
Jfortin1 commented 7 years ago

Hi Miles,

Thanks for bringing this to our attention. Indeed there was a bug; the required metadata object must be of class DataFrame, and not data.frame. I just submitted a pull request and it should work once accepted. Thanks,

JP

kasperdanielhansen commented 7 years ago

Pull request merged in Github. It may be a few days before it appears through Bioconductor.