def read_qual_score_filter(seq, qual, max_run_length, threshold):
 last_good_slice_end_pos = 0
 bad_run_length = 0
 mask = (qual <= threshold)
 for (starts, ends) in _contiguous_regions(mask):
  if ((ends - starts) > max_run_length):
   return (seq[:starts], qual[:starts])
 return (seq, qual)

def read_qual_score_filter ( seq , qual , max_run_length , threshold ) : last_good_slice_end_pos = 0 bad_run_length = 0 mask = ( qual <= threshold ) for ( starts , ends ) in _contiguous_regions ( mask ) : if ( ( ends - starts ) > max_run_length ) : return ( seq [ : starts ] , qual [ : starts ] ) return ( seq , qual )
slices illumina sequence and quality line based on quality filter .