# Path: pergola/_version.py

# 
# Path: pergola/mapping.py
# def check_path(path):
#     """ 
#     Check whether the input file exists and is accessible and if OK returns path
#     
#     :param path: path to the intervals file
#     
#     :returns: the path assessed
#     
#     """
# 
#     assert isinstance(path, str), "Expected string or unicode, found %s." % type(path)
#     try:
#         f = open(path, "r")
#     except IOError:
#         raise IOError('File does not exist: %s' % path)
#     finally:
#         f.close()
#     return path      


from ._version  import __version__
from sys       import stderr
from argparse  import ArgumentParser, ArgumentTypeError
from re        import match
from os.path   import abspath, split, realpath
from .mapping   import check_path
                           help='Dictionary assigning colors of data_types path')
parent_parser.add_argument('-wm', '--window_mean', required=False, action='store_true',
                           default=False, help='Window values averaged by the window size')
parent_parser.add_argument('-vm', '--value_mean', required=False, action='store_true',
                           help='Window values averaged by number of items within window')
parent_parser.add_argument('-min', '--min_time', type=int, required=False,
                           help='Initial time point to extract')
parent_parser.add_argument('-max', '--max_time', type=int, required=False,
                           help='Last time point to extract')
parent_parser.add_argument('-ng', '--no_genome', required=False, dest='genome', action='store_false',
                           help='Avoinds the creation of a FASTA file which allows to render a longitudinal trajectory' \
                           ' in a genome browser')
parent_parser.add_argument('-np', '--no_phases', required=False, dest='phases', action='store_false',
                           help='Avoids the creation of a phases bed file')
parent_parser.set_defaults(genome=True)
parent_parser.set_defaults(phases=True)
parent_parser.add_argument('-o', '--output_file_name', help='File name for output files')
parent_parser.add_argument('-sp', '--starting_phase', type=str, required=False, choices=_starting_phase_options,
                           help='Sets the first phase to appear in the phases and cytoband file: light or dark\n')
parent_parser.add_argument('-sh', '--shift', required=False, metavar="TIME_SHIFT", type=int,
                           help='Time shift to be set for the first phase')
parent_parser.add_argument('-v', '--version', action='version', version='%(prog)s {version}'.format(version=__version__))

""""   
Parsers argument of jaaba_to_pergola.py script

"""

jaaba_parser = ArgumentParser(description = 'Script to transform Jaaba annotations into Pergola readable formats', 
                              add_help=False)

# Path: pergola/_version.py

# 
# Path: pergola/mapping.py
# def check_path(path):
#     """ 
#     Check whether the input file exists and is accessible and if OK returns path
#     
#     :param path: path to the intervals file
#     
#     :returns: the path assessed
#     
#     """
# 
#     assert isinstance(path, str), "Expected string or unicode, found %s." % type(path)
#     try:
#         f = open(path, "r")
#     except IOError:
#         raise IOError('File does not exist: %s' % path)
#     finally:
#         f.close()
#     return path      


# Path: pergola/parsers.py
from ._version  import __version__
from sys       import stderr
from argparse  import ArgumentParser, ArgumentTypeError
from re        import match
from os.path   import abspath, split, realpath
from .mapping   import check_path

                           help='Dictionary assigning colors of data_types path')
parent_parser.add_argument('-wm', '--window_mean', required=False, action='store_true',
                           default=False, help='Window values averaged by the window size')
parent_parser.add_argument('-vm', '--value_mean', required=False, action='store_true',
                           help='Window values averaged by number of items within window')
parent_parser.add_argument('-min', '--min_time', type=int, required=False,
                           help='Initial time point to extract')
parent_parser.add_argument('-max', '--max_time', type=int, required=False,
                           help='Last time point to extract')
parent_parser.add_argument('-ng', '--no_genome', required=False, dest='genome', action='store_false',
                           help='Avoinds the creation of a FASTA file which allows to render a longitudinal trajectory' \
                           ' in a genome browser')
parent_parser.add_argument('-np', '--no_phases', required=False, dest='phases', action='store_false',
                           help='Avoids the creation of a phases bed file')
parent_parser.set_defaults(genome=True)
parent_parser.set_defaults(phases=True)
parent_parser.add_argument('-o', '--output_file_name', help='File name for output files')
parent_parser.add_argument('-sp', '--starting_phase', type=str, required=False, choices=_starting_phase_options,
                           help='Sets the first phase to appear in the phases and cytoband file: light or dark\n')
parent_parser.add_argument('-sh', '--shift', required=False, metavar="TIME_SHIFT", type=int,
                           help='Time shift to be set for the first phase')
parent_parser.add_argument('-v', '--version', action='version', version='%(prog)s {version}'.format(version=__version__))

""""   
Parsers argument of jaaba_to_pergola.py script

"""

jaaba_parser = ArgumentParser(description = 'Script to transform Jaaba annotations into Pergola readable formats', 
                              add_help=False)

jaaba_parser.add_argument('-v', '--version', action='version', version='%(prog)s {version}'.format(version=__version__))