From b4c1e8a7914475860dd03060cafb00ea0c9fd62c Mon Sep 17 00:00:00 2001 From: cat-bro Date: Thu, 13 Jun 2024 10:43:26 +1000 Subject: [PATCH] fgenesh toolbox filter --- .../galaxy/toolbox/filters/ga_filters.py.j2 | 41 ++++++------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/templates/galaxy/toolbox/filters/ga_filters.py.j2 b/templates/galaxy/toolbox/filters/ga_filters.py.j2 index 2352f0ddc..69736ac68 100644 --- a/templates/galaxy/toolbox/filters/ga_filters.py.j2 +++ b/templates/galaxy/toolbox/filters/ga_filters.py.j2 @@ -6,34 +6,6 @@ test_tools = [ 'id': 'maxquant_test', 'role': 'maxquant_test', }, - { - 'id': 'fgenesh', - 'role': 'Fgenesh', - }, - { - 'id': 'fgenesh_annotate', - 'role': 'Fgenesh', - }, - { - 'id': 'fgenesh_get_mrnas_gc', - 'role': 'Fgenesh', - }, - { - 'id': 'fgenesh_merge', - 'role': 'Fgenesh', - }, - { - 'id': 'fgenesh_split', - 'role': 'Fgenesh', - }, - { - 'id': 'fgenesh_to_genbank', - 'role': 'Fgenesh', - }, - { - 'id': 'fgenesh_get_proteins', - 'role': 'Fgenesh', - }, { 'id': 'cellranger', 'role': 'cellranger', @@ -56,6 +28,19 @@ def hide_test_tools(context, tool): return user is not None and user.email in test_tool_users return True +def hide_fgenesh(context, tool): + """ + make fgenesh* visible to members of Fgenesh group + """ + if tool.id.startswith('fgenesh'): + user = context.trans.user + return user is not None and ( + user.email in test_tool_users or 'Fgenesh' in [ + r.name for r in user.all_roles() if not r.deleted + ] + ) + return True + def restrict_alphafold(context, tool): """ Only let GA team, alphafold beta users and UoM vet school alphafold users see alphafold