Skip to content

Instantly share code, notes, and snippets.

@mdshw5
Created July 30, 2016 17:51
Show Gist options
  • Save mdshw5/0f8ec95238760146ab6e665543797be8 to your computer and use it in GitHub Desktop.
Save mdshw5/0f8ec95238760146ab6e665543797be8 to your computer and use it in GitHub Desktop.
biostars 204336
from pyfaidx import Fasta
with Fasta('1st.fa') as first, Fasta('2nd.fa') as second, open('result.fa', 'w') as result:
for a, b in zip(first, second):
result.write('>' + a.name)
result.write(str(a))
result.write('>' + b.name)
result.write(str(b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment