pub struct NcbiClient { /* private fields */ }Expand description
Client for NCBI Entrez APIs (genes, proteins, nucleotides, SNPs)
Implementations§
Source§impl NcbiClient
impl NcbiClient
Sourcepub fn new(api_key: Option<String>) -> Result<Self>
pub fn new(api_key: Option<String>) -> Result<Self>
Create a new NCBI Entrez client
§Arguments
api_key- Optional NCBI API key (get from https://www.ncbi.nlm.nih.gov/account/) Without a key: 3 requests/second With a key: 10 requests/second
Sourcepub async fn search_genes(
&self,
query: &str,
organism: Option<&str>,
) -> Result<Vec<SemanticVector>>
pub async fn search_genes( &self, query: &str, organism: Option<&str>, ) -> Result<Vec<SemanticVector>>
Search gene database
§Arguments
query- Search query (e.g., “BRCA1”, “alzheimer’s disease”)organism- Optional organism filter (e.g., “human”, “mouse”)
Sourcepub async fn get_gene(&self, gene_id: &str) -> Result<Option<SemanticVector>>
pub async fn get_gene(&self, gene_id: &str) -> Result<Option<SemanticVector>>
Get gene details by gene ID
Sourcepub async fn search_proteins(&self, query: &str) -> Result<Vec<SemanticVector>>
pub async fn search_proteins(&self, query: &str) -> Result<Vec<SemanticVector>>
Search protein database
Sourcepub async fn search_nucleotide(
&self,
query: &str,
) -> Result<Vec<SemanticVector>>
pub async fn search_nucleotide( &self, query: &str, ) -> Result<Vec<SemanticVector>>
Search nucleotide sequences
Auto Trait Implementations§
impl Freeze for NcbiClient
impl !RefUnwindSafe for NcbiClient
impl Send for NcbiClient
impl Sync for NcbiClient
impl Unpin for NcbiClient
impl !UnwindSafe for NcbiClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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