def main():
    usage = ('usage: %prog [options] <fasta input file> <fasta output file>\n\n' + '    <fasta file>:  fasta sequence to filter\n')
    description = 'Ensure sequences have length >= length\n'
    parser = OptionParser(usage=usage, description=description)
    parser.add_option('--prefix', dest='prefix', type='string', help='only filter sequences with prefix in name', default='')
    parser.add_option('--length', dest='length', type='int', help='filter shorter than length [default=1000]', default=1000)
    (options, args) = parser.parse_args()
    if (len(args) != 2):
        parser.print_help()
        return 1
    inputName = args[0]
    inputFile = open(inputName, 'r')
    outputName = args[1]
    outputFile = open(outputName, 'w')
    contTable = containedSequences(inputFile)
    inputFile.seek(0)
    for (header, seq) in fastaRead(inputFile):
        if (tooShort(header, seq, options, contTable) == False):
            fastaWrite(outputFile, header, seq)
    outputFile.close()
    inputFile.close()
    return 0
def main():
    usage = ('usage: %prog [options] <fasta input file> <fasta output file>\n\n' + '    <fasta file>:  fasta sequence to filter\n')
    description = 'Ensure sequences have length >= length\n'
    parser = OptionParser(usage=usage, description=description)
    parser.add_option('--prefix', dest='prefix', type='string', help='only filter sequences with prefix in name', default=)
    parser.add_option('--length', dest='length', type='int', help='filter shorter than length [default=1000]', default=1000)
    (options, args) = parser.parse_args()
    if (len(args) != 2):
        parser.print_help()
        return 1
    inputName = args[0]
    inputFile = open(inputName, 'r')
    outputName = args[1]
    outputFile = open(outputName, 'w')
    contTable = containedSequences(inputFile)
    inputFile.seek(0)
    for (header, seq) in fastaRead(inputFile):
        if (tooShort(header, seq, options, contTable) == False):
            fastaWrite(outputFile, header, seq)
    outputFile.close()
    inputFile.close()
    return 0