コード例 #1
0
        public void FormatIndicesTest()
        {
            const string formatColumn   = "AU:GU:TAR:FT:GQ:DP:VF:CU:TU:TIR:GT:GQX:BOB:DPI:NV:NR";
            var          formatIndicies = FormatIndices.Extract(formatColumn);

            Assert.Equal(0, formatIndicies.AU);
            Assert.Equal(7, formatIndicies.CU);
            Assert.Equal(1, formatIndicies.GU);
            Assert.Equal(8, formatIndicies.TU);
            Assert.Equal(15, formatIndicies.NR);
            Assert.Equal(2, formatIndicies.TAR);
            Assert.Equal(9, formatIndicies.TIR);
            Assert.Equal(3, formatIndicies.FT);
            Assert.Equal(10, formatIndicies.GT);
            Assert.Equal(4, formatIndicies.GQ);
            Assert.Equal(11, formatIndicies.GQX);
            Assert.Equal(5, formatIndicies.DP);
            Assert.Equal(6, formatIndicies.VF);
            Assert.Equal(13, formatIndicies.DPI);
            Assert.Equal(14, formatIndicies.NV);

            Assert.Null(FormatIndices.Extract(null));

            formatIndicies = FormatIndices.Extract("TEMP:DPI:BOB");
            Assert.Equal(1, formatIndicies.DPI);
            Assert.Null(formatIndicies.AU);
        }
コード例 #2
0
        public void IntermediateSampleFields_AlleleCounts()
        {
            const string vcfLine = "chr1\t5592503\t.\tC\tT\t900.00\tPASS\t.\tGT:AU:CU:GU:TU:DP:DPF:AD\t1/1:10,11:20,21:30,31:40,41:70:3:0,70";
            var          cols    = vcfLine.Split('\t');

            var formatIndices = FormatIndices.Extract(cols[VcfCommon.FormatIndex]);
            var sampleCols    = cols[VcfCommon.GenotypeIndex].Split(':');
            var sampleFields  = new IntermediateSampleFields(cols, formatIndices, sampleCols);

            Assert.Equal(10, sampleFields.ACount);
            Assert.Equal(20, sampleFields.CCount);
            Assert.Equal(30, sampleFields.GCount);
            Assert.Equal(40, sampleFields.TCount);
        }
コード例 #3
0
        public void FormatIndicesTest()
        {
            const string formatColumn   = "AU:GU:TAR:FT:GQ:DP:VF:CU:TU:TIR:GT:GQX:BOB:DPI:NV:NR:CHC:DST:PCH:DCS:DID:PLG:PCN:MAD:SCH:AQ:LQ";
            var          formatIndicies = FormatIndices.Extract(formatColumn);

            Assert.Equal(0, formatIndicies.AU);
            Assert.Equal(7, formatIndicies.CU);
            Assert.Equal(1, formatIndicies.GU);
            Assert.Equal(8, formatIndicies.TU);
            Assert.Equal(15, formatIndicies.NR);
            Assert.Equal(2, formatIndicies.TAR);
            Assert.Equal(9, formatIndicies.TIR);
            Assert.Equal(3, formatIndicies.FT);
            Assert.Equal(10, formatIndicies.GT);
            Assert.Equal(4, formatIndicies.GQ);
            Assert.Equal(11, formatIndicies.GQX);
            Assert.Equal(5, formatIndicies.DP);
            Assert.Equal(6, formatIndicies.VF);
            Assert.Equal(13, formatIndicies.DPI);
            Assert.Equal(14, formatIndicies.NV);
            Assert.Equal(16, formatIndicies.CHC);
            Assert.Equal(17, formatIndicies.DST);
            Assert.Equal(18, formatIndicies.PCH);
            Assert.Equal(19, formatIndicies.DCS);
            Assert.Equal(20, formatIndicies.DID);
            Assert.Equal(21, formatIndicies.PLG);
            Assert.Equal(22, formatIndicies.PCN);
            Assert.Equal(23, formatIndicies.MAD);
            Assert.Equal(24, formatIndicies.SCH);
            Assert.Equal(25, formatIndicies.AQ);
            Assert.Equal(26, formatIndicies.LQ);

            Assert.Null(FormatIndices.Extract(null));

            formatIndicies = FormatIndices.Extract("TEMP:DPI:BOB");
            Assert.Equal(1, formatIndicies.DPI);
            Assert.Null(formatIndicies.AU);
        }