def guess_even_sampling_depth(counts_per_sample, num_deviations=2.25):
 counts_per_sample.sort()
 (median_abs_dev, median_count) = median_absolute_deviation(counts_per_sample)
 min_threshold = (median_count - (num_deviations * median_abs_dev))
 for e in counts_per_sample:
  if (e >= min_threshold):
   return e
 raise ValueError((('No acceptable even sampling depth identified. ' + "It shouldn't be possible to get here, but just in case here's the ") + 'counts per sample: %s '.join(map(str, counts_per_sample))))

def guess_even_sampling_depth ( counts_per_sample , num_deviations = 2.25 ) : counts_per_sample . sort ( ) ( median_abs_dev , median_count ) = median_absolute_deviation ( counts_per_sample ) min_threshold = ( median_count - ( num_deviations * median_abs_dev ) ) for e in counts_per_sample : if ( e >= min_threshold ) : return e raise ValueError ( ( ( 'No acceptable even sampling depth identified. ' + "It shouldn't be possible to get here, but just in case here's the " ) + 'counts per sample: %s ' . join ( map ( str , counts_per_sample ) ) ) )
guess a depth for even sampling this is currently computed as the smallest seqs per sample count >= the median seqs per sample count - .