pub struct GenomeBuild { /* private fields */ }Expand description
Genome build includes the contigs and the genome build metadata.
Implementations§
Source§impl GenomeBuild
impl GenomeBuild
pub fn new<I>(id: GenomeBuildIdentifier, contigs: I) -> Selfwhere
I: IntoIterator<Item = Contig>,
Sourcepub fn id(&self) -> &GenomeBuildIdentifier
pub fn id(&self) -> &GenomeBuildIdentifier
Get the genome build identifiers.
Sourcepub fn contig_by_name(&self, name: &str) -> Option<&Contig>
pub fn contig_by_name(&self, name: &str) -> Option<&Contig>
Retrieve a Contig by its name or None if no such Contig can be found.
§Examples
use dabuild::{GenomeBuild, GenomeBuildIdentifier};
use dabuild::builds::get_grch38_p13;
let build: GenomeBuild = get_grch38_p13();
// Query by a contig name ...
let chrY = build.contig_by_name("Y").unwrap();
assert_eq!(chrY.name(), "Y");
// ... or by GenBank accession ...
let chrY = build.contig_by_name("CM000686.2").unwrap();
assert_eq!(chrY.genbank_name(), Some("CM000686.2"));
// ... or by RefSeq accession ...
let chrY = build.contig_by_name("NC_000024.10").unwrap();
assert_eq!(chrY.refseq_name(), Some("NC_000024.10"));
// ... or by UCSC accession.
let chrY = build.contig_by_name("chrY").unwrap();
assert_eq!(chrY.ucsc_name(), Some("chrY"));Trait Implementations§
Source§impl Clone for GenomeBuild
impl Clone for GenomeBuild
Source§fn clone(&self) -> GenomeBuild
fn clone(&self) -> GenomeBuild
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenomeBuild
impl Debug for GenomeBuild
Source§impl PartialEq for GenomeBuild
impl PartialEq for GenomeBuild
impl Eq for GenomeBuild
impl StructuralPartialEq for GenomeBuild
Auto Trait Implementations§
impl Freeze for GenomeBuild
impl RefUnwindSafe for GenomeBuild
impl Send for GenomeBuild
impl Sync for GenomeBuild
impl Unpin for GenomeBuild
impl UnwindSafe for GenomeBuild
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
Mutably borrows from an owned value. Read more