Struct noodles_sam::record::Record

source ·
pub struct Record(/* private fields */);
Expand description

A SAM record.

Implementations§

source§

impl Record

source

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

Returns the name.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.name().is_none());
source

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

Returns the flags.

§Examples
use noodles_sam::{self as sam, alignment::record::Flags};
let record = sam::Record::default();
assert_eq!(record.flags()?, Flags::UNMAPPED);
source

pub fn reference_sequence_id(&self, header: &Header) -> Option<Result<usize>>

Returns the reference sequence ID.

§Examples
use noodles_sam as sam;
let header = sam::Header::default();
let record = sam::Record::default();
assert!(record.reference_sequence_id(&header).is_none());
source

pub fn reference_sequence_name(&self) -> Option<ReferenceSequenceName<'_>>

Returns the reference sequence name.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.reference_sequence_name().is_none());
source

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

Returns the alignment start.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.alignment_start().is_none());
source

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

Returns the mapping quality.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.mapping_quality().is_none());
source

pub fn cigar(&self) -> Cigar<'_>

Returns the CIGAR operations.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.cigar().is_empty());
source

pub fn mate_reference_sequence_id( &self, header: &Header ) -> Option<Result<usize>>

Returns the mate reference sequence ID.

§Examples
use noodles_sam as sam;
let header = sam::Header::default();
let record = sam::Record::default();
assert!(record.mate_reference_sequence_id(&header).is_none());
source

pub fn mate_reference_sequence_name(&self) -> Option<ReferenceSequenceName<'_>>

Returns the mate reference sequence name.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.mate_reference_sequence_name().is_none());
source

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

Returns the mate alignment start.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.mate_alignment_start().is_none());
source

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

Returns the template length.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert_eq!(record.template_length()?, 0);
source

pub fn sequence(&self) -> Sequence<'_>

Returns the sequence.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.sequence().is_empty());
source

pub fn quality_scores(&self) -> QualityScores<'_>

Returns the quality scores.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.quality_scores().is_empty());
source

pub fn data(&self) -> Data<'_>

Returns the data.

§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.data().is_empty());

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() -> Record

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, header: &'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, header: &'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>)>>

Returns the associated reference sequence.
source§

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

Returns the associated mate reference sequence.
source§

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

Returns the alignment span.
source§

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

Calculates the end position.
source§

impl Eq for Record

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more