Code Monkey home page Code Monkey logo

gb-io's People

Contributors

althonos avatar dlesl avatar

Stargazers

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

Watchers

 avatar  avatar

gb-io's Issues

Nom=4.2.3 contains code that will be rejected by a future version of Rust

Hi there, thanks for your work on this project!

I got a compiler warning in a project that sues gb-io:

warning: the following packages contain code that will be rejected by a future version of Rust: nom v4.2.3
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1`

This is fixed in subsequent version of nom. It looks like #7 already addresses this issue, but the PR is still open. As someone currently using this package, I figured I would make this issue to say 1) I appreciate this package and 2) it would also appreciate if #7 could be merged at some point.

Also happy to lend a hand if there are still any difficulties porting from nom 4 to nom 7.

Feature request: direct access to source fields

When looking at a GenBank entry there often is interesting information in the "source" feature, which actually contains several subfields. From instance below one can see the "host" information:

host

I end up having to wrap the gb_io.Record class with another class to access this information. Also I end up constantly having to replace newlines with spaces.

class GenBankRecord:

    def __init__(self, rec):
        """Get a record instance from gb_io"""
        self.rec = rec

    @functools.cached_property
    def source(self):
        """Parse the first feature which is always 'source'"""
        return next(iter(self.rec.features))

    @functools.cached_property
    def fields(self):
        """Get all subfields of source."""
        return self.source.qualifiers.to_dict()

    @functools.cached_property
    def host(self):
        if 'host' in self.fields:
            return self.fields['host'][0].replace('\n', ' ')
        return ''

It would be nice to just do rec.host no?

`GbParserError` is de-facto private

Hi David!

In v0.7.0 I noticed there is no way to use the GbParserError type: the errors module is private, and this struct is not publicly re-exported in the ::reader module. I guess it would make sense to re-export it publicly there (the alternative, making errors public, only makes sense if you also had the errors from the ::seq module in there).

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.