Skip to content

Conversation

@cthoyt
Copy link
Contributor

@cthoyt cthoyt commented Mar 30, 2022

EMMAA is trying to import this and can't because there's a missing mid-level import

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [8], in <module>
----> 1 gene_prior.make_config()

File ~/dev/emmaa/emmaa/priors/gene_list_prior.py:69, in GeneListPrior.make_config(self)
     67     self.make_search_terms()
     68 if not self.stmts:
---> 69     self.make_gene_statements()
     70 config = dict()
     71 config['name'] = self.name

File ~/dev/emmaa/emmaa/priors/gene_list_prior.py:59, in GeneListPrior.make_gene_statements(self)
     56 """Generate Statements from the gene list."""
     57 drug_names = [st.name for st in self.search_terms if
     58               st.type == 'drug']
---> 59 indra_stmts = get_stmts_for_gene_list(self.gene_list, drug_names)
     60 estmts = [EmmaaStatement(stmt, datetime.datetime.now(), [])
     61           for stmt in indra_stmts]
     62 self.stmts = estmts

File ~/dev/emmaa/emmaa/priors/prior_stmts.py:45, in get_stmts_for_gene_list(gene_list, other_entities)
     43 for gene in gene_list:
     44     logger.info(f'Querying {gene}')
---> 45     st = get_stmts_for_gene(gene)
     46     logger.info(f'Got {len(st)} statements for {gene}')
     47     stmts += st

File ~/dev/emmaa/emmaa/priors/prior_stmts.py:22, in get_stmts_for_gene(gene)
      9 def get_stmts_for_gene(gene):
     10     """Return all existing Statements for a given gene from the DB.
     11 
     12     Parameters
   (...)
     20         A list of INDRA Statements in which the given gene is involved.
     21     """
---> 22     return client.get_statements_by_gene_role_type(gene, preassembled=False,
     23                                                    count=100000)

AttributeError: module 'indra_db.client' has no attribute 'get_statements_by_gene_role_type'

This PR fixes it since the get_statements_by_gene_role_type is inside indra_db.client.statements. This PR also puts some more stuff into the .gitignore so any packaging artifacts don't accidentally get committed.

@cthoyt cthoyt requested a review from bgyori March 30, 2022 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants