Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed resource descriptor lookup bug. AGR-2394. #545

Merged
merged 4 commits into from Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/etl/helpers/resource_descriptor_helper_2.py
Expand Up @@ -121,7 +121,7 @@ def _get_alt_keys(self):
"""Get alternative keys for species.

These are stored in the resourceDescriptor.yaml file under
aliases. The keys for this are not used/stired but are here for reference
aliases. The keys for this are not used/stored but are here for reference
or may be used at a later point.
"""
url = 'https://raw.githubusercontent.com/alliance-genome/agr_schemas/master/ingest/species/species.yaml'
Expand Down Expand Up @@ -336,6 +336,7 @@ def return_url_from_identifier(self, identifier, page=None):
self.logger.critical('Database prefix: %s', db_prefix)
self.logger.critical('Identifier: %s', identifier_post_processed)
self.logger.critical('gid pattern: %s', gid_pattern)
self.logger.critical('page: %s', page)
self.bad_regex[key] = 1
else:
self.bad_regex[key] += 1
Expand Down
13 changes: 6 additions & 7 deletions src/etl/molecular_interaction_etl.py
Expand Up @@ -225,7 +225,7 @@ def process_interaction_identifier(self, entry, additional_row):
entries = [entry]

for individual in entries:

"""These links are for the individual interaction identifiers and link to the respective database."""
xref_dict = {}
page = 'gene/interactions'

Expand Down Expand Up @@ -256,13 +256,10 @@ def process_interaction_identifier(self, entry, additional_row):
# TODO Optimize and re-add this error tracking.
if not individual.startswith(tuple(ignored_identifier_database_list)):
try:
individual_url = self.etlh.rdh2.return_url_from_identifier(individual, page)
individual_url = self.etlh.rdh2.return_url_from_key_value(individual_prefix, individual_body, page)
xref_dict['crossRefCompleteUrl'] = individual_url
# self.successful_database_linkouts.add(individual_prefix)
except KeyError:
pass
# self.missed_database_linkouts.add(individual_prefix)
# else: self.ignored_database_linkouts.add(individual_prefix)

xref_dict['uuid'] = str(uuid.uuid4())
xref_dict['globalCrossRefId'] = individual
Expand All @@ -283,7 +280,9 @@ def process_interaction_identifier(self, entry, additional_row):
return xref_main_list

def add_mod_interaction_links(self, gene_id):
"""Create an XREF linking back to interaction pages at each MOD for a particular gene."""
"""Create an XREF linking back to interaction pages at each MOD for a particular gene.
These links appear at the top of the molecular interactions table once per gene page.
"""
xref_dict = {}
page = 'gene/MODinteractions'

Expand Down Expand Up @@ -318,7 +317,7 @@ def add_mod_interaction_links(self, gene_id):
return xref_dict

def resolve_identifiers_by_row(self, row, master_gene_set, master_crossreference_dictionary):
"""Resolve Iedntifiers by Row."""
"""Resolve Identifiers by Row."""
interactor_a_rows = [0, 2, 4, 22]
interactor_b_rows = [1, 3, 5, 23]

Expand Down