def trim_reference_sequence(fasta):
LOGGER.debug("<STR_LIT>".format(fasta[<NUM_LIT:0>]))<EOL>if "<STR_LIT>" in fasta[<NUM_LIT:1>]:<EOL><INDENT>r1_len = len(fasta[<NUM_LIT:1>].split("<STR_LIT:\n>")[<NUM_LIT:1>].split("<STR_LIT>")[<NUM_LIT:0>])<EOL>r2_len = len(fasta[<NUM_LIT:1>].split("<STR_LIT:\n>")[<NUM_LIT:1>].split("<STR_LIT>")[<NUM_LIT:1>])<EOL>new_seq = fasta[<NUM_LIT:0>].split("<STR_LIT:\n>")[<NUM_LIT:1>][:r1_len]+("<STR_LIT>")+ revcomp(fasta[<NUM_LIT:0>].split("<STR_LIT:\n>")[<NUM_LIT:1>][-r2_len:])<EOL>fasta[<NUM_LIT:0>] = fasta[<NUM_LIT:0>].split("<STR_LIT:\n>")[<NUM_LIT:0>]+"<STR_LIT:\n>"+new_seq<EOL><DEDENT>LOGGER.debug("<STR_LIT>".format(fasta[<NUM_LIT:0>]))<EOL>return fasta<EOL>
If doing PE and R1/R2 don't overlap then the reference sequence
will be quite long and will cause indel hell during the 
alignment stage. Here trim the reference sequence to the length
of the merged reads. Input is a list of alternating locus labels
and sequence data. The first locus label is the reference
sequence label and the first seq is the reference seq. Returns
the same list except with the reference sequence trimmed to
the length of the rad tags