bigtools

Struct BigBedRead

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

The struct used to read a bigBed file

Implementations§

Source§

impl<R> BigBedRead<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 BigBedRead<ReopenableFile>

Source

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

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

Source§

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

Source

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

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

Source§

impl<R: BBIFileRead> BigBedRead<R>

Source

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

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

Source

pub fn autosql(&mut self) -> Result<Option<String>, BBIReadError>

Reads the autosql from this bigBed

Source

pub fn item_count(&mut self) -> Result<u64, BBIReadError>

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 bigBed

Note: For version 1 of bigBeds, 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<BedEntry, BBIReadError>> + 'a, BBIReadError>

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

Source

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

For a given chromosome, start, and end, returns an Iterator of the intersecting BedEntrys. The resulting iterator takes this BigBedRead 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.

Trait Implementations§

Source§

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

Source§

fn info(&self) -> &BBIFileInfo

Get basic info about the bbi file
Source§

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

Source§

impl<R: Reopen> Reopen for BigBedRead<R>

Source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<R> UnwindSafe for BigBedRead<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.