Last active
February 20, 2016 12:39
-
-
Save mdshw5/1c024b5c73b1e5ff9275 to your computer and use it in GitHub Desktop.
biostars 177781
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
import pyfaidx | |
with pyfaidx.Fasta("file.fa") as peg_fasta: | |
with open("file.sorted.fa", 'w') as sorted_fasta: | |
for id in sorted(peg_fasta.keys()): | |
sorted_fasta.write('>' + peg_fasta[id].long_name) | |
sorted_fasta.write(str(peg_fasta[id])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment