bio2bel / reactome

Integration of pathway-related information from Reactome in BEL
http://bio2bel-reactome.rtfd.io
MIT License
5 stars 1 forks source link

Failure on populate #12

Closed cthoyt closed 3 years ago

cthoyt commented 5 years ago

I ran the normal populate function and got the following error. It looks like there's a problem with type casting?

Deleting the previous instance of the database
Creating new models
2019-03-13 13:36:41,797 - bio2bel_reactome.manager - INFO - populating species
Loading species: 100%|█████████████████████████████████████████████████████████████████████████| 19/19 [00:00<00:00, 1331.01it/s]
2019-03-13 13:36:41,815 - bio2bel_reactome.manager - INFO - populating pathways
Loading pathways: 100%|███████████████████████████████████████████████████████████████████| 23621/23621 [00:25<00:00, 914.34it/s]
2019-03-13 13:37:21,498 - bio2bel_reactome.manager - INFO - populating pathway hierarchy
Loading pathway hierarchy: 100%|██████████████████████████████████████████████████████████| 23796/23796 [01:23<00:00, 285.56it/s]
2019-03-13 13:38:57,106 - bio2bel_reactome.manager - INFO - downloading proteins. This might take a couple of minutes depending on your internet connection...
2019-03-13 13:39:36,824 - bio2bel_reactome.parsers.entity_pathways - INFO - only importing human pathways
2019-03-13 13:42:07,647 - bio2bel_reactome.manager - INFO - populating protein data
Loading proteins: 100%|██████████████████████████████████████████████████████████████████| 124594/124594 [22:03<00:00, 94.12it/s]
2019-03-13 14:04:30,563 - bio2bel_reactome.manager - WARNING - missing 184 hgncs
2019-03-13 14:04:30,652 - bio2bel_reactome.manager - INFO - downloading chemicals
2019-03-13 14:04:46,368 - bio2bel_reactome.parsers.entity_pathways - INFO - only importing human pathways
2019-03-13 14:05:17,612 - bio2bel_reactome.manager - INFO - populating chemicals
Loading chemicals:   0%|                                                                               | 0/28272 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1236, in _execute_context
    cursor, statement, parameters, context
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 536, in do_execute
    cursor.execute(statement, parameters)
psycopg2.ProgrammingError: operator does not exist: character varying = integer
LINE 3: WHERE chebi_chemical.chebi_id = 10033
                                      ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

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

Traceback (most recent call last):
  File "/Users/cthoyt/dev/bio2bel/src/bio2bel/manager/abstract_manager.py", line 38, in populate_wrapped
    cls._populate_original(self, *populate_args, **populate_kwargs)
  File "/Users/cthoyt/dev/reactome/src/bio2bel_reactome/manager.py", line 653, in populate
    self._pathway_chemical(url=pathways_chemicals_path, only_human=only_human)
  File "/Users/cthoyt/dev/reactome/src/bio2bel_reactome/manager.py", line 608, in _pathway_chemical
    chebi_chemical = chebi_manager.get_chemical_by_chebi_id(chebi_id)
  File "/Users/cthoyt/dev/chebi/src/bio2bel_chebi/manager.py", line 123, in get_chemical_by_chebi_id
    chemical = self.session.query(Chemical).filter(Chemical.chebi_id == chebi_id).one_or_none()
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3008, in one_or_none
    ret = list(self)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3081, in __iter__
    return self._execute_and_instances(context)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3106, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 980, in execute
    return meth(self, multiparams, params)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 273, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1099, in _execute_clauseelement
    distilled_params,
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1240, in _execute_context
    e, statement, parameters, cursor, context
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1458, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 296, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 276, in reraise
    raise value.with_traceback(tb)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1236, in _execute_context
    cursor, statement, parameters, context
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 536, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) operator does not exist: character varying = integer
LINE 3: WHERE chebi_chemical.chebi_id = 10033
                                      ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
 [SQL: 'SELECT chebi_chemical.id AS chebi_chemical_id, chebi_chemical.chebi_id AS chebi_chemical_chebi_id, chebi_chemical.parent_id AS chebi_chemical_parent_id, chebi_chemical.name AS chebi_chemical_name, chebi_chemical.definition AS chebi_chemical_definition, chebi_chemical.source AS chebi_chemical_source, chebi_chemical.status AS chebi_chemical_status, chebi_chemical.inchi AS chebi_chemical_inchi, chebi_chemical.modified_on AS chebi_chemical_modified_on, chebi_chemical.created_by AS chebi_chemical_created_by, chebi_chemical.stars AS chebi_chemical_stars \nFROM chebi_chemical \nWHERE chebi_chemical.chebi_id = %(chebi_id_1)s'] [parameters: {'chebi_id_1': 10033}] (Background on this error at: http://sqlalche.me/e/f405)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1236, in _execute_context
    cursor, statement, parameters, context
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 536, in do_execute
    cursor.execute(statement, parameters)
psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block

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

Traceback (most recent call last):
  File "/Users/cthoyt/.virtualenvs/hbp/bin/bio2bel_reactome", line 11, in <module>
    load_entry_point('bio2bel-reactome', 'console_scripts', 'bio2bel_reactome')()
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/Users/cthoyt/dev/bio2bel/src/bio2bel/manager/abstract_manager.py", line 320, in populate
    manager.populate()
  File "/Users/cthoyt/dev/bio2bel/src/bio2bel/manager/abstract_manager.py", line 40, in populate_wrapped
    self._store_populate_failed()
  File "/Users/cthoyt/dev/bio2bel/src/bio2bel/manager/connection_manager.py", line 93, in _store_populate_failed
    Action.store_populate_failed(self.module_name, session=self.session)
  File "/Users/cthoyt/dev/bio2bel/src/bio2bel/models.py", line 95, in store_populate_failed
    _store_helper(action, session=session)
  File "/Users/cthoyt/dev/bio2bel/src/bio2bel/models.py", line 140, in _store_helper
    session.commit()
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/scoping.py", line 162, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1023, in commit
    self.transaction.commit()
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 487, in commit
    self._prepare_impl()
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 466, in _prepare_impl
    self.session.flush()
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2436, in flush
    self._flush(objects)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2574, in _flush
    transaction.rollback(_capture_exception=True)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 67, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 277, in reraise
    raise value
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2534, in _flush
    flush_context.execute()
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/unitofwork.py", line 416, in execute
    rec.execute(self)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/unitofwork.py", line 583, in execute
    uow,
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj
    insert,
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/orm/persistence.py", line 1116, in _emit_insert_statements
    statement, params
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 980, in execute
    return meth(self, multiparams, params)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 273, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1099, in _execute_clauseelement
    distilled_params,
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1240, in _execute_context
    e, statement, parameters, cursor, context
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1458, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 296, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 276, in reraise
    raise value.with_traceback(tb)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1236, in _execute_context
    cursor, statement, parameters, context
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 536, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.InternalError: (psycopg2.InternalError) current transaction is aborted, commands ignored until end of transaction block
 [SQL: 'INSERT INTO bio2bel_action (resource, action, created) VALUES (%(resource)s, %(action)s, %(created)s) RETURNING bio2bel_action.id'] [parameters: {'resource': 'reactome', 'action': 'populate_failed', 'created': datetime.datetime(2019, 3, 13, 13, 5, 17, 621607)}] (Background on this error at: http://sqlalche.me/e/2j85)