Created
September 22, 2013 15:00
-
-
Save informationsea/6660770 to your computer and use it in GitHub Desktop.
Re-format FASTA file.
This file contains hidden or 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
#!/usr/bin/env python | |
import argparse | |
import sys | |
import Bio.SeqIO | |
def _main(): | |
parser = argparse.ArgumentParser(description="Re-format fasta file") | |
parser.add_argument('input', default=sys.stdin, nargs='?') | |
parser.add_argument('output', default=sys.stdout, nargs='?') | |
options = parser.parse_args() | |
for record in Bio.SeqIO.parse(options.input, 'fasta'): | |
Bio.SeqIO.write(record, options.output, 'fasta') | |
if __name__ == '__main__': | |
_main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment