This function selects a depth by analyzing the trade-off between dropping
samples (to increase depth) and lowering depth (to keep samples).
Calculate Yields: For every distinct sample depth in the dataset,
calculate the total number of observations that would remain if the
dataset were rarefied to that level.
$$Yield_d = d \times N_{\ge d}$$
Where \(d\) is the depth and \(N_{\ge d}\) is the number of samples
with at least that many reads.
Define Threshold: Calculate 10% of the total observations in the
original un-rarefied dataset.
Select Depth: Find the lowest depth \(d\) where the \(Yield_d\)
exceeds this 10% threshold.
This approach prioritizes keeping as many samples as possible, provided that
doing so doesn't discard more than 90% of the dataset's total information.