def alignment_correcter(self, alignment_file_list, output_file_name,<EOL>filter_minimum=None):
corrected_sequences = {}<EOL>for alignment_file in alignment_file_list:<EOL><INDENT>insert_list = []  <EOL>sequence_list = list(SeqIO.parse(open(alignment_file, '<STR_LIT:r>'), '<STR_LIT>'))<EOL>for sequence in sequence_list:  <EOL><INDENT>for idx, nt in enumerate(list(sequence.seq)):  <EOL><INDENT>if nt.islower():  <EOL><INDENT>insert_list.append(idx)  <EOL><DEDENT><DEDENT><DEDENT>insert_list = list(OrderedDict.fromkeys(sorted(insert_list, reverse=True)))  <EOL>for sequence in sequence_list:  <EOL><INDENT>new_seq = list(sequence.seq)  <EOL>for position in insert_list:  <EOL><INDENT>del new_seq[position]  <EOL><DEDENT>corrected_sequences['<STR_LIT:>>' + sequence.id + '<STR_LIT:\n>'] = ('<STR_LIT>'.join(new_seq) + '<STR_LIT:\n>').replace('<STR_LIT>', '<STR_LIT:->')<EOL><DEDENT><DEDENT>pre_filter_count=len(corrected_sequences)<EOL>if filter_minimum:<EOL><INDENT>corrected_sequences={key:item for key, item in corrected_sequences.iteritems() if len(item.replace('<STR_LIT:->', '<STR_LIT>')) > filter_minimum}<EOL><DEDENT>post_filter_count=len(corrected_sequences)<EOL>logging.info("<STR_LIT>" %(pre_filter_count-post_filter_count)<EOL>)<EOL>logging.info("<STR_LIT>" % post_filter_count)<EOL>if len(corrected_sequences) >= <NUM_LIT:1>:<EOL><INDENT>with open(output_file_name, '<STR_LIT:w>') as output_file:  <EOL><INDENT>for fasta_id, fasta_seq in corrected_sequences.iteritems():<EOL><INDENT>output_file.write(fasta_id)<EOL>output_file.write(fasta_seq)<EOL><DEDENT><DEDENT>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
Remove lower case insertions in alignment outputs from HMM align. Give
a list of alignments, and an output file name, and each alignment will
be corrected, and written to a single file, ready to be placed together
using pplacer.

Parameters
----------
alignment_file_list : array
    List of strings, each the path to different alignments from the
    inputs provided to GraftM
output_file_name : str
    The path and filename of the output file desired.
filter_minimum : int
    minimum number of positions that must be aligned for each sequence
Returns
-------
True or False, depending if reads were written to file