You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2020. It is now read-only.
/// <summary>/// Estimate local standard deviation (SD)./// </summary>/// <param name="bins">Genomic bins from which we filter out local SD outliers associated with FFPE biases.</param>/// <param name="threshold">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).</param>/// The rationale of this function is that standard deviation of difference of consecutive bins values, when taken over a small range of bin (i.e. 20 bins),/// has a distinct distribution for FFPE compared to Fresh Frozen (FF) samples. This property is used to flag and remove such bins.staticdoublegetLocalStandardDeviation(List<GenomicBin>bins){// Will hold consecutive bin count difference (approximates Skellam Distribution: mean centred on zero so agnostic to CN changes)double[]countsDiffs=newdouble[bins.Count -1];for(intbinIndex=0;binIndex< bins.Count -1;binIndex++){
countsDiffs[binIndex]= Convert.ToDouble(bins[binIndex+1].Count - bins[binIndex].Count);}// holder of local SD values (SDs of 20 bins)List<double>localSDs=newList<double>();List<string>chromosomeBin=newList<string>();// calculate local SD metricintwindowSize=20;for(intwindowEnd= windowSize,windowStart=0;windowEnd< countsDiffs.Length;windowStart+=windowSize,windowEnd+=windowSize){doublelocalSD= Utilities.StandardDeviation(countsDiffs, windowStart, windowEnd);
localSDs.Add(localSD);
chromosomeBin.Add(bins[windowStart].Chromosome);for(intbinIndex= windowStart;binIndex<windowEnd;binIndex+=1){
bins[binIndex].MadOfDiffs =localSD;}}// average of local SD metricdoublelocalSDaverage= GetLocalStandardDeviationAverage(localSDs, chromosomeBin);returnlocalSDaverage;}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: