Ejemplo n.º 1
0
        public void BasicReadTest()
        {
            var sequenceProvider = GetSequenceProvider(GenomeAssembly.GRCh37, new Chromosome("chr17", "17", 16), 41234419, "A");
            var reader           = new ClinVarXmlReader(new FileInfo(Resources.ClinvarXmlFiles("RCV000077146.xml")), sequenceProvider);

            Assert.True(reader.GetItems().Any());

            foreach (var clinVarItem in reader.GetItems())
            {
                Assert.Equal("RCV000077146.3", clinVarItem.Id);

                switch (clinVarItem.Id)
                {
                case "RCV000077146.3":
                    Assert.Equal("17", clinVarItem.Chromosome.EnsemblName);
                    Assert.Equal(41234419, clinVarItem.Start);
                    Assert.Equal("A", clinVarItem.ReferenceAllele);
                    Assert.Equal("C", clinVarItem.AlternateAllele);
                    Assert.Equal(ClinVarXmlReader.ParseDate("2016-07-31"), clinVarItem.LastUpdatedDate);
                    Assert.True(clinVarItem.AlleleOrigins.SequenceEqual(new List <string> {
                        "germline"
                    }));
                    Assert.Equal("C2676676", clinVarItem.MedGenIDs.First());
                    Assert.Equal("145", clinVarItem.OrphanetIDs.First());
                    Assert.Equal("604370", clinVarItem.OmimIDs.First());
                    Assert.Equal("Breast-ovarian cancer, familial 1", clinVarItem.Phenotypes.First());
                    Assert.Null(clinVarItem.PubmedIds);
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public void BasicReadTest()
        {
            var reader = new ClinVarXmlReader(new FileInfo(Resources.TopPath("RCV000077146.xml")), _reader, _sequence);

            foreach (var clinVarItem in reader)
            {
                Assert.Equal("RCV000077146.3", clinVarItem.ID);

                switch (clinVarItem.ID)
                {
                case "RCV000077146.3":
                    Assert.Equal("17", clinVarItem.Chromosome);
                    Assert.Equal(41234419, clinVarItem.Start);
                    Assert.Equal("A", clinVarItem.ReferenceAllele);
                    Assert.Equal("C", clinVarItem.AltAllele);
                    Assert.Equal(ClinVarXmlReader.ParseDate("2016-07-31"), clinVarItem.LastUpdatedDate);
                    Assert.True(clinVarItem.AlleleOrigins.SequenceEqual(new List <string> {
                        "germline"
                    }));
                    Assert.Equal("C2676676", clinVarItem.MedGenIDs.First());
                    Assert.Equal("145", clinVarItem.OrphanetIDs.First());
                    Assert.Equal("604370", clinVarItem.OmimIDs.First());
                    Assert.Equal("Breast-ovarian cancer, familial 1", clinVarItem.Phenotypes.First());
                    Assert.Null(clinVarItem.PubmedIds);
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        public void IndelTest()
        {
            var reader = new ClinVarXmlReader(new FileInfo(Resources.TopPath("RCV000032548.xml")), _reader, _sequence);

            foreach (var clinVarItem in reader)
            {
                Assert.Equal("RCV000032548.5", clinVarItem.ID);

                switch (clinVarItem.ID)
                {
                case "RCV000032548.5":
                    Assert.Equal("4", clinVarItem.Chromosome);
                    Assert.Equal(187122303, clinVarItem.Start);
                    Assert.Equal(17, clinVarItem.ReferenceAllele.Length);
                    Assert.Equal("GC", clinVarItem.AltAllele);
                    Assert.Equal(ClinVarXmlReader.ParseDate("2016-08-29"), clinVarItem.LastUpdatedDate);
                    break;
                }
            }
        }
Ejemplo n.º 4
0
        public void MultiEntryXmlParsing()
        {
            var reader = new ClinVarXmlReader(new FileInfo(Resources.TopPath("MultiClinvar.xml")), _reader, _sequence);

            var clinvarList = new List <ClinVarItem>();

            foreach (var clinVarItem in reader)
            {
                switch (clinVarItem.ID)
                {
                case "RCV000000064.5":
                    Assert.Equal(ClinVarXmlReader.ParseDate("2016-02-17"), clinVarItem.LastUpdatedDate);
                    Assert.Equal("risk factor", clinVarItem.Significance);
                    break;

                case "RCV000000068.3":
                    Assert.Equal(ClinVarXmlReader.ParseDate("2016-02-17"), clinVarItem.LastUpdatedDate);
                    Assert.Equal("pathogenic", clinVarItem.Significance);
                    Assert.Equal("C3150419", clinVarItem.MedGenIDs.First());
                    break;

                case "RCV000000069.3":
                    Assert.Equal(ClinVarXmlReader.ParseDate("2016-02-17"), clinVarItem.LastUpdatedDate);
                    Assert.Equal("pathogenic", clinVarItem.Significance);
                    Assert.Equal("C3150419", clinVarItem.MedGenIDs.First());
                    Assert.Equal(20179356, clinVarItem.PubmedIds.First());
                    break;

                default:
                    throw new InvalidDataException("Unexpected clinvar id encountered");
                }
                clinvarList.Add(clinVarItem);
            }

            clinvarList.Sort();
            Assert.Equal(2, clinvarList.Count);
            Assert.Equal("2", clinvarList[0].Chromosome);
            Assert.Equal("22", clinvarList[1].Chromosome);
        }
Ejemplo n.º 5
0
        public void IndelTest()
        {
            var sequenceProvider = GetSequenceProvider(GenomeAssembly.GRCh37, new Chromosome("chr4", "4", 3), 187122303, "ACGTACGTACGTACGTA");

            var reader = new ClinVarXmlReader(new FileInfo(Resources.ClinvarXmlFiles("RCV000032548.xml")), sequenceProvider);

            Assert.True(reader.GetItems().Any());

            foreach (var clinVarItem in reader.GetItems())
            {
                Assert.Equal("RCV000032548.5", clinVarItem.Id);

                switch (clinVarItem.Id)
                {
                case "RCV000032548.5":
                    Assert.Equal("4", clinVarItem.Chromosome.EnsemblName);
                    Assert.Equal(187122303, clinVarItem.Start);
                    Assert.Equal(17, clinVarItem.ReferenceAllele.Length);
                    Assert.Equal("GC", clinVarItem.AlternateAllele);
                    Assert.Equal(ClinVarXmlReader.ParseDate("2016-08-29"), clinVarItem.LastUpdatedDate);
                    break;
                }
            }
        }