pub struct Spliced<R, S> { /* private fields */ }
Expand description

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

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

Construct a multi-exon “spliced” location using BED-style exon starts and lengths.

Number of exons

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.

Vector of exon lengths.

Exon lengths are given from left to right on the reference sequence, regardless of the location’s strand.

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.

Convert into a stranded sequence location on the specified strand

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

The associated error which can be returned from parsing.

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

Feeds this value into the given Hasher. Read more

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

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

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.