Commit 259aaee4 authored by Mikaël Salson's avatar Mikaël Salson Launch grep clones just once

With clonedb#4 we can now launch grep clones just once with several sequences.
parent f8986338
......@@ -38,9 +38,9 @@ def search_clonedb(sequences, sample_set_id):
parent_group = get_default_creation_group(auth)[1]
auth.load_permissions(, 'sample_set')
auth.load_permissions(PermissionEnum.anon.value, 'sample_set')
for sequence in sequences:
options = clonedb.build_grep_clones_options({'sequence': sequence+' -sample_set:%d' % sample_set_id,
options = clonedb.build_grep_clones_options({'sequence': sequences[0]+' -sample_set:%d' % sample_set_id,
'index': 'clonedb_{}'.format(parent_group)})
options += sequences[1:]
args = grep_clones.parser.parse_args(options)
occurrences = grep_clones.launch_search(args)
......@@ -48,7 +48,6 @@ def search_clonedb(sequences, sample_set_id):
return error_message('Are you sure your account has an enabled CloneDB?')
except Exception as e:
return error_message(e.message)
for occ in occurrences:
if 'tags' in occ and 'sample_set' in occ['tags']:
info = get_info_of_viewable_sample_set([int(sample_id) for sample_id in occ['tags']['sample_set']], int(occ['tags']['config_id'][0]))
occ['tags']['sample_set_viewable'] = info['viewable']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment