pub struct Record(/* private fields */);
Expand description
A SAM record.
Implementations§
Source§impl Record
impl Record
Sourcepub fn name(&self) -> Option<&BStr>
pub fn name(&self) -> Option<&BStr>
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<&BStr>
pub fn reference_sequence_name(&self) -> Option<&BStr>
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.
This position is 1-based, inclusive.
§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<&BStr>
pub fn mate_reference_sequence_name(&self) -> Option<&BStr>
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.
This position is 1-based, inclusive.
§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 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 mate_alignment_start(&self) -> Option<Result<Position>>
fn mate_alignment_start(&self) -> Option<Result<Position>>
Returns the mate alignment start. Read more
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.