# 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




class VectorTest(unittest.TestCase):

    def test_count_seq_chars(self):
        seq = 'MKSTGWHFSG'
        l = wmetric.count_seq_chars(seq, utils.ALPHABET_PEP)
        expl = [0, 0, 0, 0, 1, 2, 1, 0, 1, 0, 1, 0, 0, 0, 2, 1, 0, 1, 0, 0]
        self.assertEqual(l, expl)

    def test_count_seq_chars_pep_ambiguous(self):
        seq = 'MKSTGWXXXXXXXOOOOOOOHFSG'
        l = wmetric.count_seq_chars(seq, utils.ALPHABET_PEP)
        expl = [0, 0, 0, 0, 1, 2, 1, 0, 1, 0, 1, 0, 0, 0, 2, 1, 0, 1, 0, 0]
        self.assertEqual(l, expl)

    def test_freq_seq_chars(self):
        seq = 'MKSTGWXXXXXXXOOOOOOOHFSG'

# 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





class VectorTest(unittest.TestCase):

    def test_count_seq_chars(self):
        seq = 'MKSTGWHFSG'
        l = wmetric.count_seq_chars(seq, utils.ALPHABET_PEP)
        expl = [0, 0, 0, 0, 1, 2, 1, 0, 1, 0, 1, 0, 0, 0, 2, 1, 0, 1, 0, 0]
        self.assertEqual(l, expl)

    def test_count_seq_chars_pep_ambiguous(self):
        seq = 'MKSTGWXXXXXXXOOOOOOOHFSG'
        l = wmetric.count_seq_chars(seq, utils.ALPHABET_PEP)
        expl = [0, 0, 0, 0, 1, 2, 1, 0, 1, 0, 1, 0, 0, 0, 2, 1, 0, 1, 0, 0]
        self.assertEqual(l, expl)

    def test_freq_seq_chars(self):
        seq = 'MKSTGWXXXXXXXOOOOOOOHFSG'

        l = wmetric.count_seq_chars(seq, utils.ALPHABET_PEP)