def truncate_reverse_primer(fasta_fp, mapping_fp, output_dir='.', truncate_option='truncate_only', primer_mismatches=2):
 reverse_primers = get_rev_primer_seqs(open(mapping_fp, 'U'))
 (output_fp, log_fp) = get_output_filepaths(output_dir, fasta_fp)
 log_data = truncate_rev_primers(open(fasta_fp, 'U'), open(output_fp, 'w'), reverse_primers, truncate_option, primer_mismatches)
 log_data['fasta_fp'] = fasta_fp
 log_data['mapping_fp'] = mapping_fp
 log_data['truncate_option'] = truncate_option
 log_data['primer_mismatches'] = primer_mismatches
 write_log_file(log_data, open(log_fp, 'w'))

def truncate_reverse_primer ( fasta_fp , mapping_fp , output_dir = '.' , truncate_option = 'truncate_only' , primer_mismatches = 2 ) : reverse_primers = get_rev_primer_seqs ( open ( mapping_fp , 'U' ) ) ( output_fp , log_fp ) = get_output_filepaths ( output_dir , fasta_fp ) log_data = truncate_rev_primers ( open ( fasta_fp , 'U' ) , open ( output_fp , 'w' ) , reverse_primers , truncate_option , primer_mismatches ) log_data [ 'fasta_fp' ] = fasta_fp log_data [ 'mapping_fp' ] = mapping_fp log_data [ 'truncate_option' ] = truncate_option log_data [ 'primer_mismatches' ] = primer_mismatches write_log_file ( log_data , open ( log_fp , 'w' ) )
main program function for finding .