Mercurial > repos > rnateam > splitfasta
comparison splitFasta.py @ 1:87bdbac78136 draft default tip
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/splitfasta commit 31945d5d8c5ebee64ebf29c6ea022fb831f47274"
| author | rnateam |
|---|---|
| date | Mon, 21 Sep 2020 15:41:01 +0000 |
| parents | f6d6b62540f8 |
| children |
comparison
equal
deleted
inserted
replaced
| 0:f6d6b62540f8 | 1:87bdbac78136 |
|---|---|
| 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') |
