# Path: deepcpg/data/hdf.py
# def _ls(item, recursive=False, groups=False, level=0):
# def ls(filename, group='/', recursive=False, groups=False,
#        regex=None, nb_key=None, must_exist=True):
# def write_data(data, filename):
# def hnames_to_names(hnames):
# def reader(data_files, names, batch_size=128, nb_sample=None, shuffle=False,
#            loop=False):
# def _to_dict(data):
# def read_from(reader, nb_sample=None):
# def read(data_files, names, nb_sample=None, batch_size=1024, *args, **kwargs):
# 
# Path: deepcpg/data/fasta.py
# def read_chromo(filenames, chromo):
#     """Read DNA sequence of chromosome `chromo`.
# 
#     Parameters
#     ----------
#     filenames: list
#         List of FASTA files.
#     chromo: str
#         Chromosome that is read.
# 
#     Returns
#     -------
#     str
#         DNA sequence of chromosome `chromo`.
#     """
#     filename = select_file_by_chromo(filenames, chromo)
#     if not filename:
#         raise ValueError('DNA file for chromosome "%s" not found!' % chromo)
# 
#     fasta_seqs = read_file(filename)
#     if len(fasta_seqs) != 1:
#         raise ValueError('Single sequence expected in file "%s"!' % filename)
#     return fasta_seqs[0].seq
# 
# Path: deepcpg/data/dna.py
# CHAR_TO_INT = OrderedDict([('A', 0), ('T', 1), ('G', 2), ('C', 3), ('N', 4)])


from glob import glob
from numpy import testing as npt
from deepcpg.data import hdf, CPG_NAN
from deepcpg.data.fasta import read_chromo
from deepcpg.data.dna import CHAR_TO_INT
import os
import numpy as np
            dist = self.data[data_name + 'dist'][idx].ravel()
            for i, left in enumerate(exp[2]):
                exp_dist = pos - left[0]
                exp_state = left[1]
                assert dist[center - i - 1] == exp_dist
                assert state[center - i - 1] == exp_state
            for i, right in enumerate(exp[3]):
                exp_dist = right[0] - pos
                exp_state = right[1]
                assert dist[center + i] == exp_dist
                assert state[center + i] == exp_state

    def test_cpg_neighbors(self):
        name = 'BS27_4_SER'
        expected = [
            ('18', 3000086,
             ((3000023, 1.0),),
             ((3000092, 1.0), (3000163, 0.0), (3000310, 1.0))
             ),
            ('18', 3000734,
             ((3000612, 1.0), (3000315, 1.0), (3000310, 1.0), (3000163, 0.0)),
             ((3000944, 0.0), (3001029, 0.0), (3001188, 0.0), (3004806, 1.0))
             ),
            ('18', 3047425,
             ((3047423, 1.0), (3046073, 0.0), (3046067, 1.0), (3046046, 0.0)),
             ((3047447, 0.0), (3047969, 0.0), (3047981, 0.0), (3047983, 1.0))
             ),
            ('19', 4364170,
             ((4363861, 1.0), (4362993, 1.0), (4359854, 1.0), (4359157, 1.0)),
             ((4372573, 1.0), (4376976, 1.0), (4377019, 1.0), (4378828, 1.0))

# Path: deepcpg/data/hdf.py
# def _ls(item, recursive=False, groups=False, level=0):
# def ls(filename, group='/', recursive=False, groups=False,
#        regex=None, nb_key=None, must_exist=True):
# def write_data(data, filename):
# def hnames_to_names(hnames):
# def reader(data_files, names, batch_size=128, nb_sample=None, shuffle=False,
#            loop=False):
# def _to_dict(data):
# def read_from(reader, nb_sample=None):
# def read(data_files, names, nb_sample=None, batch_size=1024, *args, **kwargs):
# 
# Path: deepcpg/data/fasta.py
# def read_chromo(filenames, chromo):
#     """Read DNA sequence of chromosome `chromo`.
# 
#     Parameters
#     ----------
#     filenames: list
#         List of FASTA files.
#     chromo: str
#         Chromosome that is read.
# 
#     Returns
#     -------
#     str
#         DNA sequence of chromosome `chromo`.
#     """
#     filename = select_file_by_chromo(filenames, chromo)
#     if not filename:
#         raise ValueError('DNA file for chromosome "%s" not found!' % chromo)
# 
#     fasta_seqs = read_file(filename)
#     if len(fasta_seqs) != 1:
#         raise ValueError('Single sequence expected in file "%s"!' % filename)
#     return fasta_seqs[0].seq
# 
# Path: deepcpg/data/dna.py
# CHAR_TO_INT = OrderedDict([('A', 0), ('T', 1), ('G', 2), ('C', 3), ('N', 4)])


# Path: tests/integration_tests/data/test_data_values.py
from glob import glob
from numpy import testing as npt
from deepcpg.data import hdf, CPG_NAN
from deepcpg.data.fasta import read_chromo
from deepcpg.data.dna import CHAR_TO_INT
import os
import numpy as np

            dist = self.data[data_name + 'dist'][idx].ravel()
            for i, left in enumerate(exp[2]):
                exp_dist = pos - left[0]
                exp_state = left[1]
                assert dist[center - i - 1] == exp_dist
                assert state[center - i - 1] == exp_state
            for i, right in enumerate(exp[3]):
                exp_dist = right[0] - pos
                exp_state = right[1]
                assert dist[center + i] == exp_dist
                assert state[center + i] == exp_state

    def test_cpg_neighbors(self):
        name = 'BS27_4_SER'
        expected = [
            ('18', 3000086,
             ((3000023, 1.0),),
             ((3000092, 1.0), (3000163, 0.0), (3000310, 1.0))
             ),
            ('18', 3000734,
             ((3000612, 1.0), (3000315, 1.0), (3000310, 1.0), (3000163, 0.0)),
             ((3000944, 0.0), (3001029, 0.0), (3001188, 0.0), (3004806, 1.0))
             ),
            ('18', 3047425,
             ((3047423, 1.0), (3046073, 0.0), (3046067, 1.0), (3046046, 0.0)),
             ((3047447, 0.0), (3047969, 0.0), (3047981, 0.0), (3047983, 1.0))
             ),
            ('19', 4364170,
             ((4363861, 1.0), (4362993, 1.0), (4359854, 1.0), (4359157, 1.0)),
             ((4372573, 1.0), (4376976, 1.0), (4377019, 1.0), (4378828, 1.0))

             ),