Skip to content

Instantly share code, notes, and snippets.

@mdshw5
Last active July 14, 2017 17:48
Show Gist options
  • Save mdshw5/b2073cf96f7ef2e54ef3f09495d37f82 to your computer and use it in GitHub Desktop.
Save mdshw5/b2073cf96f7ef2e54ef3f09495d37f82 to your computer and use it in GitHub Desktop.
biostars 262660
from pyfaidx import Fasta
with Fasta("file_2.fasta") as records:
with open("file_1") as content:
for line in content:
_, ec, filename = line.rstrip().split()
with open(filename, "w") as out_file:
for record in records:
if ec in record.name:
out_file.write(repr(record))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment