Created
October 28, 2013 19:04
-
-
Save cfriedline/7202638 to your computer and use it in GitHub Desktop.
diginorm decorator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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