Minfi - estimatecellscount
1
0
Entering edit mode
clacarion • 0
@23b0716d
Last seen 5 months ago
France

Hi,

I am relatively new in R (hope is in the good section)

I am trying to run the function "estimatecellscount" from the minfi package on my RGset data. I have been able to import the targets and the RGset. The code that I am trying to execute is as follows:

est<-estimateCellCounts(rgset_pf)

"rgset_pf" is because it was after applying pfilter for the quality control

rgset_pf <- pfilter(rgset,pnthresh = 0.01)
`

Here's the error that is produced:

> est<-estimateCellCounts(rgset_pf)
[estimateCellCounts] Combining user data with reference (flow sorted) data.

[estimateCellCounts] Processing user and reference data together.

[preprocessQuantile] Mapping to genome.
Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.
In addition: Warning message:
In DataFrame(sampleNames = c(colnames(rgSet), colnames(referenceRGset)),  :
  'stringsAsFactors' is ignored

Any suggestions on how to fix this?

Best regards

:) Clara

> sessionInfo() 
R version 4.2.3 (2023-03-15)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.3

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/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  
[9] base     

other attached packages:
 [1] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.1
 [2] systemfonts_1.0.5                                 
 [3] mclust_6.0.1                                      
 [4] Matrix_1.6-5                                      
 [5] IlluminaHumanMethylation450kmanifest_0.4.0        
 [6] FlowSorted.Blood.450k_1.36.0                      
 [7] minfi_1.44.0                                      
 [8] bumphunter_1.40.0                                 
 [9] locfit_1.5-9.9                                    
[10] iterators_1.0.14                                  
[11] foreach_1.5.2                                     
[12] Biostrings_2.66.0                                 
[13] XVector_0.38.0                                    
[14] SummarizedExperiment_1.28.0                       
[15] Biobase_2.58.0                                    
[16] MatrixGenerics_1.10.0                             
[17] matrixStats_1.2.0                                 
[18] GenomicRanges_1.50.2                              
[19] GenomeInfoDb_1.34.9                               
[20] IRanges_2.32.0                                    
[21] S4Vectors_0.36.2                                  
[22] BiocGenerics_0.44.0                               

loaded via a namespace (and not attached):
  [1] rjson_0.2.21              siggenes_1.72.0           base64_2.0.1             
  [4] rstudioapi_0.15.0         bit64_4.0.5               AnnotationDbi_1.60.2     
  [7] fansi_1.0.6               xml2_1.3.6                codetools_0.2-19         
 [10] splines_4.2.3             sparseMatrixStats_1.10.0  cachem_1.0.8             
 [13] scrime_1.3.5              Rsamtools_2.14.0          annotate_1.76.0          
 [16] dbplyr_2.5.0              png_0.1-8                 HDF5Array_1.26.0         
 [19] BiocManager_1.30.22       readr_2.1.5               compiler_4.2.3           
 [22] httr_1.4.7                fastmap_1.1.1             limma_3.54.2             
 [25] cli_3.6.2                 prettyunits_1.2.0         tools_4.2.3              
 [28] glue_1.7.0                GenomeInfoDbData_1.2.9    dplyr_1.1.4              
 [31] rappdirs_0.3.3            doRNG_1.8.6               Rcpp_1.0.12              
 [34] vctrs_0.6.5               rhdf5filters_1.10.1       multtest_2.54.0          
 [37] preprocessCore_1.60.2     nlme_3.1-164              rtracklayer_1.58.0       
 [40] DelayedMatrixStats_1.20.0 stringr_1.5.1             lifecycle_1.0.4          
 [43] restfulr_0.0.15           rngtools_1.5.2            XML_3.99-0.16.1          
 [46] beanplot_1.3.1            zlibbioc_1.44.0           MASS_7.3-60.0.1          
 [49] hms_1.1.3                 rhdf5_2.42.1              GEOquery_2.66.0          
 [52] RColorBrewer_1.1-3        yaml_2.3.8                curl_5.2.1               
 [55] memoise_2.0.1             biomaRt_2.54.1            reshape_0.8.9            
 [58] stringi_1.8.3             RSQLite_2.3.5             genefilter_1.80.3        
 [61] BiocIO_1.8.0              GenomicFeatures_1.50.4    filelock_1.0.3           
 [64] BiocParallel_1.32.6       rlang_1.1.3               pkgconfig_2.0.3          
 [67] bitops_1.0-7              nor1mix_1.3-2             lattice_0.22-6           
 [70] purrr_1.0.2               Rhdf5lib_1.20.0           GenomicAlignments_1.34.1 
 [73] bit_4.0.5                 tidyselect_1.2.1          plyr_1.8.9               
 [76] magrittr_2.0.3            R6_2.5.1                  generics_0.1.3           
 [79] DelayedArray_0.24.0       DBI_1.2.2                 pillar_1.9.0             
 [82] survival_3.5-8            KEGGREST_1.38.0           RCurl_1.98-1.14          
 [85] tibble_3.2.1              crayon_1.5.2              utf8_1.2.4               
 [88] BiocFileCache_2.6.1       tzdb_0.4.0                progress_1.2.3           
 [91] grid_4.2.3                data.table_1.15.2         blob_1.2.4               
 [94] digest_0.6.35             xtable_1.8-4              tidyr_1.3.1              
 [97] illuminaio_0.40.0         openssl_2.1.1             askpass_1.2.0            
[100] quadprog_1.5-8
min minfi • 653 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 3 days ago
United States

Don't filter first. You are likely removing the CpGs that are used to estimate the cell counts.

0
Entering edit mode

Thank you for your response, that's what i was thinking

I will try with the rgset only and come back to tell you what's happening !

Best regards Clara

ADD REPLY
0
Entering edit mode

Unfortunately, after recreating my rgset, I get the same error again.

Here is my rgset :

> head(rgSet)
class: RGChannelSet 
dim: 6 24 
metadata(0):
assays(2): Green Red
rownames(6): 10600313 10600322 ... 10600345 10600353
rowData names(0):
colnames(24): 8784241009_R06C02 8691803162_R01C01 ... 8691803162_R06C02 8784241009_R01C01
colData names(23): IID X.1 ... Slide filenames
Annotation
  array: IlluminaHumanMethylation450k
  annotation: ilmn12.hg19


> str(rgSet)
Formal class 'RGChannelSet' [package "minfi"] with 6 slots
  ..@ annotation     : Named chr [1:2] "IlluminaHumanMethylation450k" "ilmn12.hg19"
  .. ..- attr(*, "names")= chr [1:2] "array" "annotation"
  ..@ colData        :Formal class 'DFrame' [package "S4Vectors"] with 6 slots
  .. .. ..@ rownames       : chr [1:24] "8784241009_R06C02" "8691803162_R01C01" "8784241009_R01C02" "8784241009_R02C01" ...
  .. .. ..@ nrows          : int 24
  .. .. ..@ elementType    : chr "ANY"
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  .. .. ..@ listData       :List of 23
  .. .. .. ..$ IID        : chr [1:24] "MTD01" "MTD05" "MTD106" "MTD111" ...
  .. .. .. ..$ X.1        : int [1:24] 1 2 3 4 5 6 7 8 9 10 ...
  .. .. .. ..$ X          : int [1:24] 1 2 3 4 5 6 7 8 9 10 ...
  .. .. .. ..$ Age        : int [1:24] 45 49 28 42 32 41 33 56 48 51 ...
  .. .. .. ..$ SEXE       : int [1:24] 1 1 1 2 1 1 1 1 2 2 ...
  .. .. .. ..$ MEREINDIFF : int [1:24] 2 0 0 NA 4 2 NA 13 0 0 ...
  .. .. .. ..$ MEREABUS   : int [1:24] 6 5 3 NA 10 5 NA 3 7 8 ...
  .. .. .. ..$ MERECONTROL: int [1:24] 6 5 3 NA 10 5 NA 3 7 8 ...
  .. .. .. ..$ PEREINDIFF : int [1:24] 12 NA 0 0 NA 5 NA 16 0 1 ...
  .. .. .. ..$ PEREABUS   : int [1:24] 14 NA 0 2 NA 3 NA 12 0 2 ...
  .. .. .. ..$ PERECONTROL: int [1:24] 9 NA 4 8 NA 5 NA 9 0 8 ...
  .. .. .. ..$ NBRUTURES  : int [1:24] 0 2 1 2 1 0 1 4 0 0 ...
  .. .. .. ..$ PC1        : num [1:24] -0.0106 0.0923 -0.0345 0.1626 0.1421 ...
  .. .. .. ..$ PC2        : num [1:24] -0.00205 -0.0041 -0.02256 -0.13082 -0.03179 ...
  .. .. .. ..$ PC3        : num [1:24] 0.01052 0.00671 0.04747 0.04439 0.0028 ...
  .. .. .. ..$ PC4        : num [1:24] 1.89e-03 -6.44e-05 -6.52e-02 3.65e-02 -8.31e-02 ...
  .. .. .. ..$ PC5        : num [1:24] 0.00154 0.00683 -0.00277 0.04078 -0.01746 ...
  .. .. .. ..$ PC6        : num [1:24] 0.0046 -0.00406 0.16697 0.37384 0.00318 ...
  .. .. .. ..$ BARCODES   : chr [1:24] "8691803162_R01C01" "8691803162_R01C02" "8691803162_R02C01" "8691803162_R02C02" ...
  .. .. .. ..$ Basename   : chr [1:24] "/Users/clarachretienneau/Desktop/clock_epigenetic/PJ1209132_ScanData/idat/8784241009_R06C02" "/Users/clarachretienneau/Desktop/clock_epigenetic/PJ1209132_ScanData/idat/8691803162_R01C01" "/Users/clarachretienneau/Desktop/clock_epigenetic/PJ1209132_ScanData/idat/8784241009_R01C02" "/Users/clarachretienneau/Desktop/clock_epigenetic/PJ1209132_ScanData/idat/8784241009_R02C01" ...
  .. .. .. ..$ Array      : chr [1:24] "R06C02" "R01C01" "R01C02" "R02C01" ...
  .. .. .. ..$ Slide      : num [1:24] 8.78e+09 8.69e+09 8.78e+09 8.78e+09 8.78e+09 ...
  .. .. .. ..$ filenames  : chr [1:24] "/Users/clarachretienneau/Desktop/clock_epigenetic/PJ1209132_ScanData/idat/8784241009_R06C02" "/Users/clarachretienneau/Desktop/clock_epigenetic/PJ1209132_ScanData/idat/8691803162_R01C01" "/Users/clarachretienneau/Desktop/clock_epigenetic/PJ1209132_ScanData/idat/8784241009_R01C02" "/Users/clarachretienneau/Desktop/clock_epigenetic/PJ1209132_ScanData/idat/8784241009_R02C01" ...
  ..@ assays         :Formal class 'SimpleAssays' [package "SummarizedExperiment"] with 1 slot
  .. .. ..@ data:Formal class 'SimpleList' [package "S4Vectors"] with 4 slots
  .. .. .. .. ..@ listData       :List of 2
  .. .. .. .. .. ..$ Green: int [1:622399, 1:24] 455 12236 5886 2673 4131 4913 1680 1394 5751 305 ...
  .. .. .. .. .. .. ..- attr(*, "dimnames")=List of 2
  .. .. .. .. .. .. .. ..$ : chr [1:622399] "10600313" "10600322" "10600328" "10600336" ...
  .. .. .. .. .. .. .. ..$ : chr [1:24] "8784241009_R06C02" "8691803162_R01C01" "8784241009_R01C02" "8784241009_R02C01" ...
  .. .. .. .. .. ..$ Red  : int [1:622399, 1:24] 708 2224 6060 21890 2929 2223 479 19305 646 895 ...
  .. .. .. .. .. .. ..- attr(*, "dimnames")=List of 2
  .. .. .. .. .. .. .. ..$ : chr [1:622399] "10600313" "10600322" "10600328" "10600336" ...
  .. .. .. .. .. .. .. ..$ : chr [1:24] "8784241009_R06C02" "8691803162_R01C01" "8784241009_R01C02" "8784241009_R02C01" ...
  .. .. .. .. ..@ elementType    : chr "ANY"
  .. .. .. .. ..@ elementMetadata: NULL
  .. .. .. .. ..@ metadata       : list()
  ..@ NAMES          : chr [1:622399] "10600313" "10600322" "10600328" "10600336" ...
  ..@ elementMetadata:Formal class 'DFrame' [package "S4Vectors"] with 6 slots
  .. .. ..@ rownames       : NULL
  .. .. ..@ nrows          : int 622399
  .. .. ..@ elementType    : chr "ANY"
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  .. .. ..@ listData       : Named list()
  ..@ metadata       : list()


> cellCounts <- estimateCellCounts(rgSet)
[estimateCellCounts] Combining user data with reference (flow sorted) data.

[estimateCellCounts] Processing user and reference data together.

[preprocessQuantile] Mapping to genome.
Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.
In addition: Warning message:
In DataFrame(sampleNames = c(colnames(rgSet), colnames(referenceRGset)),  :
  'stringsAsFactors' is ignored
ADD REPLY
0
Entering edit mode

Weird. It works for me. But do note that we don't support old versions of packages, so your first step will be to upgrade to (at the very least) the current R/Bioc, and given the imminent release, better yet R-patched and Bioc-3.19

> cells <- estimateCellCounts(RGset)
Loading required package: FlowSorted.Blood.450k
Loading required package: IlluminaHumanMethylation450kmanifest
[estimateCellCounts] Combining user data with reference (flow sorted) data.

[estimateCellCounts] Processing user and reference data together.

[preprocessQuantile] Mapping to genome.
[preprocessQuantile] Fixing outliers.
[preprocessQuantile] Quantile normalizing.
[estimateCellCounts] Picking probes for composition estimation.

[estimateCellCounts] Estimating composition.

Warning message:
In DataFrame(sampleNames = c(colnames(rgSet), colnames(referenceRGset)),  :
  'stringsAsFactors' is ignored
> RGset
class: RGChannelSet
dim: 1051943 24
metadata(0):
assays(2): Green Red
rownames(1051943): 1600101 1600111 ... 99810990 99810992
rowData names(0):
colnames(24): 205624880060_R05C01 205624880060_R07C01 ...
  205624880058_R07C01 205624880058_R08C01
colData names(14): Sample_name Sample_well ... Clone filenames
Annotation
  array: IlluminaHumanMethylationEPIC
  annotation: ilm10b4.hg19
> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /share/apps/MKL/mkl-2019.3/compilers_and_libraries_2019.3.199/linux/mkl/lib/intel64_lin/libmkl_gf_lp64.so;  LAPACK version 3.7.0

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

time zone: America/Los_Angeles
tzcode source: system (glibc)

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

other attached packages:
 [1] IlluminaHumanMethylation450kmanifest_0.4.0
 [2] FlowSorted.Blood.450k_1.40.0
 [3] BiocManager_1.30.22
 [4] IlluminaHumanMethylationEPICmanifest_0.3.0
 [5] DMRcatedata_2.20.2
 [6] ExperimentHub_2.10.0
 [7] AnnotationHub_3.10.0
 [8] BiocFileCache_2.10.1
 [9] dbplyr_2.4.0
[10] Homo.sapiens_1.3.1
[11] GO.db_3.18.0
[12] OrganismDbi_1.44.0
[13] DT_0.32
[14] ggbio_1.50.0
[15] gridExtra_2.3
[16] ggrepel_0.9.5
[17] htmlwidgets_1.6.4
[18] plotly_4.10.4
[19] missMethyl_1.36.0
[20] IlluminaHumanMethylationEPICanno.ilm10b4.hg19_0.6.0
[21] sva_3.50.0
[22] BiocParallel_1.36.0
[23] genefilter_1.84.0
[24] mgcv_1.8-42
[25] nlme_3.1-162
[26] Glimma_2.12.0
[27] xtable_1.8-4
[28] affycoretools_1.74.0
[29] openxlsx_4.2.5.2
[30] wateRmelon_2.8.0
[31] illuminaio_0.44.0
[32] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.1
[33] ROC_1.78.0
[34] lumi_2.54.0
[35] methylumi_2.48.0
[36] FDb.InfiniumMethylation.hg19_2.2.0
[37] org.Hs.eg.db_3.18.0
[38] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2
[39] GenomicFeatures_1.54.3
[40] AnnotationDbi_1.64.1
[41] ggplot2_3.5.0
[42] reshape2_1.4.4
[43] scales_1.3.0
[44] limma_3.58.1
[45] DMRcate_2.16.1
[46] minfi_1.48.0
[47] bumphunter_1.44.0
[48] locfit_1.5-9.9
[49] iterators_1.0.14
[50] foreach_1.5.2
[51] Biostrings_2.70.2
[52] XVector_0.42.0
[53] SummarizedExperiment_1.32.0
[54] Biobase_2.62.0
[55] MatrixGenerics_1.14.0
[56] matrixStats_1.2.0
[57] GenomicRanges_1.54.1
[58] GenomeInfoDb_1.38.7
[59] IRanges_2.36.0
[60] S4Vectors_0.40.2
[61] BiocGenerics_0.48.1
[62] knitr_1.45
[63] rmarkdown_2.26
ADD REPLY

Login before adding your answer.

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