# Path: pergola/mapping.py
# class MappingInfo():
#     def __init__(self, path, **kwargs):
#     def _correspondence_from_config(self, path):
#     def _tab_config(self, file_tab):
#     def _mapping_config(self, file_map):
#     def write(self, indent=0):
# def check_path(path):
# def write_chr(self, mode="w", path_w=None, min_c=None, max_c=None):
# def write_chr_sizes(self, mode="w", path_w=None, file_n=None, min_c=None, max_c=None):
# def write_cytoband(end, start=0, delta=43200, start_phase="light", mode="w", path_w=None, lab_bed=True, track_line=True):
# def write_period_seq (end, start=0, delta=43200, tag="day", mode="w", path_w=None, name_file="period_seq", lab_bed=True, track_line=True):
# 
# Path: pergola/intervals.py
# class IntData(object):
#     def __init__(self, path, map_dict, header=True, **kwargs):
#     def _check_delimiter (self, path, delimiter):
#     def _reader_data(self):
#     def _pandas_df_reader(self, df):
#     def _set_fields_b(self, fields=None):
#     def _set_fields_g (self, map_dict):
#     def _simple_read(self):
#     def get_field_items(self, data, field="data_types", default=None):
#     def read(self, fields=None, relative_coord=False, intervals=False, int_step=None, fields2rel=None, multiply_t=None,
#              **kwargs):
#     def _min_max(self, list_data, f_start="start", f_end="end"):
#     def _time2rel_time(self, i_fields):
#     def _multiply_values(self, i_fields, factor=1):
#     def _create_int(self, start_int, int_step=None):
#     def _create_int_add_integ(self, start_int, integer=1):
#     def __del__(self):
# def is_number(var):
# def num(s):
# 
# Path: pergola/parsers.py
# PATH = abspath(split(realpath(__file__))[0])
# def parse_num_range(string):
# def read_track_actions (tracks, track_action = "split_all"):
# def read_colors (path_color_file):


from pergola import mapping
from pergola import intervals
from pergola import parsers
#!/usr/bin/env python


mapping_info = mapping.MappingInfo("/Users/jespinosa/git/pergola/sample_data/feeding_behavior/b2g.txt")
 
mapping_info.write()
 
# load the data into an IntData object that will store the sequence of events
int_data = intervals.IntData("/Users/jespinosa/git/pergola/sample_data/feeding_behavior/feedingBehavior_HF_mice.csv", map_dict=mapping_info.correspondence, delimiter="\t")
 
print (int_data.data[:12])
print (int_data.fieldsB)
print (int_data.fieldsG_dict)
# print (int_data.fieldsG_dict.keys())
print (int_data.dataTypes)
print (int_data.tracks)
print "debugging_simple_read---- min value in int_data_feeding ------------------------", int_data.min
print "debugging_simple_read---- max value in int_data_feeding ------------------------", int_data.max
track_data = int_data.read(relative_coord=True)
print "track object files are============+++++++++++++++++++", track_data.fields
track_data.convert(mode="bed")

#electro for single time point validation


# Path: pergola/mapping.py
# class MappingInfo():
#     def __init__(self, path, **kwargs):
#     def _correspondence_from_config(self, path):
#     def _tab_config(self, file_tab):
#     def _mapping_config(self, file_map):
#     def write(self, indent=0):
# def check_path(path):
# def write_chr(self, mode="w", path_w=None, min_c=None, max_c=None):
# def write_chr_sizes(self, mode="w", path_w=None, file_n=None, min_c=None, max_c=None):
# def write_cytoband(end, start=0, delta=43200, start_phase="light", mode="w", path_w=None, lab_bed=True, track_line=True):
# def write_period_seq (end, start=0, delta=43200, tag="day", mode="w", path_w=None, name_file="period_seq", lab_bed=True, track_line=True):
# 
# Path: pergola/intervals.py
# class IntData(object):
#     def __init__(self, path, map_dict, header=True, **kwargs):
#     def _check_delimiter (self, path, delimiter):
#     def _reader_data(self):
#     def _pandas_df_reader(self, df):
#     def _set_fields_b(self, fields=None):
#     def _set_fields_g (self, map_dict):
#     def _simple_read(self):
#     def get_field_items(self, data, field="data_types", default=None):
#     def read(self, fields=None, relative_coord=False, intervals=False, int_step=None, fields2rel=None, multiply_t=None,
#              **kwargs):
#     def _min_max(self, list_data, f_start="start", f_end="end"):
#     def _time2rel_time(self, i_fields):
#     def _multiply_values(self, i_fields, factor=1):
#     def _create_int(self, start_int, int_step=None):
#     def _create_int_add_integ(self, start_int, integer=1):
#     def __del__(self):
# def is_number(var):
# def num(s):
# 
# Path: pergola/parsers.py
# PATH = abspath(split(realpath(__file__))[0])
# def parse_num_range(string):
# def read_track_actions (tracks, track_action = "split_all"):
# def read_colors (path_color_file):


# Path: pergola/test/debugging_simple_read.py
from pergola import mapping
from pergola import intervals
from pergola import parsers

#!/usr/bin/env python


mapping_info = mapping.MappingInfo("/Users/jespinosa/git/pergola/sample_data/feeding_behavior/b2g.txt")
 
mapping_info.write()
 
# load the data into an IntData object that will store the sequence of events
int_data = intervals.IntData("/Users/jespinosa/git/pergola/sample_data/feeding_behavior/feedingBehavior_HF_mice.csv", map_dict=mapping_info.correspondence, delimiter="\t")
 
print (int_data.data[:12])
print (int_data.fieldsB)
print (int_data.fieldsG_dict)
# print (int_data.fieldsG_dict.keys())
print (int_data.dataTypes)
print (int_data.tracks)
print "debugging_simple_read---- min value in int_data_feeding ------------------------", int_data.min
print "debugging_simple_read---- max value in int_data_feeding ------------------------", int_data.max
track_data = int_data.read(relative_coord=True)
print "track object files are============+++++++++++++++++++", track_data.fields
track_data.convert(mode="bed")

#electro for single time point validation


mapping_info_e = mapping.MappingInfo("/Users/jespinosa/git/pergola/pergola/test/electrophysiology/e2p.txt")