Exemplo n.º 1
0
        public void BlankRefName()
        {
            const string vcfLine = "1	1	.	N	.	.	LowGQX	END=10004;BLOCKAVG_min30p3a	GT:GQX:DP:DPF	.:.:0:0";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.True(variant.IsReference);
        }
Exemplo n.º 2
0
        public void GenotypeParsing()
        {
            const string vcfLine = "chr1	24538137	.	C	.	.	PASS	.	GT:GQX:DP:DPF	0/0:99:34:2";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.True(variant.IsReference);
        }
Exemplo n.º 3
0
        public void Insertion()
        {
            const string vcfLine = "chr22	15883626	P1_MEI_4726	T	<INS>	40	.	SVTYPE=INS;CIPOS=-23,23;IMPRECISE;NOVEL;SVMETHOD=SR;NSF5=1;NSF3=0";

            var altAllele = new VariantAlternateAllele(15883627, 15883626, "T", "insertion")
            {
                VepVariantType      = VariantType.insertion,
                IsStructuralVariant = true,
                AlternateAllele     = "insertion"
            };

            var expectedReferenceName    = "chr22";
            var expectedAlternateAlleles = new List <VariantAlternateAllele> {
                altAllele
            };
            var expectedVcfReferenceBegin = altAllele.Start - 1;
            var expectedVcfReferenceEnd   = altAllele.End;

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Equal(expectedReferenceName, variant.ReferenceName);
            Assert.Equal(expectedVcfReferenceBegin, variant.VcfReferenceBegin);
            Assert.Equal(expectedVcfReferenceEnd, variant.VcfReferenceEnd);
            Assert.True(expectedAlternateAlleles.SequenceEqual(variant.AlternateAlleles));
        }
Exemplo n.º 4
0
        public void Cnv()
        {
            const string vcfLine = "chr1	713044	DUP_gs_CNV_1_713044_755966	C	<CN0>,<CN2>	100	PASS	AC=3,206;AF=0.000599042,0.0411342;AN=5008;CS=DUP_gs;END=755966;NS=2504;SVTYPE=CNV;DP=20698;EAS_AF=0.001,0.0615;AMR_AF=0.0014,0.0259;AFR_AF=0,0.0303;EUR_AF=0.001,0.0417;SAS_AF=0,0.045";

            var altAllele = new VariantAlternateAllele(713045, 755966, "C", "CN0")
            {
                VepVariantType      = VariantType.copy_number_variation,
                IsStructuralVariant = true
            };

            var altAllele2 = new VariantAlternateAllele(713045, 755966, "C", "CN2")
            {
                VepVariantType      = VariantType.copy_number_variation,
                IsStructuralVariant = true
            };

            var expectedReferenceName    = "chr1";
            var expectedAlternateAlleles = new List <VariantAlternateAllele> {
                altAllele, altAllele2
            };
            var expectedVcfReferenceBegin = altAllele.Start - 1;
            var expectedVcfReferenceEnd   = altAllele.End;

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Equal(expectedReferenceName, variant.ReferenceName);
            Assert.Equal(expectedVcfReferenceBegin, variant.VcfReferenceBegin);
            Assert.Equal(expectedVcfReferenceEnd, variant.VcfReferenceEnd);
            Assert.True(expectedAlternateAlleles.SequenceEqual(variant.AlternateAlleles));
        }
Exemplo n.º 5
0
        public void Duplication2()
        {
            const string vcfLine = "chrX	66764988	.	G	<DUP>	100	PASS	IMPRECISE;SVTYPE=DUP;END=66943683;SVLEN=178696;CIPOS=-1,1;CIEND=-1,1;DP=2635";

            var altAllele = new VariantAlternateAllele(66764989, 66943683, "G", "duplication")
            {
                VepVariantType      = VariantType.duplication,
                IsStructuralVariant = true,
                AlternateAllele     = "duplication"
            };

            var expectedReferenceName    = "chrX";
            var expectedAlternateAlleles = new List <VariantAlternateAllele> {
                altAllele
            };
            var expectedVcfReferenceBegin = altAllele.Start - 1;
            var expectedVcfReferenceEnd   = altAllele.End;

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Equal(expectedReferenceName, variant.ReferenceName);
            Assert.Equal(expectedVcfReferenceBegin, variant.VcfReferenceBegin);
            Assert.Equal(expectedVcfReferenceEnd, variant.VcfReferenceEnd);
            Assert.True(expectedAlternateAlleles.SequenceEqual(variant.AlternateAlleles));
        }
