Struct noodles::bam::bai::index::ReferenceSequence [−][src]
pub struct ReferenceSequence { /* fields omitted */ }
Expand description
A reference sequence in the BAM index.
Implementations
Creates a BAM index reference seqeuence.
Examples
use noodles_bam::bai::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::new(Vec::new(), Vec::new(), None);
Returns the list of bins in this reference sequence.
This list does not include the metadata pseudo-bin (bin 37450). Use Self::metadata
instead.
Examples
use noodles_bam::bai::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::new(Vec::new(), Vec::new(), None);
assert!(reference_sequence.bins().is_empty());
Returns a list of 16 kbp intervals that make up the linear index.
Examples
use noodles_bam::bai::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::new(Vec::new(), Vec::new(), None);
assert!(reference_sequence.intervals().is_empty());
pub fn query<B>(&self, interval: B) -> Result<Vec<&Bin, Global>, QueryError> where
B: RangeBounds<i32>,
pub fn query<B>(&self, interval: B) -> Result<Vec<&Bin, Global>, QueryError> where
B: RangeBounds<i32>,
Returns a list of bins in this reference seqeunce that intersect the given range.
The interval values are 1-based.
Examples
use noodles_bam::bai::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::new(Vec::new(), Vec::new(), None);
let query_bins = reference_sequence.query(8..=13)?;
assert!(query_bins.is_empty());
Finds in minimum start offset in the linear index for a given start position.
start
is 1-based.
Examples
use noodles_bgzf as bgzf;
use noodles_bam::bai::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::new(Vec::new(), Vec::new(), None);
assert_eq!(reference_sequence.min_offset(13), bgzf::VirtualPosition::from(0));
Trait Implementations
Returns a list of indexed reference sequences.
This list is parallel to the reference sequences defined in the associated BAM file.
Examples
use noodles_bam::bai;
use noodles_csi::BinningIndex;
let index = bai::Index::default();
assert!(index.reference_sequences().is_empty());
Returns the number of unplaced, unmapped records in the associated file.
An unplaced, unmapped record is one that is has neither a reference sequence ID nor position set.
Examples
use noodles_bam::bai;
use noodles_csi::BinningIndex;
let index = bai::Index::default();
assert!(index.unplaced_unmapped_record_count().is_none());
Returns the chunks that overlap with the given region.
Returns the start position of the first record in the last linear bin. Read more
Returns the optional metadata for the reference sequence.
Metadata is parsed from the optional pseudo-bin 37450.
Examples
use noodles_bgzf::VirtualPosition;
use noodles_csi::{index::reference_sequence::Metadata, BinningIndexReferenceSequence};
use noodles_bam::bai::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::new(Vec::new(), Vec::new(), None);
assert!(reference_sequence.metadata().is_none());
let reference_sequence = ReferenceSequence::new(
Vec::new(),
Vec::new(),
Some(Metadata::new(VirtualPosition::from(610), VirtualPosition::from(1597), 55, 0))
);
assert!(reference_sequence.metadata().is_some());
Returns the start position of the first record in the last linear bin.
Examples
use noodles_bgzf as bgzf;
use noodles_csi::BinningIndexReferenceSequence;
use noodles_bam::bai::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::default();
assert!(reference_sequence.first_record_in_last_linear_bin_start_position().is_none());
let intervals = vec![bgzf::VirtualPosition::from(8), bgzf::VirtualPosition::from(13)];
let reference_sequence = ReferenceSequence::new(Vec::new(), intervals, None);
assert_eq!(
reference_sequence.first_record_in_last_linear_bin_start_position(),
Some(bgzf::VirtualPosition::from(13))
);
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ReferenceSequence
impl Send for ReferenceSequence
impl Sync for ReferenceSequence
impl Unpin for ReferenceSequence
impl UnwindSafe for ReferenceSequence
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.