Expose the statements submodule #213
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_typeis insideindra_db.client.statements. This PR also puts some more stuff into the .gitignore so any packaging artifacts don't accidentally get committed.