Exemplo n.º 6
0
        public void SvBeginPosition()
        {
            const string vcfLine = "1	964001	.	A	<DEL>	79	PASS	END=964423;SVTYPE=DEL;SVLEN=-422;IMPRECISE;CIPOS=-170,170;CIEND=-175,175;CSQT=1|AGRN|ENST00000379370|   GT:GQ:PR	   0/1:79:34,23";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Equal(964002, variant.AlternateAlleles[0].Start);
        }
Exemplo n.º 7
0
        public void StripUnwantedVcfInfoFields()
        {
            const string vcfLine = "chr4	55141055	rs1873778	A	G	1000	PASS	SNVSB=-9.6;SNVHPOL=3;RefMinor;AA=G;GMAF=G|0.9577;AF1000G=0.957668;EVS=0.9589|89|6503;phyloP=-5.707;cosmic=COSM1430082;CSQT=1|PDGFRA|ENST00000257290|synonymous_variant;CSQR=1|ENSR00001241308|regulatory_region_variant	GT      0/1";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Equal("SNVSB=-9.6;SNVHPOL=3", variant.VcfColumns[VcfCommon.InfoIndex]);
        }
Exemplo n.º 8
0
        public void RepeatExpansion()
        {
            const string vcfLine = "chrX	146993568	FMR1	G	<REPEAT:EXPANSION>	1.0	NoSuppReads	REPEAT_COUNT1=30,33";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);
            const int    expectedReferenceBegin = 146993569;

            Assert.Equal(expectedReferenceBegin, variant.AlternateAlleles[0].Start);
        }
Exemplo n.º 9
0
        public void MissingVid()
        {
            const string vcfLine = "chr4	92647305	MantaBND:1703:0:1:0:0:0:0	A	A[JTFH01000254.1:1952[	49	MinGQ	SVTYPE=BND;MATEID=MantaBND:1703:0:1:0:0:0:1;CIPOS=0,2;HOMLEN=2;HOMSEQ=AG;BND_DEPTH=6;MATE_BND_DEPTH=3	GT:FT:GQ:PL:PR:SR       0/0:MinGQ:7:44,0,18:1,0:0,1	0/0:MinGQ:12:39,0,45:1,2:1,0	1/1:MinGQ:5:99,6,0:0,0:0,2";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Equal("4:92647305:+:JTFH01000254.1:1952:+", variant.AlternateAlleles[0].VariantId);
        }
Exemplo n.º 10
0
        public void BreakendVid2()
        {
            // NIR-941
            const string vcfLine = "chr1	9121449	MantaBND:542:0:2:0:0:0:0	C	[chr14:93712486[C	518	PASS	SVTYPE=BND;MATEID=MantaBND:542:0:2:0:0:0:1;CIPOS=0,4;HOMLEN=4;HOMSEQ=CCTG;BND_DEPTH=49;MATE_BND_DEPTH=48	GT:GQ:PR:SR	0/1:518:33,2:32,15";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            // the naming convention for breakends is different
            Assert.Equal("1:9121449:-:14:93712486:+", variant.AlternateAlleles[0].VariantId);
        }
Exemplo n.º 11
0
        public void SvVidChrName()
        {
            // NIR-941
            const string vcfLine = "chr1	814866	Canvas:GAIN:chr1:814867:824517	N	<CNV>	4	q10;CLT10kb	SVTYPE=CNV;END=824517;CSQ=CNV|upstream_gene_variant|MODIFIER|FAM41C|284593|Transcript|NR_027055.1|misc_RNA|||||||||||2685|-1|||YES|||rseq_mrna_match&rseq_ens_no_match|||||||	  RC:BC:CN\t214:7:4";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            // the naming convention for breakends is different
            Assert.Equal("1:814867:824517:4", variant.AlternateAlleles[0].VariantId);
        }
Exemplo n.º 12
0
        public void CanvasCopyNumberShouldNotReportInPosition()
        {
            const string vcfLine =
                "1	723707	Canvas:GAIN:1:723708:2581225	N	<CNV>	41	PASS	SVTYPE=CNV;END=2581225	RC:BC:CN:MCC	.	129:3123:3:2";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Null(variant.CopyNumber);
        }
Exemplo n.º 13
0
        public void VariantFeatureEquals(string vcfLine, bool isEqual)
        {
            var variant1 = VcfUtilities.GetVariant("chr4	55141055	rs1873778	A	G,T	1000	PASS	.	.", _renamer);
            var variant2 = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Equal(isEqual, variant1.Equals(variant2));
            Assert.Equal(true, variant1.Equals(variant1));
            Assert.Equal(false, variant1.Equals(null));
        }
Exemplo n.º 14
0
        public void BreakendVid1()
        {
            // NIR-941
            const string vcfLine = "chr1	797265	MantaBND:10:0:1:0:2:0:0	G	G]chr8:245687]	55	PASS	SVTYPE=BND;MATEID=MantaBND:10:0:1:0:2:0:1;CIPOS=0,31;HOMLEN=31;HOMSEQ=ATTGATAGATGATAGGTAGATAGTAGATAGA;BND_DEPTH=59;MATE_BND_DEPTH=41	   GT:GQ:PR:SR	0/1:55:39,6:20,3";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            // the naming convention for breakends is different
            Assert.Equal("1:797265:+:8:245687:-", variant.AlternateAlleles[0].VariantId);
        }
Exemplo n.º 15
0
        public void BreakEndBegin()
        {
            // NIR-1234
            const string vcfLine = "1	28722335	MantaBND:4051:0:2:0:0:0:0	T	[3:115024109[T	.	PASS	SVTYPE=BND;MATEID=MantaBND:4051:0:2:0:0:0:1;IMPRECISE;CIPOS=-209,210;SOMATIC;SOMATICSCORE=42;BND_DEPTH=23;MATE_BND_DEPTH=24     PR      25,0    71,10";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.True(variant.IsStructuralVariant);
            Assert.Equal(28722335, variant.AlternateAlleles[0].Start);
        }
Exemplo n.º 16
0
        public void ParseStrandBias()
        {
            // NIR-1235
            const string vcfLine =
                "chrX	2699246	rs148553620	C	A	250.95	VQSRTrancheSNP99.00to99.90	AC=2;AF=0.250;AN=8;BaseQRankSum=1.719;DB;DP=106;Dels=0.00;FS=20.202;HaplotypeScore=0.0000;MLEAC=2;MLEAF=0.250;MQ=43.50;MQ0=52;MQRankSum=2.955;QD=4.73;ReadPosRankSum=1.024;SB=-1.368e+02;VQSLOD=-0.3503;culprit=MQ;PLF  GT:AD:DP:GQ:PL:AA   0:10,6:16:9:0,9,118:P1,.	   0|1:12,11:23:27:115,0,27:M1,M2   0|0:37,0:37:18:0,18,236:M1,P1   1|0:13,17:30:59:177,0,59:M2,P1";
            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Equal(-136.8, variant.StrandBias);
        }
Exemplo n.º 17
0
        public void SingleNucleotideVariant()
        {
            var variant   = VcfUtilities.GetVariant("4	100	.	T	A	.	.	.", _renamer);
            var altAllele = variant.AlternateAlleles[0];

            const string expectedVid = "4:100:A";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, altAllele);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 18
0
        public void InsertionDeletion()
        {
            var variant = VcfUtilities.GetVariant("4	99	.	GTAGGT	GCCCCCC	.	.	.", _renamer);

            const string expectedVid = "4:100:104:CCCCCC";
            var          altAllele   = variant.AlternateAlleles[0];
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, altAllele);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 19
0
        public void ParseStrelkaJointSomaticNormalQuality()
        {
            const string vcfLine =
                "9\t46530\t.\tC\tCG\t.\tQSI_ref\tSOMATIC;QSI=2;TQSI=1;NT=het;QSI_NT=2;TQSI_NT=1;SGT=ref->ref;RU=G;RC=0;IC=1;IHP=2\tDP:DP2:TAR:TIR:TOR:DP50:FDP50:SUBDP50\t13:13:10,12:3,7:0,2:14.49:0.00:0.00\t72:72:67,67:0,1:5,6:75.31:0.38:0.00";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.NotNull(variant.JointSomaticNormalQuality);
            Assert.Equal(2, variant.JointSomaticNormalQuality.Value);
        }
Exemplo n.º 20
0
        public void ParseSvLen()
        {
            const string vcfLine = "1	1594584	MantaDEL:164:0:1:1:0:0	C	<DEL>	.	MGE10kb	END=1660503;SVTYPE=DEL;SVLEN=-65919;IMPRECISE;CIPOS=-285,285;CIEND=-205,205;SOMATIC;SOMATICSCORE=36;ColocalizedCanvas PR 42,0 226,9";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            Assert.Equal(1594584, variant.VcfReferenceBegin);
            Assert.Equal(1594585, variant.AlternateAlleles[0].Start);
            Assert.Equal(1660503, variant.AlternateAlleles[0].End);
            Assert.Equal(65919, variant.SvLength);
        }
Exemplo n.º 21
0
        public void Alu()
        {
            const string vcfLine = "1	645710	ALU_umary_ALU_2	A	<INS:ME:ALU>	100	PASS	AC=35;AF=0.00698882;AN=5008;CS=ALU_umary;MEINFO=AluYa4_5,1,223,-;NS=2504;SVLEN=222;SVTYPE=ALU;TSD=null;DP=12290;EAS_AF=0.0069;AMR_AF=0.0072;AFR_AF=0;EUR_AF=0.0189;SAS_AF=0.0041";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "1:645711:645932:MEI";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 22
0
        public void CopyNumberVariation()
        {
            const string vcfLine = "1	9319324	Canvas:GAIN:1:9319325:9404899	N	<CNV>	36	PASS	SVTYPE=CNV;END=9404899	RC:BC:CN:MCC	.	144:104:6:4";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "1:9319325:9404899:6";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 23
0
        public void CopyNumberFromSomatic()
        {
            // NIR-811
            const string vcfLine = "1	816119	.	N	<CNV>	6	q10	SVTYPE=CNV;END=826343;CSQT=1|AL645608.2|ENST00000594233|	RC:BC:CN	186:11:4";
            var          variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "1:816120:826343:4";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 24
0
        public void Sva()
        {
            const string vcfLine = "1	1517860	SVA_umary_SVA_1	A	<INS:ME:SVA>	100	PASS	AC=3;AF=0.000599042;AN=5008;CS=SVA_umary;MEINFO=SVA,44,394,+;NS=2504;SVLEN=350;SVTYPE=SVA;TSD=null;DP=18602;EAS_AF=0.001;AMR_AF=0;AFR_AF=0.0015;EUR_AF=0;SAS_AF=0";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "1:1517861:1518210:MEI";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 25
0
        public void SvDeletion()
        {
            const string vcfLine = "1	207981229	MantaDEL:9144:0:1:0:0:0	A	<DEL>	.	MGE10kb	END=208014817;SVTYPE=DEL;SVLEN=-33588;CIPOS=0,4;CIEND=0,4;HOMLEN=4;HOMSEQ=GAGG;SOMATIC;SOMATICSCORE=44;ColocalizedCanvas	PR:SR	13,0:16,0	23,4:19,4";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "1:207981230:208014817";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 26
0
        public void SvDuplication()
        {
            const string vcfLine = "1	55024355	DUP_delly_DUP22372	C	<CN2>	100	PASS	AC=3;AF=0.000599042;AN=5008;CIEND=-150,150;CIPOS=-150,150;CS=DUP_delly;END=55050323;NS=2504;SVLEN=25968;SVTYPE=DUP;IMPRECISE;DP=19622;EAS_AF=0.001;AMR_AF=0;AFR_AF=0;EUR_AF=0;SAS_AF=0.002";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "1:55024356:55050323:DUP";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 27
0
        public void SvInsertion()
        {
            const string vcfLine = "12	129771777	MantaINS:104437:0:0:0:3:0	A	<INS>	.	PASS	END=129771779;SVTYPE=INS;LEFT_SVINSSEQ=TCTCACTCATAGGTGGGAATTGAACAATGAGATCACATGGACACAGGAAGGGGAATATCACACTCT;RIGHT_SVINSSEQ=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;SOMATIC;SOMATICSCORE=34	PR:SR	7,0:8,0	5,0:14,9";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "12:129771778:129771779:INS";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 28
0
        public void SvTranslocationBreakEnd()
        {
            const string vcfLine = "1	160359958	MantaBND:6887:0:1:0:0:0:1	G	G]3:19392235]	.	PASS	SVTYPE=BND;MATEID=MantaBND:6887:0:1:0:0:0:0;IMPRECISE;CIPOS=-137,137;SOMATIC;SOMATICSCORE=41;BND_DEPTH=22;MATE_BND_DEPTH=11	PR	21,0	41,7";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "1:160359958:+:3:19392235:-";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 29
0
        public void SvTandemDuplication()
        {
            const string vcfLine = "1	224646603	MantaDUP:TANDEM:9996:0:1:0:0:0	A	<DUP:TANDEM>	.	MGE10kb	END=224800119;SVTYPE=DUP;SVLEN=153516;SVINSLEN=37;SVINSSEQ=CAAAACTTACTATAGCAGTTCTGTGAGCTGCTCTAGC;SOMATIC;SOMATICSCORE=58;ColocalizedCanvas	PR:SR	26,0:20,0	51,10:60,12";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "1:224646604:224800119:TDUP";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }
Exemplo n.º 30
0
        public void SvInversion()
        {
            const string vcfLine = "2	70850318	MantaINV:15204:1:2:0:0:0	T	<INV>	.	MinSomaticScore	END=71389878;SVTYPE=INV;SVLEN=539560;IMPRECISE;CIPOS=-134,135;CIEND=-144,145;INV5;SOMATIC;SOMATICSCORE=11	PR	9,0	31,5";

            var variant = VcfUtilities.GetVariant(vcfLine, _renamer);

            const string expectedVid = "2:70850319:71389878:Inverse";
            var          observedVid = _vid.Create(_renamer, variant.ReferenceName, variant.AlternateAlleles[0]);

            Assert.Equal(expectedVid, observedVid);
        }