/// <summary>
/// Assumes the bins are sorted by genomic coordinates
/// </summary>
/// <param name="bins">Bins whose counts are to be normalized</param>
/// <param name="countsByGC">An array of lists. Each array element (0-100) will hold a list of counts whose bins have the same GC content.</param>
/// <param name="counts">Will hold all of the autosomal counts present in 'bins'</param>
public static void GetCountsByGC(List <SampleGenomicBin> bins, NexteraManifest manifest, out List <float>[] countsByGC, out List <float> counts)
{
countsByGC = new List <float> [numberOfGCbins];
counts = new List <float>(bins.Count);
// Initialize the lists
for (int i = 0; i < countsByGC.Length; i++)
{
countsByGC[i] = new List <float>();
}
foreach (SampleGenomicBin bin in manifest == null ? bins : EnrichmentUtilities.GetOnTargetBins(bins, manifest))
{
if (!GenomeMetadata.SequenceMetadata.IsAutosome(bin.GenomicBin.Chromosome))
{
continue;
}
// Put the observed count in the GC-appropriate list.
countsByGC[bin.GenomicBin.GC].Add(bin.Count);
// Add to the global list of counts.
counts.Add(bin.Count);
}
}