def main(args=None):
vinfo = sys.version_info<EOL>if not vinfo >= (<NUM_LIT:2>, <NUM_LIT:7>):<EOL><INDENT>raise SystemError('<STR_LIT>'<EOL>'<STR_LIT>' %(vinfo.major, vinfo.minor))<EOL><DEDENT>if args is None:<EOL><INDENT>parser = get_argument_parser()<EOL>args = parser.parse_args()<EOL><DEDENT>input_file = args.annotation_file<EOL>output_file = args.output_file<EOL>chrom_pat = args.chromosome_pattern<EOL>log_file = args.log_file<EOL>quiet = args.quiet<EOL>verbose = args.verbose<EOL>log_stream = sys.stdout<EOL>if output_file == '<STR_LIT:->':<EOL><INDENT>log_stream = sys.stderr<EOL><DEDENT>logger = misc.get_logger(log_stream=log_stream, log_file=log_file,<EOL>quiet=quiet, verbose=verbose)<EOL>if chrom_pat is not None:<EOL><INDENT>logger.info('<STR_LIT>'<EOL>'<STR_LIT>', chrom_pat)<EOL><DEDENT>if input_file == '<STR_LIT:->':<EOL><INDENT>input_file = sys.stdin<EOL><DEDENT>if output_file == '<STR_LIT:->':<EOL><INDENT>output_file = sys.stdout<EOL><DEDENT>genes = ensembl.get_protein_coding_genes(<EOL>input_file,<EOL>chromosome_pattern=chrom_pat)<EOL>genes.to_csv(output_file, sep='<STR_LIT:\t>', index=False)<EOL>return <NUM_LIT:0><EOL>
Extract protein-coding genes and store in tab-delimited text file.

    Parameters
    ----------
    args: argparse.Namespace object, optional
        The argument values. If not specified, the values will be obtained by
        parsing the command line arguments using the `argparse` module.

    Returns
    -------
    int
        Exit code (0 if no error occurred).

    Raises
    ------
    SystemError
        If the version of the Python interpreter is not >= 2.7.