Mercurial > repos > rnateam > splitfasta
comparison splitFasta.py @ 0:f6d6b62540f8 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/splitfasta commit 03f3cc2000e6ce876a3cb44c55c3fe878a2e7ce3-dirty
author | rnateam |
---|---|
date | Fri, 16 Oct 2015 16:13:08 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f6d6b62540f8 |
---|---|
1 #!/usr/bin/env python | |
2 import os | |
3 import sys | |
4 from Bio import SeqIO | |
5 | |
6 if __name__ == "__main__": | |
7 inpath = sys.argv[1] | |
8 os.mkdir('splits') | |
9 with open(inpath, 'r') as handle: | |
10 for record in SeqIO.parse(handle, 'fasta'): | |
11 header = os.path.join('splits', record.id + '.fasta') | |
12 with open(header, 'w') as handle2: | |
13 SeqIO.write([record], handle2, 'fasta') |