def generate_lane_mask(aln, entropy_threshold):
 if (entropy_threshold == 0.0):
  result = (['1'] * aln.sequence_length())
 else:
  entropies = aln.position_entropies(nan_on_non_standard_chars=False)
  entropy_cutoff = np.percentile(entropies, ((1 - entropy_threshold) * 100.0), interpolation='nearest')
  result = []
  for entropy in entropies:
   if (entropy >= entropy_cutoff):
    result.append('0')
   else:
    result.append('1')
 return ''.join(result)

def generate_lane_mask ( aln , entropy_threshold ) : if ( entropy_threshold == 0.0 ) : result = ( [ '1' ] * aln . sequence_length ( ) ) else : entropies = aln . position_entropies ( nan_on_non_standard_chars = False ) entropy_cutoff = np . percentile ( entropies , ( ( 1 - entropy_threshold ) * 100.0 ) , interpolation = 'nearest' ) result = [ ] for entropy in entropies : if ( entropy >= entropy_cutoff ) : result . append ( '0' ) else : result . append ( '1' ) return '' . join ( result )
generates lane mask dynamically by calculating base frequencies aln: skbio .