mervesa / HiCDCPlus

HiCDCPlus
15 stars 2 forks source link

hic2icenorm_gi_list chrs default cause error #11

Closed TingtingSsl2 closed 2 years ago

TingtingSsl2 commented 2 years ago

Dear HiCDCPlus developers,

I'm using hic2icenorm_gi_list for ICE normalization before finding TADs. I found the following error if chrs sets to default. If I set chrs=c(chr21','chr22'), no errors. I'm wondering if you can help with the problem.

> gi_list = hic2icenorm_gi_list(hic_path, binsize = 50e3, hic_output=TRUE) Error in h(simpleError(msg, call)) : error in evaluating the argument 'i' in selecting a method for function '[': operations are possible only for numeric, logical or complex types Thank you!

`sessionInfo() R version 4.1.0 (2021-05-18) 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.1/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 stats graphics grDevices utils datasets methods
[8] base

other attached packages: [1] BSgenome.Hsapiens.UCSC.hg19_1.4.3 BSgenome.Hsapiens.UCSC.hg38_1.4.3 [3] BSgenome_1.60.0 rtracklayer_1.52.1
[5] Biostrings_2.60.2 XVector_0.34.0
[7] GenomicRanges_1.46.1 GenomeInfoDb_1.30.1
[9] IRanges_2.28.0 S4Vectors_0.32.3
[11] BiocGenerics_0.40.0 HiCDCPlus_1.0.0

loaded via a namespace (and not attached): [1] Rcpp_1.0.8 InteractionSet_1.20.0
[3] lattice_0.20-45 Rsamtools_2.8.0
[5] assertthat_0.2.1 utf8_1.2.2
[7] BiocFileCache_2.0.0 R6_2.5.1
[9] RSQLite_2.2.10 httr_1.4.2
[11] pillar_1.7.0 zlibbioc_1.40.0
[13] rlang_1.0.2 curl_4.3.2
[15] rstudioapi_0.13 data.table_1.14.2
[17] blob_1.2.2 R.utils_2.11.0
[19] R.oo_1.24.0 Matrix_1.4-0
[21] splines_4.1.0 BiocParallel_1.26.2
[23] RCurl_1.98-1.6 bit_4.0.4
[25] DelayedArray_0.20.0 compiler_4.1.0
[27] pkgconfig_2.0.3 tidyselect_1.1.2
[29] SummarizedExperiment_1.24.0 tibble_3.1.6
[31] GenomeInfoDbData_1.2.7 matrixStats_0.61.0
[33] XML_3.99-0.9 fansi_1.0.2
[35] withr_2.5.0 dbplyr_2.1.1
[37] crayon_1.5.0 dplyr_1.0.8
[39] GenomicAlignments_1.28.0 bitops_1.0-7
[41] R.methodsS3_1.8.1 rappdirs_0.3.3
[43] grid_4.1.0 lifecycle_1.0.1
[45] DBI_1.1.2 magrittr_2.0.2
[47] cachem_1.0.6 cli_3.2.0
[49] filelock_1.0.2 ellipsis_0.3.2
[51] generics_0.1.2 vctrs_0.3.8
[53] rjson_0.2.21 restfulr_0.0.13
[55] RColorBrewer_1.1-2 tools_4.1.0
[57] bit64_4.0.5 Biobase_2.54.0
[59] glue_1.6.2 purrr_0.3.4
[61] MatrixGenerics_1.6.0 fastmap_1.1.0
[63] parallel_4.1.0 yaml_2.3.5
[65] memoise_2.0.1 BiocIO_1.2.0
[67] HiTC_1.36.0 `

mervesa commented 2 years ago

Hi @TingtingSsl2 , thanks for spotting the bug.

if (is.null(chrs)){
  chrs<-get_chrs(gen,gen_ver)[chrs%in%c("chrY","chrM")]
}

lines in hic2icenorm_gi_list is replaced by

if (is.null(chrs)){
  chrs<-get_chrs(gen,gen_ver)
  chrs<-chrs[!chrs%in%c("chrY","chrM")]
}
mervesa commented 2 years ago

Hi, I've just pushed the changes to here and to Bioconductor's current release. The most timely way to use the changes would be to reinstall the package using devtools : library(devtools); install_github("mervesa/HiCDCPlus")