JEFworks-Lab / HoneyBADGER

HMM-integrated Bayesian approach for detecting CNV and LOH events from single-cell RNA-seq data
http://jef.works/HoneyBADGER/
GNU General Public License v3.0
95 stars 31 forks source link

no method for coercing this S4 class to a vector #42

Open Joanne-PYL opened 3 years ago

Joanne-PYL commented 3 years ago

Hi Dr. Fan,

Thank you so much for making this tool available. While running HoneyBADGER with my own .bam file and the reference provided, I ran into this error: Error in jags.model(modelFile, data = data, inits = inits, n.chains = 4, : no method for coercing this S4 class to a vector

while trying to generate HMM with hb$calcGexpCnvBoundaries(init=TRUE, verbose=FALSE)

Here is my session info: R version 4.0.3 (2020-10-10) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Catalina 10.15.7

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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] stats4 parallel stats graphics grDevices utils
[7] datasets methods base

other attached packages: [1] devtools_2.3.2
[2] usethis_1.6.3
[3] sos_2.0-2
[4] brew_1.0-6
[5] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 [6] VariantAnnotation_1.36.0
[7] Rsamtools_2.6.0
[8] Biostrings_2.58.0
[9] XVector_0.30.0
[10] SummarizedExperiment_1.20.0
[11] MatrixGenerics_1.2.0
[12] matrixStats_0.57.0
[13] sparseMatrixUtils_0.1.0
[14] Matrix_1.2-18
[15] dplyr_1.0.2
[16] Seurat_3.2.2
[17] rjags_4-10
[18] coda_0.19-4
[19] biomaRt_2.46.0
[20] HoneyBADGER_0.1
[21] GenomicFeatures_1.42.1
[22] AnnotationDbi_1.52.0
[23] Biobase_2.50.0
[24] GenomicRanges_1.42.0
[25] GenomeInfoDb_1.26.1
[26] IRanges_2.24.0
[27] S4Vectors_0.28.0
[28] BiocGenerics_0.36.0

loaded via a namespace (and not attached): [1] BiocFileCache_1.14.0 plyr_1.8.6
[3] igraph_1.2.6 lazyeval_0.2.2
[5] splines_4.0.3 BiocParallel_1.24.1
[7] listenv_0.8.0 ggplot2_3.3.2
[9] digest_0.6.27 htmltools_0.5.0
[11] HiddenMarkov_1.8-11 fansi_0.4.1
[13] magrittr_2.0.1 memoise_1.1.0
[15] BSgenome_1.58.0 tensor_1.5
[17] cluster_2.1.0 ROCR_1.0-11
[19] remotes_2.2.0 globals_0.14.0
[21] askpass_1.1 prettyunits_1.1.1
[23] colorspace_2.0-0 blob_1.2.1
[25] rappdirs_0.3.1 ggrepel_0.8.2
[27] callr_3.5.1 crayon_1.3.4
[29] RCurl_1.98-1.2 jsonlite_1.7.1
[31] spatstat_1.64-1 spatstat.data_1.5-2
[33] survival_3.2-7 zoo_1.8-8
[35] glue_1.4.2 polyclip_1.10-0
[37] gtable_0.3.0 zlibbioc_1.36.0
[39] leiden_0.3.5 DelayedArray_0.16.0
[41] pkgbuild_1.1.0 future.apply_1.6.0
[43] abind_1.4-5 scales_1.1.1
[45] DBI_1.1.0 miniUI_0.1.1.1
[47] Rcpp_1.0.5 viridisLite_0.3.0
[49] xtable_1.8-4 progress_1.2.2
[51] reticulate_1.18 bit_4.0.4
[53] rsvd_1.0.3 htmlwidgets_1.5.2
[55] httr_1.4.2 RColorBrewer_1.1-2
[57] ellipsis_0.3.1 ica_1.0-2
[59] pkgconfig_2.0.3 XML_3.99-0.5
[61] uwot_0.1.9 deldir_0.2-3
[63] dbplyr_2.0.0 tidyselect_1.1.0
[65] rlang_0.4.9 reshape2_1.4.4
[67] later_1.1.0.1 munsell_0.5.0
[69] tools_4.0.3 cli_2.2.0
[71] generics_0.1.0 RSQLite_2.2.1
[73] ggridges_0.5.2 stringr_1.4.0
[75] fastmap_1.0.1 goftest_1.2-2
[77] fs_1.5.0 processx_3.4.5
[79] bit64_4.0.5 fitdistrplus_1.1-3
[81] caTools_1.18.0 purrr_0.3.4
[83] RANN_2.6.1 pbapply_1.4-3
[85] future_1.20.1 nlme_3.1-150
[87] mime_0.9 xml2_1.3.2
[89] compiler_4.0.3 rstudioapi_0.13
[91] plotly_4.9.2.1 curl_4.3
[93] png_0.1-7 testthat_3.0.0
[95] spatstat.utils_1.17-0 tibble_3.0.4
[97] stringi_1.5.3 ps_1.4.0
[99] desc_1.2.0 lattice_0.20-41
[101] vctrs_0.3.5 pillar_1.4.7
[103] lifecycle_0.2.0 BiocManager_1.30.10
[105] lmtest_0.9-38 RcppAnnoy_0.0.17
[107] data.table_1.13.2 cowplot_1.1.0
[109] bitops_1.0-6 irlba_2.3.3
[111] httpuv_1.5.4 patchwork_1.1.0
[113] rtracklayer_1.50.0 R6_2.5.0
[115] promises_1.1.1 KernSmooth_2.23-18
[117] gridExtra_2.3 parallelly_1.21.0
[119] sessioninfo_1.1.1 codetools_0.2-18
[121] pkgload_1.1.0 MASS_7.3-53
[123] assertthat_0.2.1 rprojroot_2.0.2
[125] openssl_1.4.3 withr_2.3.0
[127] GenomicAlignments_1.26.0 sctransform_0.3.1
[129] GenomeInfoDbData_1.2.4 mgcv_1.8-33
[131] hms_0.5.3 grid_4.0.3
[133] rpart_4.1-15 tidyr_1.1.2
[135] Rtsne_0.15 shiny_1.5.0

