[−][src]Struct bio_types::annot::spliced::Spliced
Spliced sequence annotation 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 Spliced
is
chr:start_0-end_0;start_1-end_1;...;start_N-end_N(+/-/.). The
boundaries for each individual exon are given as a half-open
0-based interval, like the Rust Range
and BED format.
let tad3 = Spliced::with_lengths_starts("chrXII".to_owned(), 765265, &vec![808,52,109], &vec![0,864,984], ReqStrand::Reverse)?; assert_eq!(tad3.to_string(), "chrXII:765265-766073;766129-766181;766249-766358(-)"); let tad3_exons = tad3.exon_contigs(); assert_eq!(tad3_exons.len(), 3); assert_eq!(tad3_exons[0].to_string(), "chrXII:766249-766358(-)"); assert_eq!(tad3_exons[1].to_string(), "chrXII:766129-766181(-)"); assert_eq!(tad3_exons[2].to_string(), "chrXII:765265-766073(-)");
Implementations
impl<R, S> Spliced<R, S>
[src]
pub fn new(refid: R, start: isize, exon_0_length: usize, strand: S) -> Self
[src]
Construct a new, single-exon "spliced" location
use std::rc::Rc; use bio_types::annot::spliced::Spliced; use bio_types::strand::ReqStrand; let chr = Rc::new("chrX".to_owned()); let tma22 = Spliced::new(chr, 461829, 462426 - 461829, ReqStrand::Forward);
pub fn with_lengths_starts(
refid: R,
start: isize,
exon_lengths: &[usize],
exon_starts: &[usize],
strand: S
) -> Result<Self, SplicingError>
[src]
refid: R,
start: isize,
exon_lengths: &[usize],
exon_starts: &[usize],
strand: S
) -> Result<Self, SplicingError>
Construct a multi-exon "spliced" location using BED-style exon starts and lengths.
pub fn exon_count(&self) -> usize
[src]
Number of exons
pub fn exon_starts(&self) -> Vec<usize>
[src]
Vector of exon starting positions, relative to the start of the location overall.
These positions run from left to right on the reference sequence, regardless of the location's strand.
pub fn exon_lengths(&self) -> Vec<usize>
[src]
Vector of exon lengths.
Exon lengths are given from left to right on the reference sequence, regardless of the location's strand.
pub fn exon_total_length(&self) -> usize
[src]
Total length of exons only.
The length
method from the Loc
trait returns the total
length spanned by the annotation, including both introns and
exons.
pub fn into_stranded(self, strand: ReqStrand) -> Spliced<R, ReqStrand>
[src]
Convert into a stranded sequence location on the specified strand
pub fn contig_cover(self) -> Contig<R, S>
[src]
impl<R> Spliced<R, ReqStrand>
[src]
Trait Implementations
impl<R: Clone, S: Clone> Clone for Spliced<R, S>
[src]
impl<R: Debug, S: Debug> Debug for Spliced<R, S>
[src]
impl<R, S> Display for Spliced<R, S> where
R: Display,
S: Display,
[src]
R: Display,
S: Display,
impl<R: Eq, S: Eq> Eq for Spliced<R, S>
[src]
impl<R> From<Spliced<R, NoStrand>> for Spliced<R, Strand>
[src]
impl<R> From<Spliced<R, ReqStrand>> for Spliced<R, Strand>
[src]
impl<R> From<Spliced<R, ReqStrand>> for Spliced<R, NoStrand>
[src]
impl<R> From<Spliced<R, Strand>> for Spliced<R, NoStrand>
[src]
impl<R, S> FromStr for Spliced<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.
pub fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<R: Hash, S: Hash> Hash for Spliced<R, S>
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<R, S> Loc for Spliced<R, S>
[src]
type RefID = R
type Strand = S
pub fn refid(&self) -> &R
[src]
pub fn start(&self) -> isize
[src]
pub fn length(&self) -> usize
[src]
pub fn strand(&self) -> S where
S: Copy,
[src]
S: Copy,
pub 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,
pub 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,
pub 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,
pub fn contig(&self) -> Contig<Self::RefID, Self::Strand> where
Self::RefID: Clone,
Self::Strand: Copy,
[src]
Self::RefID: Clone,
Self::Strand: Copy,
pub 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,
pub 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,
impl<R: PartialEq, S: PartialEq> PartialEq<Spliced<R, S>> for Spliced<R, S>
[src]
pub fn eq(&self, other: &Spliced<R, S>) -> bool
[src]
pub fn ne(&self, other: &Spliced<R, S>) -> bool
[src]
impl<R, S> StructuralEq for Spliced<R, S>
[src]
impl<R, S> StructuralPartialEq for Spliced<R, S>
[src]
Auto Trait Implementations
impl<R, S> RefUnwindSafe for Spliced<R, S> where
R: RefUnwindSafe,
S: RefUnwindSafe,
[src]
R: RefUnwindSafe,
S: RefUnwindSafe,
impl<R, S> Send for Spliced<R, S> where
R: Send,
S: Send,
[src]
R: Send,
S: Send,
impl<R, S> Sync for Spliced<R, S> where
R: Sync,
S: Sync,
[src]
R: Sync,
S: Sync,
impl<R, S> Unpin for Spliced<R, S> where
R: Unpin,
S: Unpin,
[src]
R: Unpin,
S: Unpin,
impl<R, S> UnwindSafe for Spliced<R, S> where
R: UnwindSafe,
S: UnwindSafe,
[src]
R: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,