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;
}