js2264 / HiCExperiment

Importing and manipulating Hi-C data in R
http://js2264.github.io/HiCExperiment/
Other
9 stars 1 forks source link

Chromosomes named as integer not supported #2

Closed js2264 closed 1 year ago

js2264 commented 1 year ago
x <- import('Ctrl.mcool', focus = '1')
## Error in H5Dread(h5dataset = h5dataset, h5spaceFile = h5spaceFile, h5spaceMem = h5spaceMem,  :
##   Not enough memory to read data! Try to read a subset of data by specifying the index or count parameter.
## Error: Error in h5checktype(). H5Identifier not valid.

x['1']
## `HiCExperiment` object with 119,334 contacts over 5,614 regions
## -------
## fileName: "Ctrl.mcool"
## focus: "1:1-1"
## resolutions(9): 40000 80000 ... 5120000 10240000
## active resolution: 40000
## interactions: 80289
## scores(2): count balanced
## topologicalFeatures: compartments(0) borders(0) loops(0) viewpoints(0)
## pairsFile: N/A
## metadata(0):

subsetByOverlaps(x, GenomicRanges::GRanges("1:1-249250621"))
## `HiCExperiment` object with 119,334 contacts over 5,614 regions
## -------
## fileName: "Ctrl.mcool"
## focus: "whole genome"
## resolutions(9): 40000 80000 ... 5120000 10240000
## active resolution: 40000
## interactions: 80289
## scores(2): count balanced
## topologicalFeatures: compartments(0) borders(0) loops(0) viewpoints(0)
## pairsFile: N/A
## metadata(0):

This is linked to a bug in splitCoords():

splitCoords("1")
## $chr
## [1] "1"

## $start
## [1] 1

## $end
## [1] 1
js2264 commented 1 year ago

Fixed in https://github.com/js2264/HiCExperiment/commit/55c6079d0f6823b99455357add0ecd7dce545d00