Giter Club home page Giter Club logo

seqrepo-rs's Introduction

Crates.io Crates.io Crates.io CI codecov DOI

seqrepo-rs

This is a port of biocommons/seqrepo to the Rust programming language.

At the moment, only read access has been implemented. For downloading etc., you will have to use the Python package.

Running the CLI Example

The library ships with an example called cli that you can use to query a seqrepo.

# cargo run --example cli -- --help

seqrepo-rs's People

Contributors

holtgrewe avatar dependabot[bot] avatar github-actions[bot] avatar varfish-bot avatar tedil avatar jsstevenson avatar

Stargazers

Kyle Ferriter avatar Mihai Todor avatar  avatar  avatar

Watchers

 avatar Oliver Stolpe avatar  avatar  avatar

Forkers

jsstevenson

seqrepo-rs's Issues

`AliasDb::find()` can't search against `seq_id` column

Describe the bug
The find() method doesn't use the Query seqid property to search against the seq_id column, but rather, looks it up as an alias.

To Reproduce
A Query object like the below won't return any alias records:

    let sr = SeqRepo::new("/usr/local/share/seqrepo", "latest").unwrap();
    let alias_db = sr.alias_db();
    let query = Query{
        namespace: Some(Namespace::new("%")),
        alias: Some("%".to_string()),
        seqid: Some("yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl".to_string()),
        current_only: false,
    };
    let _ = alias_db.find(&query, |record| {
        println!("{:?}", record.unwrap());
    });

The following, however, will work -- because alias entries prefix GA4GH IDs with GS_:

    let sr = SeqRepo::new("/usr/local/share/seqrepo", "latest").unwrap();
    let alias_db = sr.alias_db();
    let query = Query{
        namespace: Some(Namespace::new("%")),
        alias: Some("%".to_string()),
        seqid: Some("GS_yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl".to_string()),
        current_only: false,
    };
    let _ = alias_db.find(&query, |record| {
        println!("{:?}", record.unwrap());
    });

Expected behavior
The above snippet should print this record when the givenseqid arg is "yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl":

AliasDbRecord { seqalias_id: 9349420, seqid: "yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl", alias: "GS_yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl", added: 2017-07-19T03:33:58, is_current: true, namespace: Namespace { value: "VMC" } }

Additional context
I'm guessing this was just a typo?

Apache License Compliance

Put the original apache footers to the files and state clearly how/that the code was originally derived from the bio Commons python package.

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.