Skip to main content

HiCReader

Struct HiCReader 

Source
pub struct HiCReader { /* private fields */ }

Implementations§

Source§

impl HiCReader

Source

pub fn open( path: &str, parallel: i64, block_size: Option<u64>, max_blocks: Option<usize>, ) -> Result<Self>

Source

pub fn header(&self) -> &HiCHeader

Source

pub fn footer(&self) -> &HiCFooter

Source

pub fn chr_sizes(&self) -> &ChrMap

Source

pub fn normalizations(&self) -> &[String]

Source

pub fn units(&self) -> &[String]

Source

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.

Source

pub fn path(&self) -> &str

Source

pub fn is_closed(&self) -> bool

Source

pub fn parallel(&self) -> usize

Source

pub fn close(&mut self)

Source

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.

Source

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.

Source

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§

Source§

impl Debug for HiCReader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.