Struct noodles_sam::record::Record
source · pub struct Record(/* private fields */);
Expand description
A SAM record.
Implementations§
source§impl Record
impl Record
sourcepub fn name(&self) -> Option<Name<'_>>
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());
sourcepub fn flags(&self) -> Result<Flags>
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);
sourcepub fn reference_sequence_id(&self, header: &Header) -> Option<Result<usize>>
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());
sourcepub fn reference_sequence_name(&self) -> Option<ReferenceSequenceName<'_>>
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());
sourcepub fn alignment_start(&self) -> Option<Result<Position>>
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());
sourcepub fn mapping_quality(&self) -> Option<Result<MappingQuality>>
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());
sourcepub fn cigar(&self) -> Cigar<'_>
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());
sourcepub fn mate_reference_sequence_id(
&self,
header: &Header
) -> Option<Result<usize>>
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());
sourcepub fn mate_reference_sequence_name(&self) -> Option<ReferenceSequenceName<'_>>
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());
sourcepub fn mate_alignment_start(&self) -> Option<Result<Position>>
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());
sourcepub fn template_length(&self) -> Result<i32>
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);
sourcepub fn sequence(&self) -> Sequence<'_>
pub fn sequence(&self) -> Sequence<'_>
Returns the sequence.
§Examples
use noodles_sam as sam;
let record = sam::Record::default();
assert!(record.sequence().is_empty());
sourcepub fn quality_scores(&self) -> QualityScores<'_>
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());
Trait Implementations§
source§impl PartialEq for Record
impl PartialEq for Record
source§impl Record for Record
impl Record for Record
source§fn reference_sequence_id<'r, 'h: 'r>(
&'r self,
header: &'h Header
) -> Option<Result<usize>>
fn reference_sequence_id<'r, 'h: 'r>( &'r self, header: &'h Header ) -> Option<Result<usize>>
Returns the reference sequence ID.
source§fn mapping_quality(&self) -> Option<Result<MappingQuality>>
fn mapping_quality(&self) -> Option<Result<MappingQuality>>
Returns the mapping quality.
source§fn mate_reference_sequence_id<'r, 'h: 'r>(
&'r self,
header: &'h Header
) -> Option<Result<usize>>
fn mate_reference_sequence_id<'r, 'h: 'r>( &'r self, header: &'h Header ) -> Option<Result<usize>>
Returns the mate reference sequence ID.
source§fn template_length(&self) -> Result<i32>
fn template_length(&self) -> Result<i32>
Returns the template length.
source§fn quality_scores(&self) -> Box<dyn QualityScores + '_>
fn quality_scores(&self) -> Box<dyn QualityScores + '_>
Returns the quality scores.
source§fn reference_sequence<'h>(
&self,
header: &'h Header
) -> Option<Result<(&'h BStr, &'h Map<ReferenceSequence>)>>
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>)>>
fn mate_reference_sequence<'h>( &self, header: &'h Header ) -> Option<Result<(&'h BStr, &'h Map<ReferenceSequence>)>>
Returns the associated mate reference sequence.
impl Eq for Record
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.