Пример #1
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other MessengerRNA instance.</param>
 private MessengerRna(MessengerRna other)
     : base(other) { }
Пример #2
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other MessengerRNA instance.</param>
 private MessengerRna(MessengerRna other)
     : base(other)
 {
 }
Пример #3
0
        /// <summary>
        ///     Validate GenBank mRNA features.
        /// </summary>
        /// <param name="nodeName">xml node name.</param>
        private void ValidateGenBankmRNAFeatureQualifiers(string nodeName)
        {
            // Get Values from XML node.
            string filePath = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.FilePathNode);
            string mRNAGeneSymbol = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.MRNAGeneSymbol);
            string mRNAComplement = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.MRNAComplement);
            string mRNADBCount = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.CDSCodonStart);
            string mRNAStart = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.MRNAComplementStart);
            string mRNAStdName = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.StandardNameNode);
            string mRNAAllele = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.CDSCodonStart);
            string mRNAOperon = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.AlleleNode);

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

                // Validate tRNA feature all qualifiers.
                var metadata =
                    (GenBankMetadata) seqList.ElementAt(0).Metadata[Constants.GenBank];
                List<MessengerRna> mRANsList =
                    metadata.Features.MessengerRNAs;

                // Create a copy of mRNA list
                MessengerRna mRNAClone = mRANsList[0].Clone();
                Assert.AreEqual(mRANsList[0].GeneSymbol.ToString(null),
                                mRNAGeneSymbol);
                Assert.AreEqual(mRANsList[0].DatabaseCrossReference.Count,
                                Convert.ToInt32(mRNADBCount, null));
                Assert.IsTrue(string.IsNullOrEmpty(mRNAClone.Allele));
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].Citation.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].Experiment.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].Function.ToString()));
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].GeneSynonym.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(mRANsList[0].GenomicMapPosition));
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].Inference.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(mRANsList[0].Label));
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].LocusTag.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(mRANsList[0].Operon.ToString(null)));
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].Product.ToString()));
                Assert.AreEqual(mRANsList[0].Location.Operator.ToString(),
                                mRNAComplement);
                Assert.IsNull(mRANsList[0].Location.Separator);
                Assert.AreEqual(mRANsList[0].Location.LocationStart,
                                Convert.ToInt32(mRNAStart, null));
                Assert.IsNull(mRANsList[0].Location.StartData);
                Assert.IsNull(mRANsList[0].Location.EndData);
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].OldLocusTag.ToString()));
                Assert.IsFalse(mRANsList[0].Pseudo);
                Assert.IsTrue(string.IsNullOrEmpty(mRANsList[0].StandardName));
                Assert.IsFalse(mRANsList[0].TransSplicing);
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].LocusTag.ToString()));
                Assert.IsTrue(string.IsNullOrEmpty(mRANsList[0].Operon.ToString(null)));
                Assert.IsFalse(string.IsNullOrEmpty(mRANsList[0].Product.ToString()));

                // Create a new mRNA feature using constructor.
                var mRNA = new MessengerRna(
                    metadata.Features.MessengerRNAs[0].Location);

                // Set and validate qualifiers.
                mRNA.GeneSymbol = mRNAGeneSymbol;
                mRNA.Allele = mRNAAllele;
                mRNA.Operon = mRNAOperon;
                mRNA.StandardName = mRNAStdName;

                // Validate properties.
                Assert.AreEqual(mRNA.GeneSymbol, mRNAGeneSymbol);
                Assert.AreEqual(mRNA.Allele, mRNAAllele);
                Assert.AreEqual(mRNA.Operon, mRNAOperon);
                Assert.AreEqual(mRNA.StandardName, mRNAStdName);

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