JEFworks commented 3 years ago

Dear Joanne,

Thanks for trying out HoneyBADGER.

It looks like there may be some issues with using the S4 object class.

Can you please try running HoneyBADGER without using the hb object? An example of the analysis without using objects is available under: https://jef.works/HoneyBADGER/Integrating.html

For example:

calcGexpCnvBoundaries(gexp.mats$gexp.norm, gexp.mats$genes, m=dev)

Jean Fan, PhD Assistant Professor in Biomedical Engineering Center for Computational Biology Johns Hopkins University web: jef.workshttps://jef.works

On Dec 5, 2020, at 3:17 PM, Joanne-PYL notifications@github.com<mailto:notifications@github.com> wrote:

  External Email - Use Caution

Hi Dr. Fan,

Thank you so much for making this tool available. While running HoneyBADGER with my own .bam file and the reference provided, I ran into this error: Error in jags.model(modelFile, data = data, inits = inits, n.chains = 4, : no method for coercing this S4 class to a vector

while trying to generate HMM with hb$calcGexpCnvBoundaries(init=TRUE, verbose=FALSE)

Here is my session info: R version 4.0.3 (2020-10-10) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Catalina 10.15.7

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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] stats4 parallel stats graphics grDevices utils [7] datasets methods base

other attached packages: [1] devtools_2.3.2 [2] usethis_1.6.3 [3] sos_2.0-2 [4] brew_1.0-6 [5] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 [6] VariantAnnotation_1.36.0 [7] Rsamtools_2.6.0 [8] Biostrings_2.58.0 [9] XVector_0.30.0 [10] SummarizedExperiment_1.20.0 [11] MatrixGenerics_1.2.0 [12] matrixStats_0.57.0 [13] sparseMatrixUtils_0.1.0 [14] Matrix_1.2-18 [15] dplyr_1.0.2 [16] Seurat_3.2.2 [17] rjags_4-10 [18] coda_0.19-4 [19] biomaRt_2.46.0 [20] HoneyBADGER_0.1 [21] GenomicFeatures_1.42.1 [22] AnnotationDbi_1.52.0 [23] Biobase_2.50.0 [24] GenomicRanges_1.42.0 [25] GenomeInfoDb_1.26.1 [26] IRanges_2.24.0 [27] S4Vectors_0.28.0 [28] BiocGenerics_0.36.0

loaded via a namespace (and not attached): [1] BiocFileCache_1.14.0 plyr_1.8.6 [3] igraph_1.2.6 lazyeval_0.2.2 [5] splines_4.0.3 BiocParallel_1.24.1 [7] listenv_0.8.0 ggplot2_3.3.2 [9] digest_0.6.27 htmltools_0.5.0 [11] HiddenMarkov_1.8-11 fansi_0.4.1 [13] magrittr_2.0.1 memoise_1.1.0 [15] BSgenome_1.58.0 tensor_1.5 [17] cluster_2.1.0 ROCR_1.0-11 [19] remotes_2.2.0 globals_0.14.0 [21] askpass_1.1 prettyunits_1.1.1 [23] colorspace_2.0-0 blob_1.2.1 [25] rappdirs_0.3.1 ggrepel_0.8.2 [27] callr_3.5.1 crayon_1.3.4 [29] RCurl_1.98-1.2 jsonlite_1.7.1 [31] spatstat_1.64-1 spatstat.data_1.5-2 [33] survival_3.2-7 zoo_1.8-8 [35] glue_1.4.2 polyclip_1.10-0 [37] gtable_0.3.0 zlibbioc_1.36.0 [39] leiden_0.3.5 DelayedArray_0.16.0 [41] pkgbuild_1.1.0 future.apply_1.6.0 [43] abind_1.4-5 scales_1.1.1 [45] DBI_1.1.0 miniUI_0.1.1.1 [47] Rcpp_1.0.5 viridisLite_0.3.0 [49] xtable_1.8-4 progress_1.2.2 [51] reticulate_1.18 bit_4.0.4 [53] rsvd_1.0.3 htmlwidgets_1.5.2 [55] httr_1.4.2 RColorBrewer_1.1-2 [57] ellipsis_0.3.1 ica_1.0-2 [59] pkgconfig_2.0.3 XML_3.99-0.5 [61] uwot_0.1.9 deldir_0.2-3 [63] dbplyr_2.0.0 tidyselect_1.1.0 [65] rlang_0.4.9 reshape2_1.4.4 [67] later_1.1.0.1 munsell_0.5.0 [69] tools_4.0.3 cli_2.2.0 [71] generics_0.1.0 RSQLite_2.2.1 [73] ggridges_0.5.2 stringr_1.4.0 [75] fastmap_1.0.1 goftest_1.2-2 [77] fs_1.5.0 processx_3.4.5 [79] bit64_4.0.5 fitdistrplus_1.1-3 [81] caTools_1.18.0 purrr_0.3.4 [83] RANN_2.6.1 pbapply_1.4-3 [85] future_1.20.1 nlme_3.1-150 [87] mime_0.9 xml2_1.3.2 [89] compiler_4.0.3 rstudioapi_0.13 [91] plotly_4.9.2.1 curl_4.3 [93] png_0.1-7 testthat_3.0.0 [95] spatstat.utils_1.17-0 tibble_3.0.4 [97] stringi_1.5.3 ps_1.4.0 [99] desc_1.2.0 lattice_0.20-41 [101] vctrs_0.3.5 pillar_1.4.7 [103] lifecycle_0.2.0 BiocManager_1.30.10 [105] lmtest_0.9-38 RcppAnnoy_0.0.17 [107] data.table_1.13.2 cowplot_1.1.0 [109] bitops_1.0-6 irlba_2.3.3 [111] httpuv_1.5.4 patchwork_1.1.0 [113] rtracklayer_1.50.0 R6_2.5.0 [115] promises_1.1.1 KernSmooth_2.23-18 [117] gridExtra_2.3 parallelly_1.21.0 [119] sessioninfo_1.1.1 codetools_0.2-18 [121] pkgload_1.1.0 MASS_7.3-53 [123] assertthat_0.2.1 rprojroot_2.0.2 [125] openssl_1.4.3 withr_2.3.0 [127] GenomicAlignments_1.26.0 sctransform_0.3.1 [129] GenomeInfoDbData_1.2.4 mgcv_1.8-33 [131] hms_0.5.3 grid_4.0.3 [133] rpart_4.1-15 tidyr_1.1.2 [135] Rtsne_0.15 shiny_1.5.0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FJEFworks%2FHoneyBADGER%2Fissues%2F42&data=04%7C01%7Cjeanfan%40jhu.edu%7Cafd5b47483fb45a5fd2208d8995ad456%7C9fa4f438b1e6473b803f86f8aedf0dec%7C0%7C0%7C637427962673793550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=eH8ov2HzVyC46ND5myjgRAkX0jABCJAhxTwoOlZjbFQ%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACEPMSG3OGJ5GS3OEIUHERDSTKINLANCNFSM4UOZAE5Q&data=04%7C01%7Cjeanfan%40jhu.edu%7Cafd5b47483fb45a5fd2208d8995ad456%7C9fa4f438b1e6473b803f86f8aedf0dec%7C0%7C0%7C637427962673803506%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uSvA6V63EYG2P45Kisq5a4P8zy8rgjYpphry1rG5DRI%3D&reserved=0.

