Skip to content

Instantly share code, notes, and snippets.

@meren
Created February 21, 2014 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meren/9137920 to your computer and use it in GitHub Desktop.
Save meren/9137920 to your computer and use it in GitHub Desktop.
import sys
import Oligotyping.lib.fastalib as u
fasta = u.SequenceSource(sys.argv[1])
output = u.FastaOutput(sys.argv[2])
while fasta.next():
if fasta.pos % 10000 == 0:
sys.stdout.write('\rreads processed so far: %d' % (fasta.pos))
sys.stdout.flush()
output.write_id(fasta.id)
output.write_seq(fasta.seq.replace('-', ''), split = False)
fasta.close()
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment