genomicsclass / labs

Rmd source files for the HarvardX series PH525x
http://genomicsclass.github.io/book
MIT License
2k stars 1.94k forks source link

GRanges objects don't support lapply, unlist at the moment #77

Closed gillsignals closed 5 years ago

gillsignals commented 5 years ago

Line 181 of bioc2_integExamps.Rmd generates the following error:

> phset = lapply( ovrngs, function(x)
+   unique( gwrngs19[ which(gwrngs19 %over% x) ]$Disease.Trait ) )
Error in getListElement(x, i, ...) : 
  GRanges objects don't support [[, as.list(), lapply(), or
  unlist() at the moment

Thanks! Here is the sessionInfo:

R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

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

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

other attached packages:
 [1] curatedTCGAData_1.6.0                             
 [2] harbChIP_1.22.0                                   
 [3] yeastCC_1.24.0                                    
 [4] gwascat_2.16.0                                    
 [5] ERBS_1.0                                          
 [6] magrittr_1.5                                      
 [7] dplyr_0.8.3                                       
 [8] bigrquery_1.2.0                                   
 [9] VariantTools_1.26.0                               
[10] VariantAnnotation_1.30.1                          
[11] RaggedExperiment_1.8.0                            
[12] MultiAssayExperiment_1.10.4                       
[13] GenomicAlignments_1.20.1                          
[14] BiocStyle_2.12.0                                  
[15] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.0
[16] IlluminaHumanMethylation450kmanifest_0.4.0        
[17] minfi_1.30.0                                      
[18] bumphunter_1.26.0                                 
[19] locfit_1.5-9.1                                    
[20] iterators_1.0.12                                  
[21] foreach_1.4.7                                     
[22] annotate_1.62.0                                   
[23] XML_3.98-1.20                                     
[24] GSE5859Subset_1.0                                 
[25] airway_1.4.0                                      
[26] ph525x_0.0.48                                     
[27] png_0.1-7                                         
[28] RNAseqData.HNRNPC.bam.chr14_0.22.0                
[29] erma_1.0.0                                        
[30] GenomicFiles_1.20.0                               
[31] rtracklayer_1.44.2                                
[32] Rsamtools_2.0.0                                   
[33] Biostrings_2.52.0                                 
[34] XVector_0.24.0                                    
[35] SummarizedExperiment_1.14.1                       
[36] DelayedArray_0.10.0                               
[37] BiocParallel_1.18.1                               
[38] matrixStats_0.54.0                                
[39] Homo.sapiens_1.3.1                                
[40] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2           
[41] org.Hs.eg.db_3.8.2                                
[42] GO.db_3.8.2                                       
[43] OrganismDbi_1.26.0                                
[44] GenomicFeatures_1.36.4                            
[45] GenomicRanges_1.36.0                              
[46] GenomeInfoDb_1.20.0                               
[47] AnnotationDbi_1.46.1                              
[48] IRanges_2.18.1                                    
[49] S4Vectors_0.22.0                                  
[50] GEOquery_2.52.0                                   
[51] data.table_1.12.2                                 
[52] Biobase_2.44.0                                    
[53] BiocGenerics_0.30.0                               

