# Path: deepcpg/data/feature_extractor.py
# class KnnCpgFeatureExtractor(object):
# class IntervalFeatureExtractor(object):
# class KmersFeatureExtractor(object):
#     def __init__(self, k=1):
#     def extract(self, x, y, ys):
#     def __larger_equal(self, x, y):
#     def join_intervals(s, e):
#     def index_intervals(x, ys, ye):
#     def extract(self, x, ys, ye):
#     def __init__(self, kmer_len, nb_char=4):
#     def __call__(self, seqs):
# 
# Path: deepcpg/data/dna.py
# CHAR_TO_INT = OrderedDict([('A', 0), ('T', 1), ('G', 2), ('C', 3), ('N', 4)])
# INT_TO_CHAR = {v: k for k, v in CHAR_TO_INT.items()}
# def get_alphabet(special=False, reverse=False):
# def char_to_int(seq):
# def int_to_char(seq, join=True):
# def int_to_onehot(seqs, dim=4):
# def onehot_to_int(seqs, axis=-1):


import numpy as np
import numpy.testing as npt
import six
from deepcpg.data import feature_extractor as fe
from deepcpg.data import dna
    def test_k1(self):
        ext = fe.KmersFeatureExtractor(1)

        seqs = self._translate_seqs('AGGTTCCC')
        expect = self._freq({'A': 1, 'G': 2, 'T': 2, 'C': 3})
        expect = np.array([expect])
        actual = ext(seqs)
        npt.assert_array_equal(actual, expect)

        seqs = self._translate_seqs('AGTGGGTTCCC')
        expect = self._freq({'A': 1, 'G': 4, 'T': 3, 'C': 3})
        expect = np.array([expect])
        actual = ext(seqs)
        npt.assert_array_equal(actual, expect)

        seqs = self._translate_seqs(['AGTGGGTTCCC',
                                     'GGGGGGGGGGG'])
        expect = []
        expect.append(self._freq({'A': 1, 'G': 4, 'T': 3, 'C': 3}))
        expect.append(self._freq({'G': 11}))
        expect = np.array(expect)
        actual = ext(seqs)
        npt.assert_array_equal(actual, expect)

    def test_k4(self):
        ext = fe.KmersFeatureExtractor(4)

        seqs = self._translate_seqs('AAAA')
        expect = self._freq({'AAAA': 1})
        expect = np.array([expect])

# Path: deepcpg/data/feature_extractor.py
# class KnnCpgFeatureExtractor(object):
# class IntervalFeatureExtractor(object):
# class KmersFeatureExtractor(object):
#     def __init__(self, k=1):
#     def extract(self, x, y, ys):
#     def __larger_equal(self, x, y):
#     def join_intervals(s, e):
#     def index_intervals(x, ys, ye):
#     def extract(self, x, ys, ye):
#     def __init__(self, kmer_len, nb_char=4):
#     def __call__(self, seqs):
# 
# Path: deepcpg/data/dna.py
# CHAR_TO_INT = OrderedDict([('A', 0), ('T', 1), ('G', 2), ('C', 3), ('N', 4)])
# INT_TO_CHAR = {v: k for k, v in CHAR_TO_INT.items()}
# def get_alphabet(special=False, reverse=False):
# def char_to_int(seq):
# def int_to_char(seq, join=True):
# def int_to_onehot(seqs, dim=4):
# def onehot_to_int(seqs, axis=-1):


# Path: tests/deepcpg/data/test_feature_extractor.py
import numpy as np
import numpy.testing as npt
import six
from deepcpg.data import feature_extractor as fe
from deepcpg.data import dna

    def test_k1(self):
        ext = fe.KmersFeatureExtractor(1)

        seqs = self._translate_seqs('AGGTTCCC')
        expect = self._freq({'A': 1, 'G': 2, 'T': 2, 'C': 3})
        expect = np.array([expect])
        actual = ext(seqs)
        npt.assert_array_equal(actual, expect)

        seqs = self._translate_seqs('AGTGGGTTCCC')
        expect = self._freq({'A': 1, 'G': 4, 'T': 3, 'C': 3})
        expect = np.array([expect])
        actual = ext(seqs)
        npt.assert_array_equal(actual, expect)

        seqs = self._translate_seqs(['AGTGGGTTCCC',
                                     'GGGGGGGGGGG'])
        expect = []
        expect.append(self._freq({'A': 1, 'G': 4, 'T': 3, 'C': 3}))
        expect.append(self._freq({'G': 11}))
        expect = np.array(expect)
        actual = ext(seqs)
        npt.assert_array_equal(actual, expect)

    def test_k4(self):
        ext = fe.KmersFeatureExtractor(4)

        seqs = self._translate_seqs('AAAA')
        expect = self._freq({'AAAA': 1})
        expect = np.array([expect])

        actual = ext(seqs)