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( header: &Header, record: &Record ) -> Result<Self>

Converts an alignment record to a CRAM record.

source

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

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<'rs>( &self, reference_sequences: &'rs ReferenceSequences ) -> Option<Result<(&'rs Name, &'rs 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 read_name(&self) -> Option<&ReadName>

Returns the read 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<'rs>( &self, reference_sequences: &'rs ReferenceSequences ) -> Option<Result<(&'rs Name, &'rs 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<Record> 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 StructuralPartialEq for Record

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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.