Created
July 30, 2013 13:55
-
-
Save johnstantongeddes/6113112 to your computer and use it in GitHub Desktop.
Python script to add Illumina 1.3 format fastq paired read tags '\1' and '\2' for forward and reverse reads, respectively, to an interleaved Illumina 1.8 format fastq file. Modified from [/khmer/sandbox/interleave.py](https://github.com/ged-lab/khmer/blob/master/sandbox/interleave.py)
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
#! /usr/bin/env python | |
import screed, sys, itertools | |
s1_file = sys.argv[1] | |
s2_file = sys.argv[2] | |
for r1, r2 in itertools.izip(screed.open(s1_file), screed.open(s2_file)): | |
name1 = r1.name | |
if not name1.endswith('/1'): | |
name1 += '/1' | |
name2 = r2.name | |
if not name2.endswith('/2'): | |
name2 += '/2' | |
print '@%s\n%s\n+\n%s\n@%s\n%s\n+\n%s' % (name1, | |
r1.sequence, | |
r1.accuracy, | |
name2, | |
r2.sequence, | |
r2.accuracy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment