# 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):


from collections import OrderedDict
from deepcpg.data import hdf
import os
import sys
import argparse
import h5py as h5
import logging
import numpy.random
import pandas as pd

    def main(self, name, opts):
        logging.basicConfig(filename=opts.log_file,
                            format='%(levelname)s (%(asctime)s): %(message)s')
        log = logging.getLogger(name)
        if opts.verbose:
            log.setLevel(logging.DEBUG)
        else:
            log.setLevel(logging.INFO)
        log.debug(opts)

        if opts.dna_wlen and opts.dna_wlen % 2 == 0:
            raise ValueError('DNA window length must be odd!')

        if opts.cpg_wlen and opts.cpg_wlen % 2 == 1:
            raise ValueError('CpG window length must be even!')

        data = []
        for filename in opts.data_files:
            data_file = h5.File(filename, 'r')
            data_chunk = OrderedDict()
            loc = pd.DataFrame({'chromo': data_file['chromo'].value,
                                'pos': data_file['pos'].value},
                               columns=['chromo', 'pos'])
            data_chunk['loc'] = loc

            if opts.outputs is not None:
                group = data_file['outputs']
                output_names = opts.outputs
                if not len(output_names):

# 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: scripts/dcpg_data_show.py
from collections import OrderedDict
from deepcpg.data import hdf
import os
import sys
import argparse
import h5py as h5
import logging
import numpy.random
import pandas as pd


    def main(self, name, opts):
        logging.basicConfig(filename=opts.log_file,
                            format='%(levelname)s (%(asctime)s): %(message)s')
        log = logging.getLogger(name)
        if opts.verbose:
            log.setLevel(logging.DEBUG)
        else:
            log.setLevel(logging.INFO)
        log.debug(opts)

        if opts.dna_wlen and opts.dna_wlen % 2 == 0:
            raise ValueError('DNA window length must be odd!')

        if opts.cpg_wlen and opts.cpg_wlen % 2 == 1:
            raise ValueError('CpG window length must be even!')

        data = []
        for filename in opts.data_files:
            data_file = h5.File(filename, 'r')
            data_chunk = OrderedDict()
            loc = pd.DataFrame({'chromo': data_file['chromo'].value,
                                'pos': data_file['pos'].value},
                               columns=['chromo', 'pos'])
            data_chunk['loc'] = loc

            if opts.outputs is not None:
                group = data_file['outputs']
                output_names = opts.outputs
                if not len(output_names):

                    output_names = hdf.ls(filename, 'outputs', recursive=True)