Skip to content

Commit b15b9a8

Browse files
committed
output on convert
Former-commit-id: 5e24687487a3cbfb3238642fe80ac9e249174c61
1 parent 8622e0c commit b15b9a8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

apps/convert_fasta.py

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import os
1111
import sys
1212
import shutil
13+
import brisera
1314
import tempfile
1415

1516
from brisera.convert import FastaChunker
@@ -48,3 +49,8 @@
4849
shutil.rmtree(tempdir)
4950

5051
assert not os.path.exists(tempdir)
52+
53+
print "Processed %i sequences into %i chunks" % (chunker.sequences, chunker.chunks)
54+
print "Minimum sequence length: %i" % chunker.min_sequence_len
55+
print "Maximum sequence length: %i" % chunker.max_sequence_len
56+
print "Saved as Brisera version %s sequence format" % brisera.__version__

brisera/convert.py

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def __init__(self, path):
1414
self.min_sequence_len = None
1515
self.max_sequence_len = None
1616
self.sequences = 0
17+
self.chunks = 0
1718

1819
def chunk(self, sequence):
1920
"""
@@ -45,6 +46,7 @@ def chunk(self, sequence):
4546
end = min(offset+settings.max_chunk, length)
4647

4748
chunk = sequence[offset:end]
49+
self.chunks += 1
4850
yield (chunk, offset, end == length)
4951

5052
if end == length:

0 commit comments

Comments
 (0)