Joanne-PYL commented 3 years ago

Hi Dr. Fan,

Thank you for your reply. I am trying to run HoneyBADGER without 'hb' object, but I run into another problem.

In your website, you use a lapply function when running 'calcAlleleCnvProb' function, which showed an error because of package updated. results <- do.call(rbind, lapply(potentialCnvs$region, function(region) { calcAlleleCnvProb(...) }))

I am wondering that will the result be affected if I change the code to: results <- calcAlleleCnvProb(...)

If the function above is not working, can you give me some tips to revise the code?

Thank you, Joanne

JEFworks commented 3 years ago

Dear Joanne,

Without seeing the error, it is difficult for me to speculate on what may be happening here.

But to walk you through the code:

results <- do.call(rbind, lapply(potentialCnvs$region, function(region) { calcAlleleCnvProb(...) }))

'lapply' is looping through the regions in 'potentialCnvs$region’, which should be a list, and applying the 'calcAlleleCnvProb()' function and then combining them all into a final matrix that is saved as ‘results’

So if you would like to change the code to

results <- calcAlleleCnvProb(...)

You can do so by manually testing each of your regions. Ex:

region1 <- potentialCnvs$region[[1]] results1 <- calcAlleleCnvProb(region1, …)

region2 <- potentialCnvs$region[[2]] results2 <- calcAlleleCnvProb(region2, ...) ...

Jean Fan, PhD Assistant Professor in Biomedical Engineering Center for Computational Biology Johns Hopkins University web: jef.workshttps://urldefense.proofpoint.com/v2/url?u=http-3A__jefworks.com_&d=DwMGaQ&c=WO-RGvefibhHBZq3fL85hQ&r=2gb0vmLv11Vi98WTAqlCXyDkhi11d9lKeGWDXEU-qNw&m=0o0gQ4rVt5tCCbfd0Dl2sjiItYey4i6Ke4JHKgvfS1I&s=U0ZAIxxhP7vb98fpV1FjD9qF1rQ9eIEqEE9M9igfOAc&e=

On Dec 15, 2020, at 2:15 AM, Joanne-PYL notifications@github.com<mailto:notifications@github.com> wrote:

  External Email - Use Caution

Hi Dr. Fan,

Thank you for your reply. I am trying to run HoneyBADGER without 'hb' object, but I run into another problem.

In your website, you use a lapply function when running 'calcAlleleCnvProb' function, which showed an error because of package updated. results <- do.call(rbind, lapply(potentialCnvs$region, function(region) { calcAlleleCnvProb(...) }))

I am wondering that will the result be affected if I change the code to: results <- calcAlleleCnvProb(...)

If the function above is not working, can you give me some tips to revise the code?

Thank you, Joanne

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FJEFworks%2FHoneyBADGER%2Fissues%2F42%23issuecomment-745102979&data=04%7C01%7Cjeanfan%40jhu.edu%7Ca19c5ba4e8ef4dcb7a5e08d8a0c92c4a%7C9fa4f438b1e6473b803f86f8aedf0dec%7C0%7C0%7C637436133183590701%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=FPv8Z8DsBlhBu%2FwCL9CSBa%2BDMxTfFz0paTR43i9HeQI%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACEPMSGWUGRF37R7VY2SKOTSU4EIBANCNFSM4UOZAE5Q&data=04%7C01%7Cjeanfan%40jhu.edu%7Ca19c5ba4e8ef4dcb7a5e08d8a0c92c4a%7C9fa4f438b1e6473b803f86f8aedf0dec%7C0%7C0%7C637436133183600689%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=NC2ErVpGvkkrDH6YyY72D5QyVs%2FJNjgRVL7dq7NCXCI%3D&reserved=0.