#!/usr/bin/env python

import click as click
import bed_annotation as ba
from bed_annotation.bed_annotation import extract_features
from ngs_utils import logger


@click.command()
@click.option('-o', '--output-file', type=click.Path(), help='Output file path')
@click.option('-g', 'genome', default='GRCh37', type=click.Choice(ba.SUPPORTED_GENOMES), help='Genome build')
@click.option('--canonical', '--only-canonical', is_flag=True, help='Use only features from canonical transcripts to annotate')
@click.option('--high-confidence', is_flag=True, help='Annotate with only high confidence regions (TSL is 1 or NA, with HUGO symbol')
@click.option('--coding', '--coding-only', is_flag=True, help='Use only protein coding genes to annotate')
@click.option('-f', '--feature-types', type=click.Choice(['CDS', 'exon', 'transcript', 'gene', 'stop_codon']))
def main(output_file, genome=None, only_canonical=False, high_confidence=False, coding_only=False, feature_types=None):

    logger.init(is_debug_=True)
    extract_features(
        output_file, genome, only_canonical, high_confidence, coding_only, feature_types)


if __name__ == '__main__':
    main()

