# Path: alfpy/wmetric.py
# def count_seq_chars(seq, alphabet):
# def freq_seq_chars(counts):
# def freq_seqs_chars(seq_records, alphabet):
#     def __init__(self, seq_records, matrix):
#     def pairwise_distance(self, seqnum1, seqnum2):
# def main():
# class Distance:
# 
# Path: alfpy/utils/distmatrix.py
# def create(id_list, distance):
# def read_highcharts_matrix(id_list, data):
#     def __init__(self, id_list, data):
#     def normalize(self):
#     def __iter__(self):
#     def writer(self, handle, f, decimal_places):
#     def display(self, f="phylip", decimal_places=7):
#     def write_to_file(self, handle, f="phylip", decimal_places=7):
#     def highcharts(self):
#     def format(self, decimal_places=7):
#     def min(self):
#     def max(self):
#     def is_zero(self):
#     def __repr__(self):
# class Matrix():
# 
# Path: alfpy/utils/data/subsmat.py
# class SubsMat:
#     def __init__(self, name, data, alphabet_list):
# def get_alphabet_list(name):
# def get(name):
# def list_subsmats():
# def main():


import unittest
from alfpy import wmetric
from alfpy.utils import distmatrix
from alfpy.utils.data import subsmat
from . import utils
        self.assertEqual(l, expl)

    def test_freq_seq_chars(self):
        seq = 'MKSTGWXXXXXXXOOOOOOOHFSG'
        l = wmetric.count_seq_chars(seq, utils.ALPHABET_PEP)
        freq = wmetric.freq_seq_chars(l)
        expfreq = [0.0, 0.0, 0.0, 0.0, 0.1, 0.2, 0.1, 0.0, 0.1, 0.0,
                   0.1, 0.0, 0.0, 0.0, 0.2, 0.1, 0.0, 0.1, 0.0, 0.0]
        self.assertEqual(freq, expfreq)


class DistanceTest(unittest.TestCase, utils.ModulesCommonTest):

    def __init__(self, *args, **kwargs):
        super(DistanceTest, self).__init__(*args, **kwargs)
        utils.ModulesCommonTest.set_test_data()

    def test_wmetric_blosum62(self):
        # The result of this method is identical to that from decaf+py.
        matrix = subsmat.get('blosum62')
        dist = wmetric.Distance(self.pep_records, matrix)
        matrix = distmatrix.create(self.pep_records.id_list, dist)
        data = ['   4',
                'seq1       0.0000000 0.0392559 0.0783026 0.1261381',
                'seq2       0.0392559 0.0000000 0.0377364 0.1166475',
                'seq3       0.0783026 0.0377364 0.0000000 0.1677386',
                'seq4       0.1261381 0.1166475 0.1677386 0.0000000']
        self.assertEqual(matrix.format(), "\n".join(data))

    def test_wmetric_pam250(self):

# Path: alfpy/wmetric.py
# def count_seq_chars(seq, alphabet):
# def freq_seq_chars(counts):
# def freq_seqs_chars(seq_records, alphabet):
#     def __init__(self, seq_records, matrix):
#     def pairwise_distance(self, seqnum1, seqnum2):
# def main():
# class Distance:
# 
# Path: alfpy/utils/distmatrix.py
# def create(id_list, distance):
# def read_highcharts_matrix(id_list, data):
#     def __init__(self, id_list, data):
#     def normalize(self):
#     def __iter__(self):
#     def writer(self, handle, f, decimal_places):
#     def display(self, f="phylip", decimal_places=7):
#     def write_to_file(self, handle, f="phylip", decimal_places=7):
#     def highcharts(self):
#     def format(self, decimal_places=7):
#     def min(self):
#     def max(self):
#     def is_zero(self):
#     def __repr__(self):
# class Matrix():
# 
# Path: alfpy/utils/data/subsmat.py
# class SubsMat:
#     def __init__(self, name, data, alphabet_list):
# def get_alphabet_list(name):
# def get(name):
# def list_subsmats():
# def main():


# Path: tests/test_wmetric.py
import unittest
from alfpy import wmetric
from alfpy.utils import distmatrix
from alfpy.utils.data import subsmat
from . import utils

        self.assertEqual(l, expl)

    def test_freq_seq_chars(self):
        seq = 'MKSTGWXXXXXXXOOOOOOOHFSG'
        l = wmetric.count_seq_chars(seq, utils.ALPHABET_PEP)
        freq = wmetric.freq_seq_chars(l)
        expfreq = [0.0, 0.0, 0.0, 0.0, 0.1, 0.2, 0.1, 0.0, 0.1, 0.0,
                   0.1, 0.0, 0.0, 0.0, 0.2, 0.1, 0.0, 0.1, 0.0, 0.0]
        self.assertEqual(freq, expfreq)


class DistanceTest(unittest.TestCase, utils.ModulesCommonTest):

    def __init__(self, *args, **kwargs):
        super(DistanceTest, self).__init__(*args, **kwargs)
        utils.ModulesCommonTest.set_test_data()

    def test_wmetric_blosum62(self):
        # The result of this method is identical to that from decaf+py.
        matrix = subsmat.get('blosum62')
        dist = wmetric.Distance(self.pep_records, matrix)
        matrix = distmatrix.create(self.pep_records.id_list, dist)
        data = ['   4',
                'seq1       0.0000000 0.0392559 0.0783026 0.1261381',
                'seq2       0.0392559 0.0000000 0.0377364 0.1166475',
                'seq3       0.0783026 0.0377364 0.0000000 0.1677386',
                'seq4       0.1261381 0.1166475 0.1677386 0.0000000']
        self.assertEqual(matrix.format(), "\n".join(data))

    def test_wmetric_pam250(self):

        matrix = subsmat.get('pam250')