Commit 9f874f26 authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil Team

scripts/links.py: filtering ('-f') works also with sequence output ('-s')

parent f72e2af1
......@@ -9,7 +9,7 @@ parser = argparse.ArgumentParser(description='Link sequences and/or results file
parser.add_argument('--sequences', '-s', action='store_true', help='link sequence files')
parser.add_argument('--results', '-r', action='store_true', help='link results files')
parser.add_argument('--diag', '-d', action='store_true', help='link only diagnosis results (first sample per patient)')
parser.add_argument('--filter', '-f', type=str, default='', help='filter on info (%(default)s)')
parser.add_argument('--filter', '-f', type=str, default='', help='filter on info (%(default)s), only for -s or -d')
args = parser.parse_args()
our_id = 0
......@@ -19,6 +19,11 @@ if args.sequences:
print "### Sequences"
for res in db(db.patient.id == db.sequence_file.patient_id).select():
if args.filter:
if not vidjil_utils.advanced_filter([res.patient.info], args.filter):
continue
our_id += 1
print "ln -s %s/%-20s %5s.fa" % (defs.DIR_SEQUENCES, res.sequence_file.data_file, our_id),
print "\t", "# seq-%04d" % res.sequence_file.id, "%-20s" % res.sequence_file.filename,
......
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