[−][src]Struct bio_types::annot::pos::Pos
Position on a particular, named sequence (e.g. a chromosome).
Parameterized over the type of the reference sequence identifier and over the strandedness of the position.
The display format for a Pos
is chr:pos(+/-). A stranded
position must have a (+) or a (-), while an unstranded
position does not.
use bio_types::annot::pos::Pos; use bio_types::strand::ReqStrand; let start = Pos::new("chrIV".to_owned(), 683946, ReqStrand::Reverse); let start_str = start.to_string(); assert_eq!(start_str, "chrIV:683946(-)"); let start_str_pos = start_str.parse()?; assert_eq!(start, start_str_pos);
Methods
impl<R, S> Pos<R, S>
[src]
pub fn new(refid: R, pos: isize, strand: S) -> Self
[src]
Construct a new sequence position
use std::rc::Rc; use bio_types::annot::pos::Pos; use bio_types::strand::ReqStrand; let chr = Rc::new("chrIV".to_owned()); let start = Pos::new(chr, 683946, ReqStrand::Reverse);
pub fn pos(&self) -> isize
[src]
Position on the reference sequence (0-based).
pub fn into_stranded(self, strand: ReqStrand) -> Pos<R, ReqStrand>
[src]
Convert into a stranded sequence position on the specified strand
Trait Implementations
impl<R, S> Loc for Pos<R, S>
[src]
type RefID = R
type Strand = S
fn refid(&self) -> &R
[src]
fn start(&self) -> isize
[src]
fn length(&self) -> usize
[src]
fn strand(&self) -> S where
S: Copy,
[src]
S: Copy,
fn pos_into<T>(&self, pos: &Pos<Self::RefID, T>) -> Option<Pos<(), T>> where
Self::RefID: Eq,
Self::Strand: Into<ReqStrand> + Copy,
T: Neg<Output = T> + Copy,
[src]
Self::RefID: Eq,
Self::Strand: Into<ReqStrand> + Copy,
T: Neg<Output = T> + Copy,
fn pos_outof<Q, T>(&self, pos: &Pos<Q, T>) -> Option<Pos<Self::RefID, T>> where
Self::RefID: Clone,
Self::Strand: Into<ReqStrand> + Copy,
T: Neg<Output = T> + Copy,
[src]
Self::RefID: Clone,
Self::Strand: Into<ReqStrand> + Copy,
T: Neg<Output = T> + Copy,
fn contig_intersection<T>(
&self,
contig: &Contig<Self::RefID, T>
) -> Option<Self> where
Self::RefID: PartialEq + Clone,
Self::Strand: Copy,
[src]
&self,
contig: &Contig<Self::RefID, T>
) -> Option<Self> where
Self::RefID: PartialEq + Clone,
Self::Strand: Copy,
fn contig(&self) -> Contig<Self::RefID, Self::Strand> where
Self::RefID: Clone,
Self::Strand: Copy,
[src]
Self::RefID: Clone,
Self::Strand: Copy,
Contiguous sequence location that fully covers the location.
fn first_pos(&self) -> Pos<Self::RefID, Self::Strand> where
Self::RefID: Clone,
Self::Strand: Into<ReqStrand> + Copy,
[src]
Self::RefID: Clone,
Self::Strand: Into<ReqStrand> + Copy,
The first Pos
in a location, on the annotated strand. Read more
fn last_pos(&self) -> Pos<Self::RefID, Self::Strand> where
Self::RefID: Clone,
Self::Strand: Into<ReqStrand> + Copy,
[src]
Self::RefID: Clone,
Self::Strand: Into<ReqStrand> + Copy,
The last Pos
in a location, on the annotated strand. Read more
impl<R, S> Same for Pos<R, S> where
R: Eq,
S: Same,
[src]
R: Eq,
S: Same,
fn same(&self, p: &Self) -> bool
[src]
Indicate when two positions are the "same" -- when positions have unknown/unspecified strands they can be the "same" but not equal.
impl<R: Clone, S: Clone> Clone for Pos<R, S>
[src]
fn clone(&self) -> Pos<R, S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<R: Eq, S: Eq> Eq for Pos<R, S>
[src]
impl<R: PartialEq, S: PartialEq> PartialEq<Pos<R, S>> for Pos<R, S>
[src]
impl<R> From<Pos<R, ReqStrand>> for Pos<R, Strand>
[src]
impl<R> From<Pos<R, NoStrand>> for Pos<R, Strand>
[src]
impl<R> From<Pos<R, Strand>> for Pos<R, NoStrand>
[src]
impl<R> From<Pos<R, ReqStrand>> for Pos<R, NoStrand>
[src]
impl<R, S> Display for Pos<R, S> where
R: Display,
S: Display,
[src]
R: Display,
S: Display,
impl<R: Debug, S: Debug> Debug for Pos<R, S>
[src]
impl<R, S> FromStr for Pos<R, S> where
R: From<String>,
S: FromStr<Err = StrandError>,
[src]
R: From<String>,
S: FromStr<Err = StrandError>,
type Err = ParseAnnotError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<R, T> AddAssign<T> for Pos<R, ReqStrand> where
isize: AddAssign<T>,
isize: SubAssign<T>,
[src]
isize: AddAssign<T>,
isize: SubAssign<T>,
fn add_assign(&mut self, dist: T)
[src]
Slide the reference position by an offset on the strand of the annotation.
Arguments
dist
specifies the offset for sliding the position. A positivedist
will numerically increase the position for forward-strand features and decrease it for reverse-strand features.
use bio_types::annot::pos::Pos; use bio_types::strand::ReqStrand; let mut start = Pos::new("chrIV".to_owned(), 683946, ReqStrand::Reverse); assert_eq!(start.to_string(), "chrIV:683946(-)"); start += 100; assert_eq!(start.to_string(), "chrIV:683846(-)");
impl<R, T> SubAssign<T> for Pos<R, ReqStrand> where
isize: AddAssign<T>,
isize: SubAssign<T>,
[src]
isize: AddAssign<T>,
isize: SubAssign<T>,
fn sub_assign(&mut self, dist: T)
[src]
Slide the reference position by an offset on the strand of the annotation.
Arguments
dist
specifies the offset for sliding the position. A positivedist
will numerically decrease the position for forward-strand features and increase it for reverse-strand features.
use bio_types::annot::pos::Pos; use bio_types::strand::ReqStrand; let mut start = Pos::new("chrIV".to_owned(), 683946, ReqStrand::Reverse); assert_eq!(start.to_string(), "chrIV:683946(-)"); start -= 100; assert_eq!(start.to_string(), "chrIV:684046(-)");
impl<R: Hash, S: Hash> Hash for Pos<R, S>
[src]
Auto Trait Implementations
impl<R, S> Send for Pos<R, S> where
R: Send,
S: Send,
R: Send,
S: Send,
impl<R, S> Sync for Pos<R, S> where
R: Sync,
S: Sync,
R: Sync,
S: Sync,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,