Example #1
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other DisplacementLoop instance.</param>
 private DisplacementLoop(DisplacementLoop other)
     : base(other) { }
Example #2
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other DisplacementLoop instance.</param>
 private DisplacementLoop(DisplacementLoop other)
     : base(other)
 {
 }
        public void ValidateGenBankDLoopFeatureQualifiers()
        {
            // Get Values from XML node.
            string filePath = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankDLoopNode, Constants.FilePathNode);
            string dLoopLocation = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankDLoopNode, Constants.Location);
            string featureCount = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankDLoopNode, Constants.QualifierCount);
            string geneSymbol = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankDLoopNode, Constants.GeneSymbol);

            // 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<DisplacementLoop> dLoopList = metadata.Features.DisplacementLoops;

                // Create a clone of DLoop feature feature.
                DisplacementLoop cloneDLoop = dLoopList[0].Clone();
                Assert.AreEqual(dLoopList.Count.ToString((IFormatProvider) null), featureCount);
                Assert.AreEqual(cloneDLoop.GeneSymbol, geneSymbol);
                Assert.IsFalse(string.IsNullOrEmpty(cloneDLoop.DatabaseCrossReference.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(dLoopList[0].Allele.ToString(null)));
                Assert.IsFalse(string.IsNullOrEmpty(dLoopList[0].Citation.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(dLoopList[0].Experiment.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(dLoopList[0].GenomicMapPosition));
                Assert.IsFalse(string.IsNullOrEmpty(dLoopList[0].GeneSynonym.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(dLoopList[0].Inference.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(dLoopList[0].Label));
                Assert.AreEqual(locBuilder.GetLocationString(
                    metadata.Features.DisplacementLoops[0].Location), dLoopLocation);
                Assert.IsFalse(string.IsNullOrEmpty(dLoopList[0].Note.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(dLoopList[0].OldLocusTag.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(dLoopList[0].LocusTag.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(dLoopList[0].OldLocusTag.ToString()));

                // Create a new DLoop signal and validate the same.
                var dLoop = new DisplacementLoop(dLoopLocation);
                var dLoopWithIloc = new DisplacementLoop(
                    metadata.Features.DisplacementLoops[0].Location);

                // Set qualifiers and validate them.
                dLoop.GeneSymbol = geneSymbol;
                dLoopWithIloc.GeneSymbol = geneSymbol;
                Assert.AreEqual(dLoop.GeneSymbol, geneSymbol);
                Assert.AreEqual(dLoopWithIloc.GeneSymbol, geneSymbol);

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