# Path: alfpy/bbc.py
# def base_base_correlation(seq, k, alphabet=None):
# def create_vectors(seq_records, k=10, alphabet="ATGC"):
#     def __init__(self, vector, disttype='euclid_norm'):
# def main():
#     L = len(alphabet)
#         D = l_dist_correlations - np.dot(p.T, p)
# class Distance(distance.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():


import unittest
from alfpy import bbc
from alfpy.utils import distmatrix
from . import utils
        self.assertEqual(md5, 'd901d93d0d71102d0727633a67fc14a3')

    def test_create_vectors_throws_exception(self):
        with self.assertRaises(Exception) as context:
            bbc.create_vectors(self.dna_records, 60, utils.ALPHABET_DNA)
        self.assertIn('Sequence too short', str(context.exception))


class DistanceTest(unittest.TestCase, utils.ModulesCommonTest):
    """Shared methods and tests for Distances calculations."""

    def __init__(self, *args, **kwargs):
        super(DistanceTest, self).__init__(*args, **kwargs)
        utils.ModulesCommonTest.set_test_data()
        self.vector = bbc.create_vectors(self.dna_records, 10,
                                         utils.ALPHABET_DNA)

    def test_distance_dna_euclidnorm(self):
        dist = bbc.Distance(self.vector)
        matrix = distmatrix.create(self.dna_records.id_list, dist)
        exp = [
            "   3",
            "seq1       0.0000000 1.0227476 1.9351116",
            "seq2       1.0227476 0.0000000 1.4469591",
            "seq3       1.9351116 1.4469591 0.0000000"
        ]
        self.assertEqual(matrix.format(), "\n".join(exp))

    def test_distance_dna_google(self):
        dist = bbc.Distance(self.vector, 'google')

# Path: alfpy/bbc.py
# def base_base_correlation(seq, k, alphabet=None):
# def create_vectors(seq_records, k=10, alphabet="ATGC"):
#     def __init__(self, vector, disttype='euclid_norm'):
# def main():
#     L = len(alphabet)
#         D = l_dist_correlations - np.dot(p.T, p)
# class Distance(distance.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: tests/test_bbc.py
import unittest
from alfpy import bbc
from alfpy.utils import distmatrix
from . import utils

        self.assertEqual(md5, 'd901d93d0d71102d0727633a67fc14a3')

    def test_create_vectors_throws_exception(self):
        with self.assertRaises(Exception) as context:
            bbc.create_vectors(self.dna_records, 60, utils.ALPHABET_DNA)
        self.assertIn('Sequence too short', str(context.exception))


class DistanceTest(unittest.TestCase, utils.ModulesCommonTest):
    """Shared methods and tests for Distances calculations."""

    def __init__(self, *args, **kwargs):
        super(DistanceTest, self).__init__(*args, **kwargs)
        utils.ModulesCommonTest.set_test_data()
        self.vector = bbc.create_vectors(self.dna_records, 10,
                                         utils.ALPHABET_DNA)

    def test_distance_dna_euclidnorm(self):
        dist = bbc.Distance(self.vector)
        matrix = distmatrix.create(self.dna_records.id_list, dist)
        exp = [
            "   3",
            "seq1       0.0000000 1.0227476 1.9351116",
            "seq2       1.0227476 0.0000000 1.4469591",
            "seq3       1.9351116 1.4469591 0.0000000"
        ]
        self.assertEqual(matrix.format(), "\n".join(exp))

    def test_distance_dna_google(self):
        dist = bbc.Distance(self.vector, 'google')

        matrix = distmatrix.create(self.dna_records.id_list, dist)