public void GetAltAllelesAndGenotypes_one_sample_ploidy_zero() { int[][] alleleCopyNumbers = { new[] { -1 } }; var(altAlleleString, sampleGenotypes) = CanvasSegmentWriter.GetAltAllelesAndGenotypes(alleleCopyNumbers); string[] expectedGenotypes = { "." }; Assert.Equal(".", altAlleleString); Assert.Equal(expectedGenotypes, sampleGenotypes); }
public void GetAltAllelesAndGenotypes_only_reference() { int[][] alleleCopyNumbers = { new[] { 1, 1 }, // Ref new[] { 1, 1 } // Ref again }; var(altAlleleString, sampleGenotypes) = CanvasSegmentWriter.GetAltAllelesAndGenotypes(alleleCopyNumbers); string[] expectedGenotypes = { "0/0", "0/0" }; Assert.Equal(".", altAlleleString); Assert.Equal(expectedGenotypes, sampleGenotypes); }
public void GetAltAllelesAndGenotypes_hemizygous_regions() { int[][] alleleCopyNumbers = { new[] { 0 }, // Loss new[] { 1 }, // Ref new[] { 2 } // Gain }; var(altAlleleString, sampleGenotypes) = CanvasSegmentWriter.GetAltAllelesAndGenotypes(alleleCopyNumbers); string[] expectedGenotypes = { "1", "0", "2" }; Assert.Equal("<CN0>,<CN2>", altAlleleString); Assert.Equal(expectedGenotypes, sampleGenotypes); }
public void GetAltAllelesAndGenotypes_various_genotypes() { int[][] alleleCopyNumbers = { new[] { -1, int.MaxValue }, // <DUP> new[] { 1, 1 }, // Ref new[] { 0, 1 }, // Loss new[] { 1, 2 }, // Gain new[] { 0, 3 }, // Gain new[] { 2, 2 }, // Gain new [] { 0, 2 }, // LOH new [] { -1, -1 }, // CN=2, MCC null new [] { -1 } // Ploidy == 0 }; var(altAlleleString, sampleGenotypes) = CanvasSegmentWriter.GetAltAllelesAndGenotypes(alleleCopyNumbers); string[] expectedGenotypes = { "./4", "0/0", "0/1", "0/2", "1/3", "2/2", "1/2", "./.", "." }; Assert.Equal("<CN0>,<CN2>,<CN3>,<DUP>", altAlleleString); Assert.Equal(expectedGenotypes, sampleGenotypes); }