CanvasClean.CanvasClean.GetWeightedCounts C# (CSharp) Метод

GetWeightedCounts() приватный статический Метод

In case there are not enough read counts for a GC bin, construct a weighted list of read counts. Values from target bin i get full weight, the two neighboring bins get half weight, two-away neighbors get 1/4 weight, etc.
private static GetWeightedCounts ( List countsByGC, int gcBin ) : float>>.List
countsByGC List
gcBin int
Результат float>>.List
        private static List<Tuple<float, float>> GetWeightedCounts(List<float>[] countsByGC, int gcBin)
        {
            List<Tuple<float, float>> weightedCounts = new List<Tuple<float, float>>();
            int radius = 0;
            float weight = 1;
            while (weightedCounts.Count < defaultMinNumberOfBinsPerGC)
            {
                int gcWindowEnd = gcBin + radius;
                int gcWindowStart = gcBin - radius;
                if (gcWindowEnd >= countsByGC.Length && gcWindowStart < 0) { break; }

                if (gcWindowEnd < countsByGC.Length)
                {
                    weightedCounts.AddRange(countsByGC[gcWindowEnd].Select(c => Tuple.Create(c, weight)));
                }

                if (gcWindowStart != gcWindowEnd && gcWindowStart >= 0)
                {
                    weightedCounts.AddRange(countsByGC[gcWindowStart].Select(c => Tuple.Create(c, weight)));
                }
                radius++;
                weight /= 2;
            }

            return weightedCounts;
        }