Created
September 7, 2011 16:29
-
-
Save peterjc/1201033 to your computer and use it in GitHub Desktop.
Selecting FASTQ sequences by ID (Biopython with strings)
This file contains 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
from Bio.SeqIO.QualityIO import FastqGeneralIterator | |
import sys | |
ids = set(x[:-1] for x in open(sys.argv[1])) | |
for title, seq, quals in FastqGeneralIterator(sys.stdin): | |
if title.split(None,1)[0] in ids: | |
print "@%s\n%s\n+\n%s\n" % (title, seq, quals) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment