Giter Site home page Giter Site logo

cebel / pyhgnc Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 3.0 615 KB

A Python package to access and query data provided by HGNC-approved gene nomenclature, gene families and associated resources including links to genomic, proteomic and phenotypic information.

License: Apache License 2.0

Python 94.80% HTML 5.20%

pyhgnc's People

Contributors

cebel avatar christianebeling avatar cthoyt avatar lekono avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pyhgnc's Issues

Error in update method (get_mgds)

There appears to be an issue with the update method, specifically in the get_mgds method. At least one of the mgd ids appears to be simply "M" which causes the code to fall over.

Line 187 in database.py. I solved this by:

def get_mgds(self, hgnc):
    mgds = []

    if 'mgd_id' in hgnc:

        for mgd in hgnc['mgd_id']:

            if mgd not in self.mgds:
                try:
                    mgdid = int(mgd.split(':')[-1])
                except ValueError:
                    mgdid = None
                if mgdid:
                    self.mgds[mgd] = models.MGD(mgdid=mgdid)
                    mgds.append(self.mgds[mgd])

    return mgds

However, I'm not sure if the real issue is in the download or not.

Update crashes

$ pyhgnc update
Traceback (most recent call last):
  File "/Users/cthoyt/.local/bin/pyhgnc", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pyhgnc/cli.py", line 83, in update
    low_memory=low_memory)
  File "/usr/local/lib/python3.6/site-packages/pyhgnc/manager/database.py", line 419, in update
    database.db_import(silent=silent, hgnc_file_path=hgnc_file_path, hcop_file_path=hcop_file_path, low_memory=low_memory)
  File "/usr/local/lib/python3.6/site-packages/pyhgnc/manager/database.py", line 120, in db_import
    json_data = DbManager.load_hgnc_json(hgnc_file_path=hgnc_file_path)
  File "/usr/local/lib/python3.6/site-packages/pyhgnc/manager/database.py", line 402, in load_hgnc_json
    response = request.urlopen(HGNC_JSON)
NameError: name 'request' is not defined

It's hard to keep those request references straight, especially when writing code that's supposed to be 2/3 compatible. All that needs to be done is the namespace removed.

Can't run as module

There's no __main__.py module so this error happens:

$ python3 -m pyhgnc update
/usr/local/opt/python3/bin/python3.6: No module named pyhgnc.__main__; 'pyhgnc' is a package and cannot be directly executed

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.