Mercurial > repos > dfornika > blast_report_basic
comparison blast_report.py @ 23:8d92b3b58f5e draft
Uploaded
| author | dfornika |
|---|---|
| date | Tue, 03 Mar 2020 09:30:07 +0000 |
| parents | 9cf35f30bfb4 |
| children | e2cab62e1943 |
comparison
equal
deleted
inserted
replaced
| 22:261235bbd475 | 23:8d92b3b58f5e |
|---|---|
| 2 | 2 |
| 3 from __future__ import print_function | 3 from __future__ import print_function |
| 4 | 4 |
| 5 '''Report on BLAST results. | 5 '''Report on BLAST results. |
| 6 | 6 |
| 7 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]] | 7 python blast_report.py input_tab cheetah_tmpl output_html output_tab [-i [min_identity]] [-f filterkw1,...,filterkwN]] [-b bin1_label=bin1_path[,...binN_label=binN_path]] |
| 8 ''' | 8 ''' |
| 9 | 9 |
| 10 import argparse | 10 import argparse |
| 11 import re | 11 import re |
| 12 import sys | 12 import sys |
| 13 | 13 |
| 14 from Cheetah.Template import Template | 14 from Cheetah.Template import Template |
| 15 | 15 from pprint import pprint |
| 16 | 16 |
| 17 def stop_err( msg ): | 17 def stop_err( msg ): |
| 18 sys.stderr.write("%s\n" % msg) | 18 sys.stderr.write("%s\n" % msg) |
| 19 sys.exit(1) | 19 sys.exit(1) |
| 20 | 20 |
| 79 ) | 79 ) |
| 80 parser.add_argument('-i', '--min-identity', | 80 parser.add_argument('-i', '--min-identity', |
| 81 dest='min_identity', | 81 dest='min_identity', |
| 82 ) | 82 ) |
| 83 parser.add_argument('-b', '--bins', | 83 parser.add_argument('-b', '--bins', |
| 84 dest='bins' | 84 dest='bins', |
| 85 action='append', | |
| 86 nargs='+' | |
| 85 ) | 87 ) |
| 86 parser.add_argument('-r', '--discard-redundant', | 88 parser.add_argument('-r', '--discard-redundant', |
| 87 dest='discard_redundant', | 89 dest='discard_redundant', |
| 88 default=False, | 90 default=False, |
| 89 action='store_true' | 91 action='store_true' |
| 90 ) | 92 ) |
| 91 parser.add_argument('input_tab') | 93 parser.add_argument('input_tab') |
| 92 parser.add_argument('cheetah_tmpl') | 94 parser.add_argument('cheetah_tmpl') |
| 93 parser.add_argument('output_html') | 95 parser.add_argument('output_html') |
| 94 parser.add_argument('output_tab') | 96 parser.add_argument('output_tab') |
| 97 | |
| 95 args = parser.parse_args() | 98 args = parser.parse_args() |
| 99 | |
| 100 pprint(bins) | |
| 96 | 101 |
| 97 print('input_tab: %s cheetah_tmpl: %s output_html: %s output_tab: %s' % (args.input_tab, args.cheetah_tmpl, args.output_html, args.output_tab)) | 102 print('input_tab: %s cheetah_tmpl: %s output_html: %s output_tab: %s' % (args.input_tab, args.cheetah_tmpl, args.output_html, args.output_tab)) |
| 98 | 103 |
| 99 | 104 |
| 100 #BINS | 105 #BINS |
