Created
July 16, 2010 05:27
-
-
Save brentp/477969 to your computer and use it in GitHub Desktop.
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
""" | |
%prog some.fasta wanted-list.txt | |
""" | |
from Bio import SeqIO | |
import sys | |
wanted = [line.strip() for line in open(sys.argv[2])] | |
seqiter = SeqIO.parse(open(sys.argv[1]), 'fasta') | |
SeqIO.write((seq for seq in seqiter if seq.id in wanted), sys.stdout, "fasta") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried changing the sys.stout to an output file name with no luck instead receiving the error that the file name was undefined, is there any possible way to fix this?
Yet if I leave as sys.stdout I am not receiving an output.