{"action":"created","issue":{"url":"https://api.github.com/repos/hansenlab/bsseq/issues/71","repository_url":"https://api.github.com/repos/hansenlab/bsseq","labels_url":"https://api.github.com/repos/hansenlab/bsseq/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/hansenlab/bsseq/issues/71/comments","events_url":"https://api.github.com/repos/hansenlab/bsseq/issues/71/events","html_url":"https://github.com/hansenlab/bsseq/issues/71","id":331770910,"node_id":"MDU6SXNzdWUzMzE3NzA5MTA=","number":71,"title":"BSseq constructor extremely slow","user":{"login":"scottgigante","id":8499679,"node_id":"MDQ6VXNlcjg0OTk2Nzk=","avatar_url":"https://avatars3.githubusercontent.com/u/8499679?v=4","gravatar_id":"","url":"https://api.github.com/users/scottgigante","html_url":"https://github.com/scottgigante","followers_url":"https://api.github.com/users/scottgigante/followers","following_url":"https://api.github.com/users/scottgigante/following{/other_user}","gists_url":"https://api.github.com/users/scottgigante/gists{/gist_id}","starred_url":"https://api.github.com/users/scottgigante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottgigante/subscriptions","organizations_url":"https://api.github.com/users/scottgigante/orgs","repos_url":"https://api.github.com/users/scottgigante/repos","events_url":"https://api.github.com/users/scottgigante/events{/privacy}","received_events_url":"https://api.github.com/users/scottgigante/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-06-12T22:05:17Z","updated_at":"2018-06-20T17:48:02Z","closed_at":null,"author_association":"NONE","body":"I am trying to construct a `BSseq` object from four data frames with 18519004, 15324125, 17354678 and 17382658 rows respectively (mouse, whole genome CpG methylation.) So far the constructor has been running for 30 hours on a CentOS 7 machine with 8 cores and 64GB of memory. Is this expected?\r\n\r\nI construct the `BSseq` object with the following code:\r\n\r\n```\r\nlibrary(tidyverse)\r\nlibrary(dmrseq)\r\nlibrary(bsseq)\r\n\r\nmake_bs <- function(df, sampleName) {\r\n  M <- matrix(df$M, ncol = 1)\r\n  colnames(M) <- sampleName\r\n  Cov <- matrix(df$Cov, ncol = 1)\r\n  colnames(Cov) <- sampleName\r\n  BSseq(chr = df$chr, \r\n        pos = df$start,\r\n        Cov = Cov,\r\n        M = M,\r\n        sampleNames = sampleName)\r\n}\r\n\r\nbs <- make_bs(df1, \"1\") %>%\r\n  bsseq::combine(make_bs(df2, \"2\")) %>%\r\n  bsseq::combine(make_bs(df3, \"3\")) %>%\r\n  bsseq::combine(make_bs(df4, \"4\"))\r\n```\r\n\r\nHere's my `sessionInfo`:\r\n\r\n```\r\n> sessionInfo()\r\nR version 3.5.0 (2018-04-23)\r\nPlatform: x86_64-pc-linux-gnu (64-bit)\r\nRunning under: CentOS Linux 7 (Core)\r\n\r\nMatrix products: default\r\nBLAS: /stornext/System/data/apps/R/R-3.5.0/lib64/R/lib/libRblas.so\r\nLAPACK: /stornext/System/data/apps/R/R-3.5.0/lib64/R/lib/libRlapack.so\r\n\r\nlocale:\r\n [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C\r\n [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8\r\n [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8\r\n [7] LC_PAPER=en_US.UTF-8       LC_NAME=C\r\n [9] LC_ADDRESS=C               LC_TELEPHONE=C\r\n[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C\r\n\r\nattached base packages:\r\n[1] stats4    parallel  stats     graphics  grDevices utils     datasets\r\n[8] methods   base\r\n\r\nother attached packages:\r\n [1] dmrseq_1.0.0                bsseq_1.16.0\r\n [3] SummarizedExperiment_1.10.1 DelayedArray_0.6.0\r\n [5] BiocParallel_1.14.1         matrixStats_0.53.1\r\n [7] Biobase_2.40.0              GenomicRanges_1.32.3\r\n [9] GenomeInfoDb_1.16.0         IRanges_2.14.10\r\n[11] S4Vectors_0.18.2            BiocGenerics_0.26.0\r\n[13] forcats_0.3.0               stringr_1.3.1\r\n[15] dplyr_0.7.5                 purrr_0.2.5\r\n[17] readr_1.1.1                 tidyr_0.8.1\r\n[19] tibble_1.4.2                ggplot2_2.2.1\r\n[21] tidyverse_1.2.1\r\n\r\nloaded via a namespace (and not attached):\r\n  [1] colorspace_1.4-0              XVector_0.20.0\r\n  [3] rstudioapi_0.7                bit64_0.9-8\r\n  [5] interactiveDisplayBase_1.18.0 AnnotationDbi_1.42.1\r\n  [7] lubridate_1.7.4               xml2_1.2.0\r\n  [9] splines_3.5.0                 codetools_0.2-15\r\n [11] R.methodsS3_1.7.1             mnormt_1.5-5\r\n [13] jsonlite_1.5                  Rsamtools_1.32.0\r\n [15] broom_0.4.4                   R.oo_1.22.0\r\n [17] shiny_1.1.0                   HDF5Array_1.8.0\r\n [19] compiler_3.5.0                httr_1.3.1\r\n [21] assertthat_0.2.0              Matrix_1.2-14\r\n [23] lazyeval_0.2.1                limma_3.36.1\r\n [25] cli_1.0.0                     later_0.7.3\r\n [27] htmltools_0.3.6               prettyunits_1.0.2\r\n [29] tools_3.5.0                   bindrcpp_0.2.2\r\n [31] gtable_0.2.0                  glue_1.2.0\r\n [33] GenomeInfoDbData_1.1.0        annotatr_1.6.0\r\n [35] reshape2_1.4.3                doRNG_1.6.6\r\n [37] Rcpp_0.12.17                  bumphunter_1.22.0\r\n [39] cellranger_1.1.0              Biostrings_2.48.0\r\n [41] nlme_3.1-137                  rtracklayer_1.40.2\r\n [43] iterators_1.0.9               DelayedMatrixStats_1.2.0\r\n [45] psych_1.8.4                   rvest_0.3.2\r\n [47] mime_0.5                      rngtools_1.3.1\r\n [49] gtools_3.5.0                  XML_3.98-1.11\r\n [51] AnnotationHub_2.12.0          zlibbioc_1.26.0\r\n [53] scales_0.5.0                  BSgenome_1.48.0\r\n [55] BiocInstaller_1.30.0          hms_0.4.2\r\n [57] promises_1.0.1                rhdf5_2.24.0\r\n [59] RColorBrewer_1.1-2            yaml_2.1.19\r\n [61] memoise_1.1.0                 pkgmaker_0.27\r\n [63] biomaRt_2.36.1                stringi_1.2.2\r\n [65] RSQLite_2.1.1                 foreach_1.4.6\r\n [67] permute_0.9-4                 GenomicFeatures_1.32.0\r\n [69] bibtex_0.4.2                  rlang_0.2.1\r\n [71] pkgconfig_2.0.1               bitops_1.0-6\r\n [73] lattice_0.20-35               Rhdf5lib_1.2.1\r\n [75] bindr_0.1.1                   GenomicAlignments_1.16.0\r\n [77] bit_1.1-14                    tidyselect_0.2.4\r\n [79] plyr_1.8.4                    magrittr_1.5\r\n [81] R6_2.2.2                      DBI_1.0.0\r\n [83] withr_2.1.2                   pillar_1.2.3\r\n [85] haven_1.1.1                   foreign_0.8-70\r\n [87] RCurl_1.95-4.10               modelr_0.1.2\r\n [89] crayon_1.3.4                  progress_1.1.2\r\n [91] locfit_1.5-9.1                grid_3.5.0\r\n [93] readxl_1.1.0                  data.table_1.11.4\r\n [95] blob_1.1.1                    digest_0.6.15\r\n [97] xtable_1.8-3                  httpuv_1.4.3\r\n [99] regioneR_1.12.0               outliers_0.14\r\n[101] R.utils_2.6.0                 munsell_0.4.3\r\n[103] registry_0.5\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/hansenlab/bsseq/issues/comments/398838358","html_url":"https://github.com/hansenlab/bsseq/issues/71#issuecomment-398838358","issue_url":"https://api.github.com/repos/hansenlab/bsseq/issues/71","id":398838358,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODgzODM1OA==","user":{"login":"PeteHaitch","id":1049741,"node_id":"MDQ6VXNlcjEwNDk3NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1049741?v=4","gravatar_id":"","url":"https://api.github.com/users/PeteHaitch","html_url":"https://github.com/PeteHaitch","followers_url":"https://api.github.com/users/PeteHaitch/followers","following_url":"https://api.github.com/users/PeteHaitch/following{/other_user}","gists_url":"https://api.github.com/users/PeteHaitch/gists{/gist_id}","starred_url":"https://api.github.com/users/PeteHaitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeteHaitch/subscriptions","organizations_url":"https://api.github.com/users/PeteHaitch/orgs","repos_url":"https://api.github.com/users/PeteHaitch/repos","events_url":"https://api.github.com/users/PeteHaitch/events{/privacy}","received_events_url":"https://api.github.com/users/PeteHaitch/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T17:48:02Z","updated_at":"2018-06-20T17:48:02Z","author_association":"CONTRIBUTOR","body":"I opted for the internal function `.BSseq()` following advice in https://bioconductor.org/packages/devel/bioc/vignettes/SummarizedExperiment/inst/doc/Extensions.html#defining-the-class-and-its-constructor). The internal constructor is useful for me when I know that I'm constructing a valid _BSseq_ object, e.g., in `read.bismark()`.\r\n\r\n`BSseq()` is already quite complex because of the need to preserve a lot of historical behaviour. It does a lot of marshalling of its inputs before creating the _BSseq_ object. I've managed to simplify the internals of `BSseq()` while preserving (the documented) historical behaviour. \r\n`BSseq()` is also arguably not a good constructor because calling it without any arguments does not return a valid _BSseq_ object (see recommendation in https://bioconductor.org/packages/devel/bioc/vignettes/SummarizedExperiment/inst/doc/Extensions.html#deriving-a-class-with-custom-slots)."}}
{"actor":{"display_login":"PeteHaitch"}}