static List<GenomicBin> RemoveBinsWithExtremeLocalSD(List<GenomicBin> bins, double localSDaverage, double threshold, string outFile)
{
// Will hold FFPE outlier-removed bins
List<GenomicBin> strippedBins = new List<GenomicBin>();
// remove bins with extreme local SD (populating new list is faster than removing from existing one)
foreach (GenomicBin bin in bins)
{
// do not strip bins for samples with local SD metric average less then the threshold
if (bin.MadOfDiffs > threshold * 2.0 && localSDaverage > 5.0)
continue;
strippedBins.Add(bin);
}
return strippedBins;
}