# HG changeset patch # User dfornika # Date 1583197796 0 # Node ID 386a88793078fcdcd98a2634325a8c3011230a65 # Parent 0dbaa4e6886607e0a8d2bbda02382b3055c46a92 Uploaded diff -r 0dbaa4e68866 -r 386a88793078 blast_report.py --- a/blast_report.py Tue Mar 03 01:04:15 2020 +0000 +++ b/blast_report.py Tue Mar 03 01:09:56 2020 +0000 @@ -1,8 +1,12 @@ #!/usr/bin/env python + +from __future__ import print_function + '''Report on BLAST results. python blast_report.py input_tab cheetah_tmpl output_html output_tab [-f [filter_pident]:[filterkw1,...,filterkwN]] [-b bin1_label=bin1_path[,...binN_label=binN_path]] ''' + import argparse import re import sys @@ -72,15 +76,14 @@ parser = argparse.ArgumentParser() parser.add_argument('-f', '--filter', - type='string', dest='filter', ) parser.add_argument('-b', '--bins', - type='string', dest='bins' ) -parser.add_argument('-r', '--redundant', - dest='redundant', +parser.add_argument('-r', '--discard-redundant', + dest='discard_redundant', + type=bool, default=False, action='store_true' ) @@ -108,7 +111,7 @@ filter_kws = pident_kws[-1].split(',') print('filter_pident: %s filter_kws: %s' % (str(filter_pident), str(filter_kws))) -if args.redundant: +if args.discard_redundant: print('Throwing out redundant hits...') #RESULTS! @@ -134,7 +137,7 @@ stop_err("Problem with splitting:" + cols[SUBJ_ID_COL]) #hsp option: keep best (first) hit only for each query and accession id. - if args.redundant: + if args.discard_redundant: if accs[0] in queries[-1].match_accessions: continue #don't save the result and skip to the next else: