Struct rust_htslib::faidx::Reader
source · pub struct Reader { /* private fields */ }
Expand description
A Fasta reader.
Implementations§
source§impl Reader
impl Reader
sourcepub fn fetch_seq<N: AsRef<str>>(
&self,
name: N,
begin: usize,
end: usize
) -> Result<&[u8]>
pub fn fetch_seq<N: AsRef<str>>( &self, name: N, begin: usize, end: usize ) -> Result<&[u8]>
Fetch the sequence as a byte array.
Arguments
name
- the name of the template sequence (e.g., “chr1”)begin
- the offset within the template sequence (starting with 0)end
- the end position to return (if smaller thanbegin
, the behavior is undefined).
sourcepub fn fetch_seq_string<N: AsRef<str>>(
&self,
name: N,
begin: usize,
end: usize
) -> Result<String>
pub fn fetch_seq_string<N: AsRef<str>>( &self, name: N, begin: usize, end: usize ) -> Result<String>
Fetches the sequence and returns it as string.
Arguments
name
- the name of the template sequence (e.g., “chr1”)begin
- the offset within the template sequence (starting with 0)end
- the end position to return (if smaller thanbegin
, the behavior is undefined).