Skip to content

Commit

Permalink
Sort annotations (lexicographical) and common genes (by OGI) for dete…
Browse files Browse the repository at this point in the history
…rministic display
  • Loading branch information
memgonzales committed Sep 14, 2023
1 parent c961438 commit 5d8776c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions callbacks/lift_over/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ def get_qtaro_entry(mapping, gene):
try:
qtaro_str = '<ul style="margin-bottom: 0; padding: 0;">'
pub_idx = 1
for character_major in mapping[gene]:
for character_major in sorted(mapping[gene]):
qtaro_str += '<li>' + character_major + '<ul>'
for character_minor in mapping[gene][character_major]:
for character_minor in sorted(mapping[gene][character_major]):
pubs = []
for pub in mapping[gene][character_major][character_minor]:
pubs.append(
Expand Down Expand Up @@ -333,7 +333,7 @@ def get_pubmed_entries(genes):
def get_interpro_entry(gene, interpro_mapping, iric_mapping):
try:
return '<br><br>'.join([get_interpro_link_single_str(entry[1], entry[0])
for entry in interpro_mapping[iric_mapping[gene]] if entry[1]])
for entry in sorted(interpro_mapping[iric_mapping[gene]]) if entry[1]])
except KeyError:
return NULL_PLACEHOLDER

Expand Down Expand Up @@ -525,6 +525,7 @@ def get_common_genes(refs, genomic_intervals):
mask &= (all_genes[ref] != NULL_PLACEHOLDER)

common_genes = all_genes.loc[mask]
common_genes = common_genes.sort_values('OGI')

return common_genes

Expand Down

0 comments on commit 5d8776c

Please sign in to comment.