Skip to content

Commit 83dd9ee

Browse files
committed
added proper tagset-building flag
1 parent 5f23c84 commit 83dd9ee

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

scripts/load-graph.py

+18-6
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
def main():
2121
parser = build_construct_args()
22-
parser.add_argument('--build-tagset', '-t', default=True,
23-
action='store_false',
24-
help='Construct tagset while loading sequences')
22+
parser.add_argument('--no-build-tagset', '-n', default=False,
23+
action='store_true', dest='no_build_tagset',
24+
help='Do NOT construct tagset while loading sequences')
2525
parser.add_argument('output_filename')
2626
parser.add_argument('input_filenames', nargs='+')
2727

@@ -48,6 +48,10 @@ def main():
4848

4949
print 'Saving hashtable to %s' % base
5050
print 'Loading kmers from sequences in %s' % repr(filenames)
51+
if args.no_build_tagset:
52+
print 'We WILL NOT build the tagset.'
53+
else:
54+
print 'We WILL build the tagset (for partitioning/traversal).'
5155

5256
###
5357

@@ -56,12 +60,20 @@ def main():
5660

5761
for n, filename in enumerate(filenames):
5862
print 'consuming input', filename
59-
ht.consume_fasta_and_tag(filename)
63+
if args.no_build_tagset:
64+
ht.consume_fasta(filename)
65+
else:
66+
ht.consume_fasta_and_tag(filename)
6067

6168
print 'saving hashtable in', base + '.ht'
6269
ht.save(base + '.ht')
63-
print 'saving tagset in', base + '.tagset'
64-
ht.save_tagset(base + '.tagset')
70+
71+
if not args.no_build_tagset:
72+
print 'saving tagset in', base + '.tagset'
73+
ht.save_tagset(base + '.tagset')
74+
75+
info_fp = open(base + '.info', 'w')
76+
info_fp.write('%d unique k-mers' % ht.n_unique_kmers())
6577

6678
fp_rate = khmer.calc_expected_collisions(ht)
6779
print 'fp rate estimated to be %1.3f' % fp_rate

0 commit comments

Comments
 (0)