#!/usr/bin/env python """ fasta2nexus.py Author: Tony Papenfuss Date: Wed May 9 17:23:18 EST 2007 """ import os, sys from mungo.align import Alignment aln = Alignment.load(sys.argv[1], format='fasta') aln.save(sys.argv[2], format='nexus')
#!/usr/bin/env python """ clustal2nexus.py <input file> <output file> """ import sys from optparse import OptionParser from mungo.align import Alignment usage = "%prog [options] <input file> <output file>" parser = OptionParser(usage=usage) options, args = parser.parse_args(sys.argv) if len(args) != 3: sys.exit(__doc__) aln = Alignment.load(args[1], format='clustal') aln.save(args[2], format='nexus')
#!/usr/bin/env python """ fasta2clustal.py <input filename> <output filename> Author: Tony Papenfuss Date: Thu Jun 7 17:58:39 EST 2007 """ import os, sys from optparse import OptionParser from mungo.align import Alignment usage = "%prog [options] <input file> <output file>" parser = OptionParser(usage=usage) options, args = parser.parse_args(sys.argv) if len(args) != 3: sys.exit(__doc__) iFilename = args[1] oFilename = args[2] alignment = Alignment.load(iFilename, format="fasta") alignment.save(oFilename, format="clustal")
#!/usr/bin/env python """ clustal2phylip.py [-w width] <input filename> <output filename> Author: Tony Papenfuss Date: Mon Jan 8 11:44:37 EST 2007 """ import os, sys from optparse import OptionParser from mungo.align import Alignment usage = "%prog [-w width] <input file> <output file>" parser = OptionParser(usage=usage) parser.add_option('-w', '--width', dest='width', action='store', type='int', default=10, help='Name field width') options, args = parser.parse_args(sys.argv) iFilename = args[1] oFilename = args[2] alignment = Alignment.loadClustal(iFilename) alignment.save(oFilename, format='phylip', width=options.width)
#!/usr/bin/env python """ fasta2clustal.py <input filename> <output filename> Author: Tony Papenfuss Date: Thu Jun 7 17:58:39 EST 2007 """ import os, sys from optparse import OptionParser from mungo.align import Alignment usage = "%prog [options] <input file> <output file>" parser = OptionParser(usage=usage) options, args = parser.parse_args(sys.argv) if len(args) != 3: sys.exit(__doc__) iFilename = args[1] oFilename = args[2] alignment = Alignment.load(iFilename, format='fasta') alignment.save(oFilename, format='clustal')
#!/usr/bin/env python """ stockholm2fasta.py <stockholm filename> <fasta filename> Author: Tony Papenfuss Date: Sun May 6 13:34 EST 2007 """ import os, sys from mungo.align import Alignment iFilename = sys.argv[1] oFilename = sys.argv[2] alignment = Alignment.loadStockholm(iFilename) for name in alignment: alignment[name] = alignment[name].replace('.', '-') alignment.saveFasta(oFilename)
#!/usr/bin/env python """ clustal2molphy.py Author: Tony Papenfuss Date: Mon Mar 19 16:56:44 EST 2007 """ import os, sys from mungo.align import Alignment alignment = Alignment.loadClustal(sys.argv[1]) alignment.saveMolphy(sys.argv[2])
#!/usr/bin/env python """ clustal2noninterleaved.py <input file> <output file> Author: Tony Papenfuss Date: Fri May 11 23:33:06 EST 2007 """ import os, sys from optparse import OptionParser from mungo.align import Alignment usage = "%prog [options] <input file> <output file>" parser = OptionParser(usage=usage) options, args = parser.parse_args(sys.argv) if len(args) != 3: sys.exit(__doc__) aln = Alignment.loadClustal(args[1]) aln.saveClustal(args[2], interleaved=False)
#!/usr/bin/env python """ clustal2phylip.py <input filename> <output filename> Author: Tony Papenfuss Date: Mon Jan 8 11:44:37 EST 2007 """ import os, sys from optparse import OptionParser from mungo.align import Alignment usage = "%prog [options] <input file> <output file>" parser = OptionParser(usage=usage) options, args = parser.parse_args(sys.argv) if len(args)!=3: sys.exit(__doc__) iFilename = args[1] oFilename = args[2] alignment = Alignment.load(iFilename, format='fasta') alignment.save(oFilename, format='phylip')
#!/usr/bin/env python """ clustal2fasta.py <input file> <output file> """ import sys from optparse import OptionParser from mungo.align import Alignment from mungo.fasta import FastaWriter usage = "%prog [options] <input file> <output file>" parser = OptionParser(usage=usage) options, args = parser.parse_args(sys.argv) if len(args) != 3: sys.exit(__doc__) aln = Alignment.loadClustal(args[1]) writer = FastaWriter(args[2]) for name in aln: writer.write(name, aln[name]) writer.close()
#!/usr/bin/env python """ stockholm2clustal.py <stockholm filename> <clustal filename> Author: Tony Papenfuss Date: Sun May 6 13:34 EST 2007 """ import os, sys from mungo.align import Alignment iFilename = sys.argv[1] oFilename = sys.argv[2] alignment = Alignment.loadStockholm(iFilename) for name in alignment: alignment[name] = alignment[name].replace(".", "-") alignment.saveClustal(oFilename)
#!/usr/bin/env python """ clustal2nexus.py <input file> <output file> """ import sys from optparse import OptionParser from mungo.align import Alignment usage = "%prog [options] <input file> <output file>" parser = OptionParser(usage=usage) options, args = parser.parse_args(sys.argv) if len(args)!=3: sys.exit(__doc__) aln = Alignment.load(args[1], format='clustal') aln.save(args[2], format='nexus')