Struct noodles_cram::record::Record

source ·
pub struct Record { /* private fields */ }
Expand description

A CRAM record.

Implementations§

source§

impl Record

source

pub fn try_from_alignment_record<R>(header: &Header, record: &R) -> Result<Self>
where R: Record + ?Sized,

Converts an alignment record to a CRAM record.

source

pub fn try_into_alignment_record(self, header: &Header) -> Result<RecordBuf>

Converts this CRAM record to an alignment record.

source§

impl Record

source

pub fn builder() -> Builder

Returns a builder to create a record from each of its fields.

source

pub fn bam_flags(&self) -> Flags

Returns the BAM flags.

This is also called the BAM bit flags.

source

pub fn flags(&self) -> Flags

Returns the SAM flags.

source

pub fn cram_flags(&self) -> Flags

Returns the CRAM flags.

This is also called the CRAM bit flags or compression bit flags.

source

pub fn reference_sequence_id(&self) -> Option<usize>

Returns the reference sequence ID.

This is also called the reference ID. It is the position of the reference sequence in the SAM header.

source

pub fn reference_sequence<'h>( &self, reference_sequences: &'h ReferenceSequences ) -> Option<Result<(&'h [u8], &'h Map<ReferenceSequence>)>>

Returns the associated reference sequence.

source

pub fn read_length(&self) -> usize

Returns the read length.

source

pub fn alignment_start(&self) -> Option<Position>

Returns the alignment start.

source

pub fn alignment_end(&self) -> Option<Position>

Returns the alignment end.

source

pub fn read_group_id(&self) -> Option<usize>

Returns the read group ID.

This is also simply called the read group. It is the position of the read group in the SAM header.

source

pub fn name(&self) -> Option<&Name>

Returns the name.

source

pub fn next_mate_flags(&self) -> NextMateFlags

Returns the next mate flags.

This is also call the next mate bit flags.

source

pub fn next_fragment_reference_sequence_id(&self) -> Option<usize>

Returns the reference sequence ID of the next fragment.

It is the position of the reference sequence in the SAM header.

source

pub fn mate_reference_sequence<'h>( &self, reference_sequences: &'h ReferenceSequences ) -> Option<Result<(&'h [u8], &'h Map<ReferenceSequence>)>>

Returns the associated mate reference sequence.

source

pub fn next_mate_alignment_start(&self) -> Option<Position>

Returns the alignment start position of the next mate.

This value is 1-based.

source

pub fn mate_alignment_start(&self) -> Option<Position>

Returns the alignment start.

source

pub fn template_size(&self) -> i32

Returns the template size.

source

pub fn template_length(&self) -> i32

Returns the template size.

source

pub fn distance_to_next_fragment(&self) -> Option<usize>

Returns the distance to the next fragment.

This is the number of records to the next fragment within a slice.

source

pub fn tags(&self) -> &Data

Returns the tag dictionary.

source

pub fn data(&self) -> &Data

Returns the data.

source

pub fn bases(&self) -> &Sequence

Returns the read bases.

source

pub fn sequence(&self) -> &Sequence

Returns the sequence.

source

pub fn features(&self) -> &Features

Returns the read features.

source

pub fn mapping_quality(&self) -> Option<MappingQuality>

Returns the mapping quality.

source

pub fn quality_scores(&self) -> &QualityScores

Returns the quality scores.

Trait Implementations§

source§

impl Clone for Record

source§

fn clone(&self) -> Record

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Record

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Record

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq for Record

source§

fn eq(&self, other: &Record) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Record for Record

source§

fn name(&self) -> Option<Box<dyn Name + '_>>

Returns the name.
source§

fn flags(&self) -> Result<Flags>

Returns the flags.
source§

fn reference_sequence_id<'r, 'h: 'r>( &'r self, _: &'h Header ) -> Option<Result<usize>>

Returns the reference sequence ID.
source§

fn alignment_start(&self) -> Option<Result<Position>>

Returns the alignment start.
source§

fn mapping_quality(&self) -> Option<Result<MappingQuality>>

Returns the mapping quality.
source§

fn cigar(&self) -> Box<dyn Cigar + '_>

Returns the CIGAR operations.
source§

fn mate_reference_sequence_id<'r, 'h: 'r>( &'r self, _: &'h Header ) -> Option<Result<usize>>

Returns the mate reference sequence ID.
source§

fn mate_alignment_start(&self) -> Option<Result<Position>>

Returns the mate alignment start.
source§

fn template_length(&self) -> Result<i32>

Returns the template length.
source§

fn sequence(&self) -> Box<dyn Sequence + '_>

Returns the sequence.
source§

fn quality_scores(&self) -> Box<dyn QualityScores + '_>

Returns the quality scores.
source§

fn data(&self) -> Box<dyn Data + '_>

Returns the data.
source§

fn reference_sequence<'h>( &self, header: &'h Header ) -> Option<Result<(&'h BStr, &'h Map<ReferenceSequence>), Error>>

Returns the associated reference sequence.
source§

fn mate_reference_sequence<'h>( &self, header: &'h Header ) -> Option<Result<(&'h BStr, &'h Map<ReferenceSequence>), Error>>

Returns the associated mate reference sequence.
source§

fn alignment_span(&self) -> Result<Option<usize>, Error>

Returns the alignment span.
source§

fn alignment_end(&self) -> Option<Result<Position, Error>>

Calculates the end position.
source§

impl StructuralPartialEq for Record

Auto Trait Implementations§

§

impl Freeze for Record

§

impl RefUnwindSafe for Record

§

impl Send for Record

§

impl Sync for Record

§

impl Unpin for Record

§

impl UnwindSafe for Record

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.