plotSex error message
1
0
Entering edit mode
Bethan • 0
@bethan-24856
Last seen 3.7 years ago

Hey everyone,

I'm working on developing a script to analyse my DNA methylation data using the minfi package, and keep running into this message whenever I try to run plotSex - can anyone make sense of it?

Cheers!


#code

plotSex(getSex(GRset, cutoff = -2))

#error message

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'table' in selecting a method for function '%in%': error in evaluating the argument 'x' in selecting a method for function 'colnames': unable to find an inherited method for function ‘colData’ for signature ‘"DFrame"’

# please also include the results of running the following in an R session 

sessionInfo( )

R version 4.0.4 Patched (2021-02-17 r80023)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

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

other attached packages:
 [1] IlluminaHumanMethylationEPICanno.ilm10b4.hg19_0.6.0 IlluminaHumanMethylationEPICmanifest_0.3.0         
 [3] sva_3.38.0                                          BiocParallel_1.24.1                                
 [5] genefilter_1.72.1                                   mgcv_1.8-33                                        
 [7] nlme_3.1-152                                        minfiData_0.36.0                                   
 [9] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.0  IlluminaHumanMethylation450kmanifest_0.4.0         
[11] minfi_1.36.0                                        bumphunter_1.32.0                                  
[13] locfit_1.5-9.4                                      iterators_1.0.13                                   
[15] foreach_1.5.1                                       Biostrings_2.58.0                                  
[17] XVector_0.30.0                                      SummarizedExperiment_1.20.0                        
[19] Biobase_2.50.0                                      MatrixGenerics_1.2.1                               
[21] matrixStats_0.58.0                                  GenomicRanges_1.42.0                               
[23] GenomeInfoDb_1.26.2                                 IRanges_2.24.1                                     
[25] S4Vectors_0.28.1                                    BiocGenerics_0.36.0                                

loaded via a namespace (and not attached):
 [1] ellipsis_0.3.1            siggenes_1.64.0           mclust_5.4.7              base64_2.0               
 [5] rstudioapi_0.13           bit64_4.0.5               AnnotationDbi_1.52.0      xml2_1.3.2               
 [9] codetools_0.2-18          splines_4.0.4             sparseMatrixStats_1.2.1   cachem_1.0.3             
[13] scrime_1.3.5              knitr_1.31                Rsamtools_2.6.0           annotate_1.68.0          
[17] dbplyr_2.1.0              HDF5Array_1.18.1          BiocManager_1.30.10       readr_1.4.0              
[21] compiler_4.0.4            httr_1.4.2                assertthat_0.2.1          Matrix_1.3-2             
[25] fastmap_1.1.0             limma_3.46.0              htmltools_0.5.1.1         prettyunits_1.1.1        
[29] tools_4.0.4               glue_1.4.2                GenomeInfoDbData_1.2.4    dplyr_1.0.4              
[33] rappdirs_0.3.3            doRNG_1.8.2               tinytex_0.29              Rcpp_1.0.6               
[37] vctrs_0.3.6               rhdf5filters_1.2.0        multtest_2.46.0           preprocessCore_1.52.1    
[41] rtracklayer_1.49.5        DelayedMatrixStats_1.12.3 xfun_0.19                 stringr_1.4.0            
[45] lifecycle_1.0.0           rngtools_1.5              XML_3.99-0.5              beanplot_1.2             
[49] edgeR_3.32.1              zlibbioc_1.36.0           MASS_7.3-53               hms_1.0.0                
[53] rhdf5_2.34.0              GEOquery_2.58.0           RColorBrewer_1.1-2        yaml_2.2.1               
[57] curl_4.3                  memoise_2.0.0             biomaRt_2.46.3            reshape_0.8.8            
[61] stringi_1.5.3             RSQLite_2.2.3             GenomicFeatures_1.42.1    rlang_0.4.10             
[65] pkgconfig_2.0.3           bitops_1.0-6              nor1mix_1.3-0             evaluate_0.14            
[69] lattice_0.20-41           purrr_0.3.4               Rhdf5lib_1.12.1           GenomicAlignments_1.26.0 
[73] bit_4.0.4                 tidyselect_1.1.0          plyr_1.8.6                magrittr_2.0.1           
[77] R6_2.5.0                  generics_0.1.0            DelayedArray_0.16.1       DBI_1.1.1                
[81] pillar_1.4.7              survival_3.2-7            RCurl_1.98-1.2            tibble_3.0.6             
[85] crayon_1.4.1              BiocFileCache_1.14.0      rmarkdown_2.6             progress_1.2.2           
[89] grid_4.0.4                data.table_1.13.6         blob_1.2.1                digest_0.6.27            
[93] xtable_1.8-4              tidyr_1.1.2               illuminaio_0.32.0         openssl_1.4.3            
[97] askpass_1.1               quadprog_1.5-8           
>
minfiData plotsex minfi minfiDataEPIC r • 2.4k views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

If you take a look at the help page for plotSex, you can see what the inputs are supposed to be.

Usage:

     getSex(object = NULL, cutoff = -2)
     addSex(object, sex = NULL)
     plotSex(object, id = NULL)

Arguments:

  object: An object of class '[Genomic]MethylSet'.

And further down, you can see the outputs.

Value:

     For 'getSex', a 'DataFrame' with columns 'predictedSex' (a
     character with values 'M' and 'F'), 'xMed' and 'yMed', which are
     the chip-wide medians of measurements on the two sex chromosomes.

So plotSex expects as input a [Genomic]MethylSet, yet getSex returns a DataFrame. Obviously if you provide a DataFrame to a function that expects something entirely different you should not expect things to work. At the very bottom of the help page there is an example.

Examples:

     if(require(minfiData)) {
       GMsetEx <- mapToGenome(MsetEx)
       estSex <- getSex(GMsetEx)
       GMsetEx <- addSex(GMsetEx, sex = estSex)
     }

Which shows that you have to use addSex to add the output from getSex to your GenomicMethylSet, after which you can call plotSex on the updated GenomicMethylSet.

ADD COMMENT

Login before adding your answer.

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