In [ ]:
from glob import glob
from os import path
from skbio import TreeNode, DistanceMatrix, TabularMSA, DNA

from kwipexpt import *

In [ ]:
alns = glob('data/*/all_genomes-*.fasta.gz')

In [ ]:
def alndist_namer(alnpath):
    for ext in ['.gz', '.fasta']:
        if alnpath.endswith(ext):
            alnpath = alnpath[:-len(ext)]
    alnpath += '.dist'
    return alnpath

In [ ]:
for aln in alns:
    dm = aln_distmat(aln)
    dm.write(alndist_namermer(aln))
    print(aln)

In [ ]: