pub struct SamRecord {
pub qname: String,
pub flag: u16,
pub rname: String,
pub pos: i32,
pub mapq: u8,
pub cigar: Vec<CigarOp>,
pub rnext: String,
pub pnext: i32,
pub tlen: i32,
pub seq: Vec<u8>,
pub qual: Vec<u8>,
pub tags: HashMap<String, TagValue>,
}Expand description
SAM alignment record
This struct is identical to BAM’s BamRecord but parsed from text instead of binary.
Fields§
§qname: StringQuery template name
flag: u16Bitwise FLAG
rname: StringReference sequence name
pos: i321-based leftmost mapping position (0 for unmapped)
mapq: u8Mapping quality (255 if unavailable)
cigar: Vec<CigarOp>CIGAR string
rnext: StringReference name of mate/next read
pnext: i32Position of mate/next read (0 if unavailable)
tlen: i32Template length
seq: Vec<u8>Segment sequence (empty if unavailable)
qual: Vec<u8>Phred-scaled base qualities (empty if unavailable)
Optional tags
Implementations§
Source§impl SamRecord
impl SamRecord
Sourcepub fn is_proper_pair(&self) -> bool
pub fn is_proper_pair(&self) -> bool
Check if read is mapped in proper pair
Sourcepub fn is_unmapped(&self) -> bool
pub fn is_unmapped(&self) -> bool
Check if read is unmapped
Sourcepub fn is_mate_unmapped(&self) -> bool
pub fn is_mate_unmapped(&self) -> bool
Check if mate is unmapped
Sourcepub fn is_reverse(&self) -> bool
pub fn is_reverse(&self) -> bool
Check if read is reverse strand
Sourcepub fn is_mate_reverse(&self) -> bool
pub fn is_mate_reverse(&self) -> bool
Check if mate is reverse strand
Sourcepub fn is_first_in_pair(&self) -> bool
pub fn is_first_in_pair(&self) -> bool
Check if read is first in pair
Sourcepub fn is_second_in_pair(&self) -> bool
pub fn is_second_in_pair(&self) -> bool
Check if read is second in pair
Sourcepub fn is_secondary(&self) -> bool
pub fn is_secondary(&self) -> bool
Check if alignment is secondary
Sourcepub fn is_qc_fail(&self) -> bool
pub fn is_qc_fail(&self) -> bool
Check if read fails quality checks
Sourcepub fn is_duplicate(&self) -> bool
pub fn is_duplicate(&self) -> bool
Check if read is a PCR or optical duplicate
Sourcepub fn is_supplementary(&self) -> bool
pub fn is_supplementary(&self) -> bool
Check if alignment is supplementary
Sourcepub fn cigar_string(&self) -> String
pub fn cigar_string(&self) -> String
Get CIGAR string representation
Sourcepub fn seq_string(&self) -> String
pub fn seq_string(&self) -> String
Get sequence as string
Trait Implementations§
Source§impl From<&SamRecord> for GenomicInterval
impl From<&SamRecord> for GenomicInterval
Auto Trait Implementations§
impl Freeze for SamRecord
impl RefUnwindSafe for SamRecord
impl Send for SamRecord
impl Sync for SamRecord
impl Unpin for SamRecord
impl UnsafeUnpin for SamRecord
impl UnwindSafe for SamRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more