Last active
May 4, 2017 19:44
-
-
Save macmanes/2a847c8850d28cf3f50abd89a0fb9d24 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
from Bio import SeqIO | |
import sys | |
##python filter.py file.fasta names.list | tee -a output.fasta | |
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