pub struct GeneQuery { /* private fields */ }Expand description
Query features by gene ID
Implementations§
Source§impl GeneQuery
impl GeneQuery
Sourcepub fn new(
index: HashMap<String, Vec<GenomicFeature>, RandomState>,
) -> GeneQuery
pub fn new( index: HashMap<String, Vec<GenomicFeature>, RandomState>, ) -> GeneQuery
Create a new GeneQuery from an index
Sourcepub fn get_gene(&self, gene_id: &str) -> Option<&Vec<GenomicFeature>>
pub fn get_gene(&self, gene_id: &str) -> Option<&Vec<GenomicFeature>>
Get all features for a specific gene
§Example
use deepbiop_gtf::query::gene::GeneQuery;
use deepbiop_gtf::types::GenomicFeature;
use ahash::HashMap;
let index = HashMap::default();
let query = GeneQuery::new(index);
let features = query.get_gene("ENSG00000000001");Sourcepub fn list_genes(&self) -> Vec<String>
pub fn list_genes(&self) -> Vec<String>
Get all gene IDs in the index
Sourcepub fn gene_count(&self) -> usize
pub fn gene_count(&self) -> usize
Count total number of indexed genes
Sourcepub fn get_by_name(&self, gene_name: &str) -> Vec<&GenomicFeature>
pub fn get_by_name(&self, gene_name: &str) -> Vec<&GenomicFeature>
Get features by gene name (searches attributes)
§Example
let index = HashMap::default();
let query = GeneQuery::new(index);
let features = query.get_by_name("TP53");Sourcepub fn get_exons(&self, gene_id: &str) -> Vec<&GenomicFeature>
pub fn get_exons(&self, gene_id: &str) -> Vec<&GenomicFeature>
Get all exons for a gene
Sourcepub fn get_transcripts(&self, gene_id: &str) -> Vec<&GenomicFeature>
pub fn get_transcripts(&self, gene_id: &str) -> Vec<&GenomicFeature>
Get all transcripts for a gene
Auto Trait Implementations§
impl Forget for GeneQuery
impl Freeze for GeneQuery
impl Move for GeneQuery
impl RefUnwindSafe for GeneQuery
impl Send for GeneQuery
impl Sync for GeneQuery
impl Unpin for GeneQuery
impl UnsafeUnpin for GeneQuery
impl UnwindSafe for GeneQuery
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more