diffHic's totalCounts fails with multiple files, but rest of test code works
1
0
Entering edit mode
nelsonmo • 0
@f211f0c1
Last seen 16 days ago
United States

I am encountering an issue running totalCounts with multiple files. I get the following error:

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'nrow': attempt to apply non-function
Calls: totalCounts -> .addToTotal

The rest of the test code works fine, so it doesn't seem like an issue with the input files. Here is the test code:

library(rhdf5)
library(csaw)
library(diffHic)
library(edgeR)

hs.frag <- cutGenome("hg38.fa", "GATC", 4)
hs.param <- pairParam(hs.frag)

preparePairs("aligned_test1_REP1.bam", hs.param, file = "aligned_test1_REP1.h5", dedup = TRUE, minq=10)
preparePairs("aligned_test1_REP2.bam", hs.param, file = "aligned_test1_REP2.h5", dedup = TRUE, minq=10)
preparePairs("aligned_test2_REP2.bam", hs.param, file = "aligned_test2_REP2.h5", dedup = TRUE, minq=10)
preparePairs("aligned_test2_REP1.bam", hs.param, file = "aligned_test2_REP1.h5", dedup = TRUE, minq=10)

input <- c("aligned_test1_REP1.h5", "aligned_test1_REP2.h5","aligned_test2_REP2.h5","aligned_test2_REP1.h5")

bin.size <- 1e6
data <- squareCounts(input, hs.param, width = bin.size, filter=1)

finder <- domainDirections(input, hs.param, width=1e5, span=10)

all.counts <- cbind(assay(finder, "up"), assay(finder, "down"))
totals <- totalCounts(input, hs.param)

sessionInfo():

R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /spack/apps/linux-centos7-x86_64/gcc-8.3.0/openblas-0.3.8-2no6mfziiclwxb7lstxoos335gnhjpes/lib/libopenblasp-r0.3.8.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] edgeR_3.32.0                limma_3.46.0               
 [3] diffHic_1.24.0              InteractionSet_1.18.1      
 [5] csaw_1.24.3                 SummarizedExperiment_1.20.0
 [7] Biobase_2.50.0              MatrixGenerics_1.2.0       
 [9] matrixStats_0.57.0          GenomicRanges_1.42.0       
[11] GenomeInfoDb_1.26.2         IRanges_2.24.1             
[13] S4Vectors_0.28.1            BiocGenerics_0.36.0        
[15] rhdf5_2.34.0               

loaded via a namespace (and not attached):
 [1] locfit_1.5-9.4           Rcpp_1.0.5               lattice_0.20-41         
 [4] prettyunits_1.1.1        Rsamtools_2.6.0          Biostrings_2.58.0       
 [7] assertthat_0.2.1         digest_0.6.27            BiocFileCache_1.14.0    
[10] R6_2.5.0                 RSQLite_2.2.2            httr_1.4.2              
[13] pillar_1.4.7             zlibbioc_1.36.0          rlang_0.4.10            
[16] GenomicFeatures_1.42.1   progress_1.2.2           curl_4.3                
[19] blob_1.2.1               Matrix_1.3-2             BiocParallel_1.24.1     
[22] Rhtslib_1.20.0           stringr_1.4.0            RCurl_1.98-1.2          
[25] bit_4.0.4                biomaRt_2.46.0           DelayedArray_0.16.0     
[28] compiler_4.0.3           rtracklayer_1.50.0       pkgconfig_2.0.3         
[31] askpass_1.1              openssl_1.4.3            tidyselect_1.1.0        
[34] tibble_3.0.4             GenomeInfoDbData_1.2.4   XML_3.99-0.5            
[37] crayon_1.3.4             dplyr_1.0.2              dbplyr_2.0.0            
[40] GenomicAlignments_1.26.0 bitops_1.0-6             rhdf5filters_1.2.1      
[43] rappdirs_0.3.1           grid_4.0.3               lifecycle_1.0.0         
[46] DBI_1.1.0                magrittr_2.0.1           stringi_1.5.3           
[49] XVector_0.30.0           xml2_1.3.2               ellipsis_0.3.1          
[52] generics_0.1.0           vctrs_0.3.6              Rhdf5lib_1.12.1         
[55] tools_4.0.3              bit64_4.0.5              BSgenome_1.58.0         
[58] glue_1.4.2               purrr_0.3.4              hms_0.5.3               
[61] AnnotationDbi_1.52.0     memoise_1.1.0
diffHic • 104 views
ADD COMMENT
2
Entering edit mode
Aaron Lun ★ 27k
@alun
Last seen 2 hours ago
The city by the bay

I think I've identified the problem - try installing from the master branch of https://github.com/LTLA/diffHic and see whether that solves it.

ADD COMMENT
0
Entering edit mode

This worked. Thank you so much for finding and fixing the problem so quickly!

ADD REPLY

Login before adding your answer.

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