pub struct HiCReader { /* private fields */ }Implementations§
Source§impl HiCReader
impl HiCReader
pub fn open( path: &str, parallel: i64, block_size: Option<u64>, max_blocks: Option<usize>, ) -> Result<Self>
pub fn header(&self) -> &HiCHeader
pub fn chr_sizes(&self) -> &ChrMap
pub fn normalizations(&self) -> &[String]
pub fn units(&self) -> &[String]
Sourcepub fn bin_sizes(&self, unit: Unit) -> &[i64]
pub fn bin_sizes(&self, unit: Unit) -> &[i64]
The resolutions the file was built at, for one unit, in file order.
Left in the order the header lists them — largest first, as a hic file writes them — rather than sorted, because a caller indexing this by position would otherwise get a different resolution than the file’s own order gives.
pub fn path(&self) -> &str
pub fn is_closed(&self) -> bool
pub fn parallel(&self) -> usize
pub fn close(&mut self)
Sourcepub fn parse_loc(&self, req: &HiCRequest) -> Result<Loc2D>
pub fn parse_loc(&self, req: &HiCRequest) -> Result<Loc2D>
Resolve a request’s two windows against the file’s own resolutions.
The coordinates go through Locs before parse_loc2d. The two checks
are not the same one: Locs demands one start and one end per chromosome id,
while parse_loc2d accepts one or two of each and duplicates a single
value across both axes. Without the first, two chromosomes and one start
read the same window twice instead of being refused.
Sourcepub fn read_values(&self, req: &HiCRequest) -> Result<Array2<f32>>
pub fn read_values(&self, req: &HiCRequest) -> Result<Array2<f32>>
Dense (loc1 bins, loc2 bins).
A bin holding a contact the file cannot value — one the chosen
normalization has no factor for, or an expected value of zero — comes
back NaN, which is a different answer from def_value, meaning “not
observed at all”. This matches straw and hictk.
An out-of-range window pads with def_value like bbi; only the block
enumeration is clamped.
Sourcepub fn read_sparse_values(&self, req: &HiCRequest) -> Result<CooMatrix>
pub fn read_sparse_values(&self, req: &HiCRequest) -> Result<CooMatrix>
The same, sparse.
No def_value: a cell this does not list is one no contact reached,
which is what a sparse matrix says by leaving it out.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HiCReader
impl !RefUnwindSafe for HiCReader
impl !UnwindSafe for HiCReader
impl Send for HiCReader
impl Sync for HiCReader
impl Unpin for HiCReader
impl UnsafeUnpin for HiCReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more