Giter Club home page Giter Club logo

hgnc's Introduction

Bio2BEL Build Status Coverage Status Documentation Status zenodo

Bio2BEL is a project aimed at bringing biological databases and other structured knowledge sources in a wide variety of schemata into the unified framework of the Biological Expression Language [1].

Two important places to look:

Installation Current version on PyPI Stable Supported Python Versions MIT License

Download the latest stable code from PyPI with:

$ python -m pip install bio2bel

or get the latest from GitHub with:

$ git clone https://github.com/bio2bel/bio2bel.git
$ cd bio2bel
$ python -m pip install -e .

or check the installation instructions.

Citation

If you find Bio2BEL useful for your work, please consider citing:

[1]Hoyt, C. T., et al. (2019). Integration of Structured Biological Data Sources using Biological Expression Language. bioRxiv, 631812.

hgnc's People

Contributors

cthoyt avatar ddomingof avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

hgnc's Issues

bio2bel_hgnc populate sqlAlchemy

The problem seems to come from the generation of a bad formatted query for SQLAlchemy. I am using SQLAlchemy==1.3.24. In the traceback below you will find two errors:

  1. ValueError: invalid literal for int() with base 10: (mgdid = int(mgd.split(':')[-1]))
  2. UNIQUE constraint failed: pyhgnc_hgnc.identifier

I had no problems populating bio2bel_chebi. Which makes me think that this has to do with unexpected changes in the HGNC that bio2bel is not controlling ??

$ python3 -m bio2bel_hgnc populate

2022-10-14 14:28:20,894 - pyhgnc - INFO - low_memory set to False
 15%|████████████████████████▍    | 6311/43233 [00:05<00:29, 1262.21it/s]
 
Traceback (most recent call last):
  File "venv/lib/python3.8/site-packages/bio2bel/manager/abstract_manager.py", line 38, in populate_wrapped
    cls._populate_original(self, *populate_args, **populate_kwargs)
  File "venv/lib/python3.8/site-packages/bio2bel_hgnc/manager.py", line 85, in populate
    self.insert_hgnc(hgnc_dict=json_data, silent=silent, low_memory=low_memory)
  File "venv/lib/python3.8/site-packages/pyhgnc/manager/database.py", line 337, in insert_hgnc
    'mgds': self.get_mgds(hgnc_data),
  **File "venv/lib/python3.8/site-packages/pyhgnc/manager/database.py", line 195, in get_mgds
    mgdid = int(mgd.split(':')[-1])
ValueError: invalid literal for int() with base 10: ''**

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
sqlite3.IntegrityError: UNIQUE constraint failed: pyhgnc_hgnc.identifier

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "venv/lib/python3.8/site-packages/bio2bel_hgnc/__main__.py", line 8, in <module>
    main()
  File "venv/lib/python3.8/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "venv/lib/python3.8/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "venv/lib/python3.8/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "venv/lib/python3.8/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "venv/lib/python3.8/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "venv/lib/python3.8/site-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "venv/lib/python3.8/site-packages/bio2bel_hgnc/manager.py", line 640, in populate
    manager.populate(use_hcop=(not skip_hcop))
  File "venv/lib/python3.8/site-packages/bio2bel/manager/abstract_manager.py", line 40, in populate_wrapped
    self._store_populate_failed()
  File "venv/lib/python3.8/site-packages/bio2bel/manager/connection_manager.py", line 93, in _store_populate_failed
    Action.store_populate_failed(self.module_name, session=self.session)
  File "venv/lib/python3.8/site-packages/bio2bel/models.py", line 95, in store_populate_failed
    _store_helper(action, session=session)
  File "venv/lib/python3.8/site-packages/bio2bel/models.py", line 140, in _store_helper
    session.commit()
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/scoping.py", line 163, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1046, in commit
    self.transaction.commit()
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 504, in commit
    self._prepare_impl()
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 483, in _prepare_impl
    self.session.flush()
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2540, in flush
    self._flush(objects)
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2682, in _flush
    transaction.rollback(_capture_exception=True)
  File "venv/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.raise_(
  File "venv/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2642, in _flush
    flush_context.execute()
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
    rec.execute(self)
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 586, in execute
    persistence.save_obj(
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 239, in save_obj
    _emit_insert_statements(
  File "venv/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 1135, in _emit_insert_statements
    result = cached_connections[connection].execute(
  File "venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "venv/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "venv/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: pyhgnc_hgnc.identifier

[SQL: INSERT INTO pyhgnc_hgnc (name, symbol, identifier, status, uuid, orphanet, locus_group, locus_type, date_name_changed, date_modified, date_symbol_changed, date_approved_reserved, ensembl_gene, horde, vega, lncrnadb, entrez, mirbase, iuphar, ucsc, snornabase, pseudogeneorg, bioparadigmsslc, locationsortable, merops, location, cosmic, imgt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('alpha-1-B glycoprotein', 'A1BG', 5, 'Approved', '24787fd0-c018-4336-8833-eb1c27cc9727', None, 'protein-coding gene', 'gene with protein product', None, '2020-09-17', None, '1989-06-30', 'ENSG00000121410', None, 'OTTHUMG00000183507', None, '1', None, None, 'uc002qsd.5', None, None, None, '19q13.43', 'I43.950', '19q13.43', None, None)]
(Background on this error at: http://sqlalche.me/e/13/gkpj)

Update README

Put citation information, abstract, description, and example of how to use CLI and programmatic interfaces

Wrong connection

Currently it creates the tables in .pyhgnc

FIX:
config.ini modify connection string to:
[database]
sqlalchemy_connection_string = sqlite://///home.pybel/bio2bel/bio2bel.db

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.