parameters: (self, adapters, middle_threshold, extra_middle_trim_good_side,
                               extra_middle_trim_bad_side, scoring_scheme_vals,
                               start_sequence_names, end_sequence_names)
docstring: Aligns an adapter sequence to the whole read to find places where the read should be split.
docstring_summary: Aligns an adapter sequence to the whole read to find places where the read should be split.
docstring_tokens: Aligns an adapter sequence to the whole read to find places where the read should be split .
function: def find_middle_adapters(self, adapters, middle_threshold, extra_middle_trim_good_side,
                               extra_middle_trim_bad_side, scoring_scheme_vals,
                               start_sequence_names, end_sequence_names):
          """
          Aligns an adapter sequence to the whole read to find places where the read should be split.
          """
          masked_seq = self.get_seq_with_start_end_adapters_trimmed()
          for adapter_name, adapter_seq in adapters:
  
              # We keep aligning adapters as long we get strong hits, so we can find multiple
              # occurrences in a single read.
              while True:
                  full_score, _, read_start, read_end = align_adapter(masked_seq, adapter_seq,
                                                                      scoring_scheme_vals)
                  if full_score >= middle_threshold:
                      masked_seq = masked_seq[:read_start] + '-' * (read_end - read_start) + \
                          masked_seq[read_end:]
                      self.middle_adapter_positions.update(range(read_start, read_end))
  
                      self.middle_hit_str += '  ' + adapter_name + ' (read coords: ' + \
                                             str(read_start) + '-' + str(read_end) + ', ' + \
                                             'identity: ' + '%.1f' % full_score + '%)\n'
  
                      trim_start = read_start - extra_middle_trim_good_side
                      if adapter_name in start_sequence_names:
                          trim_start = read_start - extra_middle_trim_bad_side
  
                      trim_end = read_end + extra_middle_trim_good_side
                      if adapter_name in end_sequence_names:
                          trim_end = read_end + extra_middle_trim_bad_side
  
                      self.middle_trim_positions.update(range(trim_start, trim_end))
                  else:
                      break
function_tokens: def find_middle_adapters ( self , adapters , middle_threshold , extra_middle_trim_good_side , extra_middle_trim_bad_side , scoring_scheme_vals , start_sequence_names , end_sequence_names ) : masked_seq = self . get_seq_with_start_end_adapters_trimmed ( ) for adapter_name , adapter_seq in adapters : # We keep aligning adapters as long we get strong hits, so we can find multiple # occurrences in a single read. while True : full_score , _ , read_start , read_end = align_adapter ( masked_seq , adapter_seq , scoring_scheme_vals ) if full_score >= middle_threshold : masked_seq = masked_seq [ : read_start ] + '-' * ( read_end - read_start ) + masked_seq [ read_end : ] self . middle_adapter_positions . update ( range ( read_start , read_end ) ) self . middle_hit_str += '  ' + adapter_name + ' (read coords: ' + str ( read_start ) + '-' + str ( read_end ) + ', ' + 'identity: ' + '%.1f' % full_score + '%)\n' trim_start = read_start - extra_middle_trim_good_side if adapter_name in start_sequence_names : trim_start = read_start - extra_middle_trim_bad_side trim_end = read_end + extra_middle_trim_good_side if adapter_name in end_sequence_names : trim_end = read_end + extra_middle_trim_bad_side self . middle_trim_positions . update ( range ( trim_start , trim_end ) ) else : break