# Path: conkit/plot/tools.py
# class ColorDefinitions(object):
#     GENERAL = "#000000"
#     MATCH = "#0F0B2C"
#     MISMATCH = "#DC4869"
#     STRUCTURAL = "#D8D6D6"
#     L5CUTOFF = "#3F4587"
#     L20CUTOFF = "#B5DD2B"
#     PRECISION50 = L5CUTOFF
#     FACTOR1 = L20CUTOFF
#     SCORE = '#3299a8'
#     ERROR = '#f54242'
#     CORRECT = '#40eef7'
#     ALIGNED = '#3d8beb'
#     MISALIGNED = '#f7ba40'
#     AA_ENCODING = {
#         "A": "#882D17",
#         "C": "#F3C300",
#         "D": "#875692",
#         "E": "#F38400",
#         "F": "#A1CAF1",
#         "G": "#BE0032",
#         "H": "#C2B280",
#         "I": "#848482",
#         "K": "#008856",
#         "L": "#E68FAC",
#         "M": "#0067A5",
#         "N": "#F99379",
#         "P": "#604E97",
#         "Q": "#F6A600",
#         "R": "#B3446C",
#         "S": "#DCD300",
#         "T": "#8DB600",
#         "V": "#654522",
#         "W": "#E25822",
#         "Y": "#2B3D26",
#         "X": "#000000",
#     }
# def find_minima(data, order=1):
# def get_adjusted_aspect(ax, aspect_ratio):
# def points_on_circle(*args, **kwargs):
# def get_points_on_circle(radius, h=0, k=0):
# def get_radius_around_circle(p1, p2):
# def _isinstance(hierarchy, hierarchy_type):
# def is_executable(executable):
# def convolution_smooth_values(x, window=5):
# def get_rmsd(distogram_1, distogram_2, calculate_wrmsd=True):
# def get_cmap_validation_metrics(model_cmap_dict, predicted_cmap_dict, sequence, absent_residues):
#     def accuracy(tp, fp, tn, fn):
#     def fn(*args):
#     def fn_rate(tp, fp, tn, fn):
#     def fp(*args):
#     def fp_rate(tp, fp, tn, fn):
#     def sensitivity(tp, fp, tn, fn):
#     def specificity(tp, fp, tn, fn):
# def get_zscores(model_distogram, predicted_cmap_dict, absent_residues, *metrics):
# def calculate_zscore(observed_score, population_scores):
# def get_residue_ranges(numbers):
# def parse_map_align_stdout(stdout):


import os.path
import sys
import numpy as np
import unittest
from conkit.core import *
from conkit.plot import tools
__author__ = "Felix Simkovic"
__date__ = "16 Feb 2017"





class Test(unittest.TestCase):
    def test_find_minima_1(self):
        with self.assertRaises(ValueError):
            tools.find_minima([])

    def test_find_minima_2(self):
        with self.assertRaises(ValueError):
            tools.find_minima([5])

    def test_find_minima_3(self):
        self.assertEqual([1], tools.find_minima([5, 4, 5], order=1))

    def test_find_minima_4(self):
        self.assertEqual([2, 4], tools.find_minima([4, 5, 3, 5, 2, 6], order=1))

    def test_find_minima_5(self):
        self.assertEqual([4], tools.find_minima([4, 5, 3, 5, 2, 6], order=3))

    def test_find_minima_6(self):
        self.assertEqual([4], tools.find_minima([4, 5, 3, 5, 2, 6], order=10))

    def test_find_minima_7(self):
        with self.assertRaises(ValueError):

# Path: conkit/plot/tools.py
# class ColorDefinitions(object):
#     GENERAL = "#000000"
#     MATCH = "#0F0B2C"
#     MISMATCH = "#DC4869"
#     STRUCTURAL = "#D8D6D6"
#     L5CUTOFF = "#3F4587"
#     L20CUTOFF = "#B5DD2B"
#     PRECISION50 = L5CUTOFF
#     FACTOR1 = L20CUTOFF
#     SCORE = '#3299a8'
#     ERROR = '#f54242'
#     CORRECT = '#40eef7'
#     ALIGNED = '#3d8beb'
#     MISALIGNED = '#f7ba40'
#     AA_ENCODING = {
#         "A": "#882D17",
#         "C": "#F3C300",
#         "D": "#875692",
#         "E": "#F38400",
#         "F": "#A1CAF1",
#         "G": "#BE0032",
#         "H": "#C2B280",
#         "I": "#848482",
#         "K": "#008856",
#         "L": "#E68FAC",
#         "M": "#0067A5",
#         "N": "#F99379",
#         "P": "#604E97",
#         "Q": "#F6A600",
#         "R": "#B3446C",
#         "S": "#DCD300",
#         "T": "#8DB600",
#         "V": "#654522",
#         "W": "#E25822",
#         "Y": "#2B3D26",
#         "X": "#000000",
#     }
# def find_minima(data, order=1):
# def get_adjusted_aspect(ax, aspect_ratio):
# def points_on_circle(*args, **kwargs):
# def get_points_on_circle(radius, h=0, k=0):
# def get_radius_around_circle(p1, p2):
# def _isinstance(hierarchy, hierarchy_type):
# def is_executable(executable):
# def convolution_smooth_values(x, window=5):
# def get_rmsd(distogram_1, distogram_2, calculate_wrmsd=True):
# def get_cmap_validation_metrics(model_cmap_dict, predicted_cmap_dict, sequence, absent_residues):
#     def accuracy(tp, fp, tn, fn):
#     def fn(*args):
#     def fn_rate(tp, fp, tn, fn):
#     def fp(*args):
#     def fp_rate(tp, fp, tn, fn):
#     def sensitivity(tp, fp, tn, fn):
#     def specificity(tp, fp, tn, fn):
# def get_zscores(model_distogram, predicted_cmap_dict, absent_residues, *metrics):
# def calculate_zscore(observed_score, population_scores):
# def get_residue_ranges(numbers):
# def parse_map_align_stdout(stdout):


# Path: conkit/plot/tests/test_tools.py
import os.path
import sys
import numpy as np
import unittest
from conkit.core import *
from conkit.plot import tools

__author__ = "Felix Simkovic"
__date__ = "16 Feb 2017"





class Test(unittest.TestCase):
    def test_find_minima_1(self):
        with self.assertRaises(ValueError):
            tools.find_minima([])

    def test_find_minima_2(self):
        with self.assertRaises(ValueError):
            tools.find_minima([5])

    def test_find_minima_3(self):
        self.assertEqual([1], tools.find_minima([5, 4, 5], order=1))

    def test_find_minima_4(self):
        self.assertEqual([2, 4], tools.find_minima([4, 5, 3, 5, 2, 6], order=1))

    def test_find_minima_5(self):
        self.assertEqual([4], tools.find_minima([4, 5, 3, 5, 2, 6], order=3))

    def test_find_minima_6(self):
        self.assertEqual([4], tools.find_minima([4, 5, 3, 5, 2, 6], order=10))

    def test_find_minima_7(self):
        with self.assertRaises(ValueError):

            tools.find_minima([4, 5, 3, 5, 2, 6], order=0)