Mercurial > repos > rnateam > splitfasta
view 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 |
line wrap: on
line source
#!/usr/bin/env python import os import sys from Bio import SeqIO if __name__ == "__main__": inpath = sys.argv[1] os.mkdir('splits') with open(inpath, 'r') as handle: for record in SeqIO.parse(handle, 'fasta'): header = os.path.join('splits', record.id + '.fasta') with open(header, 'w') as handle2: SeqIO.write([record], handle2, 'fasta')