bigtools

Struct BigWigRead

Source
pub struct BigWigRead<R> { /* private fields */ }
Expand description

The struct used to read a bigWig file

Implementations§

Source§

impl<R> BigWigRead<R>

Source

pub fn info(&self) -> &BBIFileInfo

Get basic info about this bigBed

Source

pub fn chroms(&self) -> &[ChromInfo]

Gets the chromosomes present in this bigBed

Source§

impl BigWigRead<ReopenableFile>

Source

pub fn open_file(path: impl AsRef<Path>) -> Result<Self, BigWigReadOpenError>

Opens a new BigWigRead from a given path as a file.

Source§

impl<R> BigWigRead<R>
where R: SeekableRead,

Source

pub fn cached(self) -> BigWigRead<CachedBBIFileRead<R>>

Converts this BigWigRead`` to where the BBIFileRead` caches index access and block data

Source§

impl<R> BigWigRead<R>
where R: BBIFileRead,

Source

pub fn open(read: R) -> Result<Self, BigWigReadOpenError>

Opens a new BigWigRead with for a given type that implements both Read and Seek

Source

pub fn with_info(info: BBIFileInfo, read: R) -> Self

Does not check if the passed R matches the provided info (including if the R is a bigWig at all!)

Source

pub fn inner_read(&self) -> &R

Gets a reference to the inner R type, in order to access any info

Source

pub fn get_summary(&mut self) -> Result<Summary>

Returns the summary data from bigWig

Note: For version 1 of bigWigs, there is no total summary. In that case, 0 is returned for all of the summary except total items. If this matters to you, you can check the version using info().header.version > 1.

Source

pub fn get_interval<'a>( &'a mut self, chrom_name: &str, start: u32, end: u32, ) -> Result<impl Iterator<Item = Result<Value, BBIReadError>> + 'a, BBIReadError>

For a given chromosome, start, and end, returns an Iterator of the intersecting Values. The resulting iterator takes a mutable reference of this BigWigRead.

Source

pub fn get_interval_move( self, chrom_name: &str, start: u32, end: u32, ) -> Result<impl Iterator<Item = Result<Value, BBIReadError>>, BBIReadError>

For a given chromosome, start, and end, returns an Iterator of the intersecting Values. The resulting iterator takes this BigWigRead by value.

Source

pub fn get_zoom_interval<'a>( &'a mut self, chrom_name: &str, start: u32, end: u32, reduction_level: u32, ) -> Result<impl Iterator<Item = Result<ZoomRecord, BBIReadError>> + 'a, ZoomIntervalError>

For a given chromosome, start, and end, returns an Iterator of the intersecting ZoomRecords.

Source

pub fn get_zoom_interval_move<'a>( self, chrom_name: &str, start: u32, end: u32, reduction_level: u32, ) -> Result<impl Iterator<Item = Result<ZoomRecord, BBIReadError>>, ZoomIntervalError>

For a given chromosome, start, and end, returns an Iterator of the intersecting ZoomRecords.

Source

pub fn values( &mut self, chrom_name: &str, start: u32, end: u32, ) -> Result<Vec<f32>, BBIReadError>

Returns the values between start and end as a Vec<f32>. Any positions with no data in the bigWig will be std::f32::NAN.

Trait Implementations§

Source§

impl<R: BBIFileRead> BBIRead for BigWigRead<R>

Source§

fn info(&self) -> &BBIFileInfo

Get basic info about the bbi file
Source§

fn chroms(&self) -> &[ChromInfo]

Source§

impl<R: Reopen> Reopen for BigWigRead<R>

Source§

fn reopen(&self) -> Result<Self>

Auto Trait Implementations§

§

impl<R> Freeze for BigWigRead<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for BigWigRead<R>
where R: RefUnwindSafe,

§

impl<R> Send for BigWigRead<R>
where R: Send,

§

impl<R> Sync for BigWigRead<R>
where R: Sync,

§

impl<R> Unpin for BigWigRead<R>
where R: Unpin,

§

impl<R> UnwindSafe for BigWigRead<R>
where R: UnwindSafe,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.