loaded via a namespace (and not attached):
  [1] tidyselect_0.2.5              RSQLite_2.1.2                
  [3] devtools_2.1.0                munsell_0.5.0                
  [5] codetools_0.2-16              preprocessCore_1.46.0        
  [7] withr_2.1.2                   colorspace_1.4-1             
  [9] knitr_1.24                    rstudioapi_0.10              
 [11] labeling_0.3                  GenomeInfoDbData_1.2.1       
 [13] bit64_0.9-7                   rhdf5_2.28.0                 
 [15] rprojroot_1.3-2               vctrs_0.2.0                  
 [17] xfun_0.9                      BiocFileCache_1.8.0          
 [19] R6_2.4.0                      illuminaio_0.26.0            
 [21] AnnotationFilter_1.8.0        bitops_1.0-6                 
 [23] reshape_0.8.8                 assertthat_0.2.1             
 [25] promises_1.0.1                scales_1.0.0                 
 [27] gtable_0.3.0                  processx_3.4.1               
 [29] ensembldb_2.8.0               rlang_0.4.0                  
 [31] zeallot_0.1.0                 genefilter_1.66.0            
 [33] splines_3.6.1                 lazyeval_0.2.2               
 [35] gargle_0.3.1                  BiocManager_1.30.4           
 [37] yaml_2.2.0                    snpStats_1.34.0              
 [39] backports_1.1.4               httpuv_1.5.1                 
 [41] RBGL_1.60.0                   usethis_1.5.1                
 [43] nor1mix_1.3-0                 ggplot2_3.2.1                
 [45] RColorBrewer_1.1-2            siggenes_1.58.0              
 [47] sessioninfo_1.1.1             Rcpp_1.0.1                   
 [49] plyr_1.8.4                    progress_1.2.2               
 [51] zlibbioc_1.30.0               purrr_0.3.2                  
 [53] RCurl_1.95-4.12               ps_1.3.0                     
 [55] prettyunits_1.0.2             openssl_1.4.1                
 [57] fs_1.3.1                      ProtGenerics_1.16.0          
 [59] pkgload_1.0.2                 hms_0.5.1                    
 [61] mime_0.7                      evaluate_0.14                
 [63] xtable_1.8-4                  mclust_5.4.5                 
 [65] gridExtra_2.3                 testthat_2.2.1               
 [67] compiler_3.6.1                biomaRt_2.40.4               
 [69] tibble_2.1.3                  crayon_1.3.4                 
 [71] htmltools_0.3.6               later_0.8.0                  
 [73] tidyr_0.8.3                   ldblock_1.14.2               
 [75] DBI_1.0.0                     ExperimentHub_1.10.0         
 [77] dbplyr_1.4.2                  rappdirs_0.3.1               
 [79] MASS_7.3-51.4                 EnsDb.Hsapiens.v75_2.99.0    
 [81] Matrix_1.2-17                 readr_1.3.1                  
 [83] cli_1.1.0                     quadprog_1.5-7               
 [85] pkgconfig_2.0.2               registry_0.5-1               
 [87] xml2_1.2.2                    rngtools_1.4                 
 [89] pkgmaker_0.27                 multtest_2.40.0              
 [91] beanplot_1.2                  bibtex_0.4.2                 
 [93] doRNG_1.7.1                   scrime_1.3.5                 
 [95] stringr_1.4.0                 callr_3.3.1                  
 [97] digest_0.6.20                 graph_1.62.0                 
 [99] rmarkdown_1.15                base64_2.0                   
[101] DelayedMatrixStats_1.6.0      curl_4.0                     
[103] shiny_1.3.2                   nlme_3.1-141                 
[105] jsonlite_1.6                  Rhdf5lib_1.6.0               
[107] desc_1.2.0                    askpass_1.1                  
[109] limma_3.40.6                  BSgenome_1.52.0              
[111] pillar_1.4.2                  lattice_0.20-38              
[113] httr_1.4.1                    pkgbuild_1.0.4               
[115] survival_2.44-1.1             interactiveDisplayBase_1.22.0
[117] glue_1.3.1                    remotes_2.1.0                
[119] UpSetR_1.4.0                  bit_1.1-14                   
[121] stringi_1.4.3                 HDF5Array_1.12.2             
[123] blob_1.2.0                    AnnotationHub_2.16.0         
[125] memoise_1.1.0 
vjcitn commented 5 years ago

This has now been updated. A for loop was substituted for lapply. Additionally the computations dependent upon geometadb.sqlite have been eliminated, the tasks are simply narrated and results given textually for those capable of handling the 8GB sqlite.

gillsignals commented 5 years ago

This works - thanks!

If I see this error elsewhere in the book, I will replace with a for loop.

AntoniaChroni commented 1 year ago

hey, I am running into this error when I am trying to combine peaks in atac data. combined.peaks <- reduce(c(peaks$sample1, peaks$sample2, peaks$sample3, peaks$sample4 ))

Can you please provide the solution?

Error in getListElement(x, i, ...) : GRanges objects don't support [[, as.list(), lapply(), or unlist() at the moment

Thanks!