Struct noodles::tabix::index::ReferenceSequence[][src]

pub struct ReferenceSequence { /* fields omitted */ }
Expand description

A tabix index reference sequence.

Implementations

Creates a tabix index reference sequence.

Examples

use noodles_tabix::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::new(Vec::new(), Vec::new(), None);

Returns the list of bins in the reference sequence.

This list does not include the metadata pseudo-bin (bin 37450). Use Self::metadata instead.

Examples

use noodles_tabix::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::new(Vec::new(), Vec::new(), None);
assert!(reference_sequence.bins().is_empty());

Returns the list of 16 kbp intervals that make up the linear index.

Examples

use noodles_tabix::index::ReferenceSequence;
let reference_sequence = ReferenceSequence::new(Vec::new(), Vec::new(), None);
assert!(reference_sequence.intervals().is_empty());

Returns a list of bins in this reference sequence that intersects the given range.

The interval values are 1-based.

Examples

use noodles_tabix::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_tabix::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.

Examples

use noodles_csi::BinningIndex;
use noodles_tabix as tabix;
let index = tabix::Index::default();
assert!(index.reference_sequences().is_empty());

Returns the number of unplaced, unmapped records in the associated file.

Examples

use noodles_csi::BinningIndex;
use noodles_tabix as tabix;
let index = tabix::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_tabix::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_tabix::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 a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.