#81 moved gene set check into fileitem_source

This commit is contained in:
Alok Saldanha
2023-07-06 08:18:50 -06:00
parent 81c8ce4219
commit 5a650334df
3 changed files with 9 additions and 10 deletions
+2 -10
View File
@@ -20,23 +20,15 @@ def render_annotations(item, item_source):
item_source.get_annotations_subpath(item), item_source.name
)
new_annotation = f"<a class='new' href='{url}'>new</a>"
non_gene_set_files = []
if item.annotations is not None:
# Do not also display files to store gene_sets. These should be loaded
# by clicking on the associated annotations file (i.e. without the
# appended "_gene_sets")
for a in item.annotations:
if (len(a.name) < 10) or (a.name[-10:] != "_gene_sets"):
non_gene_set_files.append(a)
annotations = (
", ".join(
[
f"<a href='{CacheKey(item, item_source, a).view_url}/'>{a.name}</a>"
for a in non_gene_set_files
for a in item.annotations
]
)
+ ", "
if non_gene_set_files
if item.annotations
else ""
)
return " | annotations: " + annotations + new_annotation