Struct bio_types::annot::pos::Pos[][src]

pub struct Pos<R, S> { /* fields omitted */ }

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]

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);

Position on the reference sequence (0-based).

Convert into a stranded sequence position on the specified strand

Trait Implementations

impl<R: Debug, S: Debug> Debug for Pos<R, S>
[src]

Formats the value using the given formatter. Read more

impl<R: Clone, S: Clone> Clone for Pos<R, S>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<R: Hash, S: Hash> Hash for Pos<R, S>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<R: PartialEq, S: PartialEq> PartialEq for Pos<R, S>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<R: Eq, S: Eq> Eq for Pos<R, S>
[src]

impl<R, T> AddAssign<T> for Pos<R, ReqStrand> where
    isize: AddAssign<T>,
    isize: SubAssign<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 positive dist 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]

Slide the reference position by an offset on the strand of the annotation.

Arguments

  • dist specifies the offset for sliding the position. A positive dist 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, S> Loc for Pos<R, S>
[src]

Name of the reference sequence (chromosome name, etc.)

Starting (lowest, left-most, 5'-most) position on the reference sequence (0-based). Read more

Length of the region

Strand of the position

Map a sequence position on a reference sequence into a relative position within an annotated location on the reference sequence. Read more

Map a relative position within an annotated location out of that location onto the enclosing reference sequence. Read more

Contiguous sequence location that fully covers the location.

The first Pos in a location, on the annotated strand. Read more

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]

Indicate when two positions are the "same" -- when positions have unknown/unspecified strands they can be the "same" but not equal.

impl<R, S> Display for Pos<R, S> where
    R: Display,
    S: Display
[src]

Formats the value using the given formatter. Read more

impl<R, S> FromStr for Pos<R, S> where
    R: From<String>,
    S: FromStr<Err = StrandError>, 
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl<R> From<Pos<R, ReqStrand>> for Pos<R, Strand>
[src]

Performs the conversion.

impl<R> From<Pos<R, NoStrand>> for Pos<R, Strand>
[src]

Performs the conversion.

impl<R> From<Pos<R, Strand>> for Pos<R, NoStrand>
[src]

Performs the conversion.

impl<R> From<Pos<R, ReqStrand>> for Pos<R, NoStrand>
[src]

Performs the conversion.

Auto Trait Implementations

impl<R, S> Send for Pos<R, S> where
    R: Send,
    S: Send

impl<R, S> Sync for Pos<R, S> where
    R: Sync,
    S: Sync