Пример #1
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other PolyASignal instance.</param>
 private PolyASignal(PolyASignal other)
     : base(other) { }
Пример #2
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other PolyASignal instance.</param>
 private PolyASignal(PolyASignal other)
     : base(other)
 {
 }
Пример #3
0
        public void ValidateGenBankPolyASignalFeatureQualifiers()
        {
            // Get Values from XML node.
            string filePath = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankPolyASignalNode, Constants.FilePathNode);
            string polyALocation = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankPolyASignalNode, Constants.Location);
            string featureCount = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankPolyASignalNode, Constants.QualifierCount);
            string geneSymbol = utilityObj.xmlUtil.GetTextValue(
                Constants.GenBankPolyASignalNode, Constants.GeneSymbol);

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

                // Validate Minus35Signal feature all qualifiers.
                var metadata =
                    (GenBankMetadata) seqList.ElementAt(0).Metadata[Constants.GenBank];
                List<PolyASignal> polyASignalList = metadata.Features.PolyASignals;

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

                // Create a new PolyA signal and validate the same.
                var polyASignal = new PolyASignal(polyALocation);
                var polyASignalWithILoc = new PolyASignal(
                    metadata.Features.Minus10Signals[0].Location);

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

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