import argparse
from local_reassembly.src import get_range_haplotype

class Job(object):
    def __init__(self):
        pass

    def run_arg_parser(self):
        # argument parse
        parser = argparse.ArgumentParser(
            prog='reassm',
            description="Locally reassembling haplotypes from BAM files generated by WGS data.",
        )

        parser.add_argument('chr_id', type=str, help='Chromosome name')
        parser.add_argument('start', type=int, help='Start position of the region')
        parser.add_argument('end', type=int, help='End position of the region')
        parser.add_argument('bam_file', type=str, help='Path to the original BAM file')
        parser.add_argument('genome_file', type=str, help='Path to the reference genome file')
        parser.add_argument('work_dir', type=str, help='Path to the working directory')

        self.arg_parser = parser
        self.args = parser.parse_args()

    def run(self):
        self.run_arg_parser()
        get_range_haplotype(self.args.chr_id, self.args.start, self.args.end, self.args.bam_file, self.args.genome_file, self.args.work_dir)

def main():
    job = Job()
    job.run()

if __name__ == '__main__':
    main()