pub struct LazyNucleotideSequences { /* private fields */ }Expand description
A lazy-loaded set of nucleotide sequences based on indexed FASTA files
Implementations§
Source§impl LazyNucleotideSequences
impl LazyNucleotideSequences
Sourcepub fn new(
filepath: impl Into<PathBuf>,
seqnames: Option<Vec<String>>,
) -> Result<Self, GRangesError>
pub fn new( filepath: impl Into<PathBuf>, seqnames: Option<Vec<String>>, ) -> Result<Self, GRangesError>
Create a new LazyNucleotideSequences, which can lazyily retrieve regions
and whole sequences from an indexed FASTA file.
§Arguments
filepath- the path to the bgzipped and indexed FASTA file.seqnames- optional vector of sequences to consider (i.e. used for iterators over sequences).
Trait Implementations§
Source§impl Debug for LazyNucleotideSequences
impl Debug for LazyNucleotideSequences
Source§impl Sequences for LazyNucleotideSequences
impl Sequences for LazyNucleotideSequences
Source§fn get_sequence(
&self,
seqname: &str,
) -> Result<Self::Container<'_>, GRangesError>
fn get_sequence( &self, seqname: &str, ) -> Result<Self::Container<'_>, GRangesError>
Retrieve the Nucleotides for a particular sequence name.
Source§fn region_map<V, F>(
&self,
func: &F,
seqname: &str,
start: Position,
end: Position,
) -> Result<V, GRangesError>
fn region_map<V, F>( &self, func: &F, seqname: &str, start: Position, end: Position, ) -> Result<V, GRangesError>
Apply an arbitrary function to the specified region.
§Arguments
func: a function that takesBytesand processes them, returning a generic typeV.seqname: the sequence name of the region to apply the function to.start: the start position of the region to apply the function to.end: the end position of the region to apply the function to.
Source§fn get_sequence_length(&self, seqname: &str) -> Result<Position, GRangesError>
fn get_sequence_length(&self, seqname: &str) -> Result<Position, GRangesError>
Get the length of a particular sequence.
type Container<'a> = Ref<'a, Nucleotides>
type Slice<'a> = &'a [u8]
fn seqlens(&self) -> Result<IndexMap<String, Position>, GRangesError>
Source§fn region_map_into_granges<'b, C, F, V, T: 'b>(
&self,
granges: &'b impl AsGRangesRef<'b, C, T>,
func: &F,
) -> Result<GRanges<VecRangesIndexed, Vec<V>>, GRangesError>
fn region_map_into_granges<'b, C, F, V, T: 'b>( &self, granges: &'b impl AsGRangesRef<'b, C, T>, func: &F, ) -> Result<GRanges<VecRangesIndexed, Vec<V>>, GRangesError>
Create a new
GRanges<C, Vec<V>> by apply the function func on
the genomic ranges from granges. Read moreAuto Trait Implementations§
impl !Freeze for LazyNucleotideSequences
impl !RefUnwindSafe for LazyNucleotideSequences
impl !Send for LazyNucleotideSequences
impl !Sync for LazyNucleotideSequences
impl Unpin for LazyNucleotideSequences
impl !UnwindSafe for LazyNucleotideSequences
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
Mutably borrows from an owned value. Read more