Skip to content

Instantly share code, notes, and snippets.

@nickloman
Created September 8, 2010 09:16
Show Gist options
  • Save nickloman/569878 to your computer and use it in GitHub Desktop.
Save nickloman/569878 to your computer and use it in GitHub Desktop.
from Bio import SeqIO
import sys
seq_number = 1
for rec in SeqIO.parse(open(sys.argv[1]), "fasta"):
cols = rec.name.split("_")
count = int(cols[3])
for n in xrange(count):
print ">%s_%s_%s read%s" % (cols[0], cols[1], seq_number, seq_number)
print rec.seq.tostring()
seq_number += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment