pub struct PileupPosition {Show 21 fields
pub ref_seq: String,
pub pos: u32,
pub ref_base: Option<char>,
pub depth: u32,
pub a: u32,
pub c: u32,
pub g: u32,
pub t: u32,
pub n: u32,
pub r: u32,
pub y: u32,
pub s: u32,
pub w: u32,
pub k: u32,
pub m: u32,
pub ins: u32,
pub del: u32,
pub ref_skip: u32,
pub fail: u32,
pub count_of_mate_resolutions: u32,
pub near_max_depth: bool,
}Expand description
Hold all information about a position.
Fields§
§ref_seq: StringReference sequence name.
pos: u321-based position in the sequence.
ref_base: Option<char>The reference base at this position.
depth: u32Total depth at this position.
a: u32Number of A bases at this position.
c: u32Number of C bases at this position.
g: u32Number of G bases at this position.
t: u32Number of T bases at this position.
n: u32Number of N bases at this position. Any unrecognized base will be counted as an N.
r: u32Number of bases that could be A or G
y: u32Number of bases that could be C or T
s: u32Number of bases that could be G or C
w: u32Number of bases that could be A or T
k: u32Number of bases that could be G or T
m: u32Number of bases that could be A or C
ins: u32Number of insertions that start to the right of this position. Does not count toward depth.
del: u32Number of deletions at this position.
ref_skip: u32Number of refskips at this position. Does not count toward depth.
fail: u32Number of reads failing filters at this position.
count_of_mate_resolutions: u32Number of times a mate resolution was needed.
near_max_depth: boolDepth is within 1% of max_depth
Implementations§
Source§impl PileupPosition
impl PileupPosition
Sourcepub fn from_pileup<F: ReadFilter>(
pileup: Pileup,
header: &HeaderView,
read_filter: &F,
base_filter: Option<u8>,
) -> Self
pub fn from_pileup<F: ReadFilter>( pileup: Pileup, header: &HeaderView, read_filter: &F, base_filter: Option<u8>, ) -> Self
Convert a pileup into a Position.
This will walk over each of the alignments and count the number each nucleotide it finds. It will also count the number of Ins/Dels/Skips that are at each position.
§Arguments
pileup- a pileup at a genomic positionheader- a headerview for the bam file being read, to get the sequence nameread_filter- a function to filter out reads, returning false will cause a read to be filteredbase_filter- an optional base quality score. If Some(number) if the base quality is not >= that number the base is treated as anN
Sourcepub fn from_pileup_mate_aware<F: ReadFilter>(
pileup: Pileup,
header: &HeaderView,
read_filter: &F,
base_filter: Option<u8>,
mate_fix_strat: MateResolutionStrategy,
) -> Self
pub fn from_pileup_mate_aware<F: ReadFilter>( pileup: Pileup, header: &HeaderView, read_filter: &F, base_filter: Option<u8>, mate_fix_strat: MateResolutionStrategy, ) -> Self
Convert a pileup into a Position.
This will walk over each of the alignments and count the number each nucleotide it finds. It will also count the number of Ins/Dels/Skips that are at each position.
Additionally, this method is mate aware. Before processing a position it will scan the alignments for mates. If a mate is found, it will try to take use the mate that has the highest MAPQ, breaking ties by choosing the first in pair that passes filters. In the event of both failing filters or not being first in pair, the first read encountered is kept.
§Arguments
pileup- a pileup at a genomic positionheader- a headerview for the bam file being read, to get the sequence nameread_filter- a function to filter out reads, returning false will cause a read to be filteredbase_filter- an optional base quality score. If Some(number) if the base quality is not >= that number the base is treated as anN
Sourcepub fn compact_refseq(header: &HeaderView, tid: u32) -> SmartString<LazyCompact>
pub fn compact_refseq(header: &HeaderView, tid: u32) -> SmartString<LazyCompact>
Convert a tid to a SmartString<LazyCompact>.
Trait Implementations§
Source§impl Debug for PileupPosition
impl Debug for PileupPosition
Source§impl Default for PileupPosition
impl Default for PileupPosition
Source§fn default() -> PileupPosition
fn default() -> PileupPosition
Source§impl Position for PileupPosition
impl Position for PileupPosition
Auto Trait Implementations§
impl Freeze for PileupPosition
impl RefUnwindSafe for PileupPosition
impl Send for PileupPosition
impl Sync for PileupPosition
impl Unpin for PileupPosition
impl UnwindSafe for PileupPosition
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.