#!/usr/bin/env python3

import argparse
from fastaq import tasks

parser = argparse.ArgumentParser(
    description = 'Converts sequence file to FASTA format',
    usage = '%(prog)s <infile> <outfile>')
parser.add_argument('infile', help='Name of input file. Can be any of FASTA, FASTQ, GFF3, EMBL, GBK, Phylip')
parser.add_argument('outfile', help='Name of output file')
parser.add_argument('-l', '--line_length', type=int, help='Number of bases on each sequence line of output file [%(default)s]', default=60)
parser.add_argument('-s', '--strip_after_whitespace', action='store_true', help='Remove everything after first whitesapce in every sequence name')
options = parser.parse_args()
tasks.to_fasta(
    options.infile,
    options.outfile,
    line_length=options.line_length,
    strip_after_first_whitespace=options.strip_after_whitespace
)
