CanvasClean.CanvasClean.RemoveBinsWithExtremeLocalSD C# (CSharp) Method

RemoveBinsWithExtremeLocalSD() static private method

Remove bin regions with extreme local standard deviation (SD). Assume that MadOfDiffs has been set in GetLocalStandardDeviationAverage().
static private RemoveBinsWithExtremeLocalSD ( List bins, double localSDaverage, double threshold, string outFile ) : List
bins List Genomic bins from which we filter out local SD outliers associated with FFPE biases.
localSDaverage double
threshold double Median SD value which is used to determine whereas to run RemoveBinsWithExtremeLocalMad on a sample and which set of bins to remove (set as threshold*5).
outFile string
return List
        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;
        }