Exemplo n.º 1
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other InterveningDNA instance.</param>
 private InterveningDna(InterveningDna other)
     : base(other) { }
Exemplo n.º 2
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other InterveningDNA instance.</param>
 private InterveningDna(InterveningDna other)
     : base(other)
 {
 }
Exemplo n.º 3
0
        public void ValidateGenBankInterveningDNAFeatureQualifiers()
        {
            // Get Values from XML node.
            string filePath = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankInterveningDNA, Constants.FilePathNode);
            string iDNALocation = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankInterveningDNA, Constants.Location);
            string featureCount = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankInterveningDNA, Constants.QualifierCount);

            // Parse a GenBank file.
            ISequenceParser parserObj = new GenBankParser();
            {
                IEnumerable<ISequence> seqList = parserObj.Parse(filePath);
                var locBuilder = new LocationBuilder();

                var metadata =
                    (GenBankMetadata) seqList.ElementAt(0).Metadata[Constants.GenBank];
                List<InterveningDna> iDNAList = metadata.Features.InterveningDNAs;

                // Create a clone copy and validate.
                InterveningDna iDNAClone = iDNAList[0].Clone();
                Assert.AreEqual(iDNAList.Count.ToString((IFormatProvider) null), featureCount);
                Assert.IsTrue(string.IsNullOrEmpty(iDNAClone.GeneSymbol.ToString(null)));
                Assert.IsFalse(string.IsNullOrEmpty(iDNAClone.DatabaseCrossReference.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(iDNAClone.Allele));
                Assert.IsFalse(string.IsNullOrEmpty(iDNAList[0].Citation.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(iDNAList[0].Experiment.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(iDNAList[0].GenomicMapPosition));
                Assert.IsFalse(string.IsNullOrEmpty(iDNAList[0].GeneSynonym.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(iDNAList[0].Inference.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(iDNAList[0].Label));
                Assert.AreEqual(locBuilder.GetLocationString(
                    metadata.Features.InterveningDNAs[0].Location), iDNALocation);
                Assert.IsFalse(string.IsNullOrEmpty(iDNAList[0].Note.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(iDNAList[0].OldLocusTag.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(iDNAList[0].LocusTag.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(iDNAList[0].OldLocusTag.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(iDNAList[0].Function.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(iDNAList[0].Number));
                Assert.IsTrue(string.IsNullOrEmpty(iDNAList[0].StandardName));

                // Create a new Intervening DNA signal and validate the same.
                var iDNA = new InterveningDna(iDNALocation);
                var iDNAWithIloc = new InterveningDna(
                    metadata.Features.DisplacementLoops[0].Location);

                // Set qualifiers and validate them.
                iDNA.GeneSymbol = iDNALocation;
                iDNAWithIloc.GeneSymbol = iDNALocation;
                Assert.AreEqual(iDNA.GeneSymbol, iDNALocation);
                Assert.AreEqual(iDNAWithIloc.GeneSymbol, iDNALocation);

                // Log VSTest GUI.
                ApplicationLog.WriteLine(
                    "GenBank Features P1: Successfully validated the GenBank Features");
            }
        }