Hi Aaron, I am trying to count interacting fragments in pre-defined regions.
But there seems to an error.
redata <- connectCounts(input, hs.param, regions=gene.body)
Error in connectCounts(input, hs.param, regions = gene.body) :
chromosome present in regions and not in fragments
In addition: Warning message:
In connectCounts(input, hs.param, regions = gene.body) :
stranded region ranges have no interpretation, coercing unstrandedness
> input
[1] "/Users/thimmamp/temp_tobe_deleted/HiCMapped/HepG2_trimmed.h5" "/Users/thimmamp/temp_tobe_deleted/HiCMapped/Ago1_trimmed.h5"
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)
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 datasets methods base
other attached packages:
[1] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 GenomicFeatures_1.24.5 AnnotationDbi_1.34.4 BiocInstaller_1.22.3 diffHic_1.4.3
[6] InteractionSet_1.0.4 SummarizedExperiment_1.2.3 Biobase_2.32.0 GenomicRanges_1.24.2 GenomeInfoDb_1.8.3
[11] IRanges_2.6.1 S4Vectors_0.10.2 BiocGenerics_0.18.0
loaded via a namespace (and not attached):
[1] edgeR_3.14.0 XVector_0.12.1 zlibbioc_1.18.0 GenomicAlignments_1.8.4 BiocParallel_1.6.3 BSgenome_1.40.1 lattice_0.20-33 tools_3.3.1
[9] grid_3.3.1 rhdf5_2.16.0 csaw_1.6.1 DBI_0.4-1 Rhtslib_1.4.3 Matrix_1.2-6 rtracklayer_1.32.2 bitops_1.0-6
[17] biomaRt_2.28.0 RCurl_1.95-4.8 RSQLite_1.0.0 limma_3.28.17 Rsamtools_1.24.0 Biostrings_2.40.2 locfit_1.5-9.1 XML_3.98-1.4
Would you please help me resolve this?
This probably should go into a new question, but I'll answer it here. The problem is that you've got some intervals in
regions
that are on chromosomes that don't exist inhs.param$fragments
. diffHic isn't quite sure what to do with those regions, hence it throws an error. The solution is to screen out these regions before supplying them toconnectCounts
. I guess the function could be more forgiving and do this automatically.