GithubHelp home page GithubHelp logo

zenleaf / entrez-rs Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 3.0 46 KB

A Rust wrapper around the Entrez API. Helps you access the Entrez API using idiomatic Rust. It also provides tools to parse the XML results from Entrez.

Rust 100.00%
entrez gene pubmed rust biorust medical bioinformatics ncbi blast

entrez-rs's Introduction

entrez-rs

A Rust wrapper for the Entrez API

release: Crates.io

master: Build Status

This library helps you access the Entrez API using idiomatic Rust. It also provides tools to parse the XML results from Entrez.

Installation

Add the following to your Cargo.toml:

   [dependencies]
   entrez-rs = "0.1.4"

Usage

use entrez_rs::eutils::{Eutils, ESearch, EFetch, DB};
use entrez_rs::parser::esearch::{ESearchResult};
use entrez_rs::parser::pubmed::{PubmedArticleSet};
use entrez_rs::errors::Error;

fn main() -> Result<(), Error>  {
        let xml = ESearch::new(
            DB::Pubmed, 
            "eclampsia")
            .run()?;

        let parsed = ESearchResult::read(&xml);

        println!("{:#?}", &parsed?
                          .id_list
                          .ids);
        
        let pm_xml = EFetch::new(
              DB::Pubmed,
              vec!["33246200", "33243171"])
              .run()?;
        
        let pm_parsed = PubmedArticleSet::read(&pm_xml);

        println!("{}", pm_parsed?.articles);

        Ok(())
}

Will add a walkthrough and tutorial of the API as soon as it reaches beta level.

Inspired by Entrez Direct, Entrezpy and BioPython.

entrez-rs's People

Contributors

ahcm avatar zenleaf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

entrez-rs's Issues

Why is only Pubmed implemented as a database?

You can access more than just one database via the NCBI. In my opinion, the following query cannot be mapped with this library:

#!/bin/sh
esearch -db nuccore -query "Sclerotinia sclerotiorum 1980 [TITLE]"  | efilter -molecule mrna | efetch -format fasta > s_sclerot.fa

Need DTD parsers instead of manual methods.

There are various, large DTDs with contents that may change overtime. The current method of using handwritten structs for parsing may not be maintainable. Instead, need to implement a DTD parser which can be used with the XML parser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.