Skip to content

Commit

Permalink
Change --machine-readable-info to --summary-info
Browse files Browse the repository at this point in the history
This changes the overly long flag we added in PR #649 to be a little
shorter.
  • Loading branch information
kdm9 committed Nov 20, 2014
1 parent 455c856 commit c35f13e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions scripts/load-into-counting.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def get_parser():
parser.add_argument('-b', '--no-bigcount', dest='bigcount', default=True,
action='store_false',
help='Do not count k-mers past 255')
parser.add_argument('--machine-readable-info', '-m', default=None,
metavar="FORMAT", choices=['json', 'tsv'],
parser.add_argument('--summary-info', '-s', default=None, metavar="FORMAT",
choices=['json', 'tsv'],
help="What format should the machine readable run "
"summary be in? (json or tsv, disabled by default)")
parser.add_argument('--report-total-kmers', '-t', action='store_true',
Expand Down Expand Up @@ -137,10 +137,10 @@ def main():
print >> sys.stderr, "Writing run information to", base + '.info'
print >> info_fp, 'fp rate estimated to be %1.3f\n' % fp_rate

if args.machine_readable_info:
mr_fmt = args.machine_readable_info.lower()
if args.summary_info:
mr_fmt = args.summary_info.lower()
mr_file = base + '.info.' + mr_fmt
print >> sys.stderr, "Writing machine-readable stats to", mr_file
print >> sys.stderr, "Writing summmary info to", mr_file
with open(mr_file, 'w') as mr_fh:
if mr_fmt == 'json':
mr_data = {
Expand Down
8 changes: 4 additions & 4 deletions tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_load_into_counting_fail():

def test_load_into_counting_tsv():
script = scriptpath('load-into-counting.py')
args = ['-x', '1e7', '-N', '2', '-k', '20', '-t', '-m', 'tsv']
args = ['-x', '1e7', '-N', '2', '-k', '20', '-t', '-s', 'tsv']

outfile = utils.get_temp_filename('out.kh')
tabfile = outfile + '.info.tsv'
Expand All @@ -91,7 +91,7 @@ def test_load_into_counting_tsv():

def test_load_into_counting_json():
script = scriptpath('load-into-counting.py')
args = ['-x', '1e7', '-N', '2', '-k', '20', '-t', '-m', 'json']
args = ['-x', '1e7', '-N', '2', '-k', '20', '-t', '-s', 'json']

outfile = utils.get_temp_filename('out.kh')
jsonfile = outfile + '.info.json'
Expand All @@ -118,9 +118,9 @@ def test_load_into_counting_json():
assert got_json == expected_json, got_json


def test_load_into_counting_bad_machine_readable_fmt():
def test_load_into_counting_bad_summary_fmt():
script = scriptpath('load-into-counting.py')
args = ['-x', '1e7', '-N', '2', '-k', '20', '-m', 'badfmt']
args = ['-x', '1e7', '-N', '2', '-k', '20', '-s', 'badfmt']

outfile = utils.get_temp_filename('out.kh')
infile = utils.get_test_data('test-abund-read-2.fa')
Expand Down

0 comments on commit c35f13e

Please sign in to comment.