Skip to content

Instantly share code, notes, and snippets.

@cfriedline
Created October 28, 2013 19:04
Show Gist options
  • Save cfriedline/7202638 to your computer and use it in GitHub Desktop.
Save cfriedline/7202638 to your computer and use it in GitHub Desktop.
diginorm decorator
def run_diginorm_renamer(args):
from Bio.SeqIO.QualityIO import FastqGeneralIterator
infile, outfile = args
with open(outfile, "w") as o:
for i, (name, seq, qual) in enumerate(FastqGeneralIterator(open(infile))):
add = 1
if i % 2 != 0:
add = 2
o.write("@%s_%d\n%s\n+\n%s\n" % (name, add, seq, qual))
if i % 100000 == 0:
print "at %d" % i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment