# Path: alfpy/fcgr.py
# def fcgr_vector(dnaseq, word_size):
# def create_vectors(seq_records, word_size):
#     def __init__(self, vector, disttype='euclid_norm'):
# def main():
# 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 os
import unittest
from alfpy import fcgr
from alfpy.utils import distmatrix
from . import utils
    def test_fcgr_vector1(self):
        vec = fcgr.fcgr_vector('CTAGGGAACATACCA', 1)
        self.assertEqual(vec, [3.0, 6.0, 3.0])

    def test_fcgr_vector2(self):
        vec = fcgr.fcgr_vector('CTAGGGAACATACCA', 2)
        exp = [0.0, 0.0, 2.0, 2.0, 1.0, 1.0, 0.0, 2.0,
               1.0, 2.0, 0.0, 1.0, 2.0, 1.0, 0.0]
        self.assertEqual(vec, exp)

    def test_fcgr_vector3(self):
        vec = fcgr.fcgr_vector('CTAGGGAACATACCXXA', 1)
        self.assertEqual(vec, [3.0, 6.0, 3.0])

    def test_create_vectors(self):
        vecs = fcgr.create_vectors(self.dna_records, 2)
        exp = [[0, 3, 1, 4, 0, 1, 1, 1, 1, 1, 3, 2, 4, 1, 1],
               [0, 0, 4, 1, 2, 2, 0, 0, 1, 4, 0, 0, 3, 1, 1],
               [0, 0, 2, 2, 1, 1, 0, 2, 1, 2, 0, 1, 2, 1, 0]]
        self.assertEqual(vecs.tolist(), exp)


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

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

    def test_distance1(self):
        vecs = fcgr.create_vectors(self.dna_records, 2)

# Path: alfpy/fcgr.py
# def fcgr_vector(dnaseq, word_size):
# def create_vectors(seq_records, word_size):
#     def __init__(self, vector, disttype='euclid_norm'):
# def main():
# 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_fcgr.py
import os
import unittest
from alfpy import fcgr
from alfpy.utils import distmatrix
from . import utils

    def test_fcgr_vector1(self):
        vec = fcgr.fcgr_vector('CTAGGGAACATACCA', 1)
        self.assertEqual(vec, [3.0, 6.0, 3.0])

    def test_fcgr_vector2(self):
        vec = fcgr.fcgr_vector('CTAGGGAACATACCA', 2)
        exp = [0.0, 0.0, 2.0, 2.0, 1.0, 1.0, 0.0, 2.0,
               1.0, 2.0, 0.0, 1.0, 2.0, 1.0, 0.0]
        self.assertEqual(vec, exp)

    def test_fcgr_vector3(self):
        vec = fcgr.fcgr_vector('CTAGGGAACATACCXXA', 1)
        self.assertEqual(vec, [3.0, 6.0, 3.0])

    def test_create_vectors(self):
        vecs = fcgr.create_vectors(self.dna_records, 2)
        exp = [[0, 3, 1, 4, 0, 1, 1, 1, 1, 1, 3, 2, 4, 1, 1],
               [0, 0, 4, 1, 2, 2, 0, 0, 1, 4, 0, 0, 3, 1, 1],
               [0, 0, 2, 2, 1, 1, 0, 2, 1, 2, 0, 1, 2, 1, 0]]
        self.assertEqual(vecs.tolist(), exp)


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

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

    def test_distance1(self):
        vecs = fcgr.create_vectors(self.dna_records, 2)

        dist = fcgr.Distance(vecs)