#!/usr/bin/env python3

import argparse
from fastaq import tasks

parser = argparse.ArgumentParser(
    description = 'Extends the length of all gaps (and trims the start/end of sequences) in a fasta/q file. Does this by replacing a set number of bases either side of each gap with Ns. Any sequence that ends up as all Ns is lost',
    usage = '%(prog)s [options] <fasta/q in> <fasta/q out>')
parser.add_argument('--trim_number', type=int, help='Number of bases to trim around each gap, and off ends of each sequence [%(default)s]', default=100)
parser.add_argument('infile', help='Name of input fasta/q file')
parser.add_argument('outfile', help='Name of output fasta/q file')
options = parser.parse_args()
tasks.extend_gaps(options.infile, options.outfile, options.trim_number)
