Skip to content

Instantly share code, notes, and snippets.

@mdshw5
Created January 14, 2016 03:07
Show Gist options
  • Save mdshw5/c825d5b23aea777df9ba to your computer and use it in GitHub Desktop.
Save mdshw5/c825d5b23aea777df9ba to your computer and use it in GitHub Desktop.
biostars 172641
from pyfaidx import Fasta
genes = Fasta('Genome.fasta')
with open('chr02_18s', 'w') as f:
seqFile = genes['chr02'][146062:148216]
f.write('>' + seqFile.name)
f.write(seqFile.seq) # or str(seqFile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment