Пример #1
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other TransitPeptide instance.</param>
 private TransitPeptide(TransitPeptide other)
     : base(other) { }
Пример #2
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other TransitPeptide instance.</param>
 private TransitPeptide(TransitPeptide other)
     : base(other)
 {
 }
Пример #3
0
        /// <summary>
        ///     Validate TrnsitPeptide features
        /// </summary>
        /// <param name="nodeName">XML node name</param>
        /// <param name="genMetadata">GenBank Metadata</param>
        private void ValidateGenBankTrnsitPeptideFeature(string nodeName,
                                                         GenBankMetadata genMetadata)
        {
            // Get Values from XML node.           
            string expectedLocation = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.Location);
            string expectedAllele = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.AlleleNode);
            string featureCount = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.QualifierCount);
            string expectedDbReference = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DbReferenceNode);
            string geneSymbol = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.GeneSymbol);
            string expectedCitation = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.CitationNode);
            string expectedExperiment = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ExperimentNode);
            string expectedFunction = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.FunctionNode);
            string expectedGeneSynonym = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.GeneSynonymNode);
            string expectedInference = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.InferenceNode);
            string expectedLabel = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.LabelNode);
            string expectedLocusTag = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.LocusTagNode);
            string expectedNote = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.Note);
            string expectedOldLocusTag = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.OldLocusTagNode);
            string expectedMap = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.GenbankMapNode);

            List<TransitPeptide> tansitPeptideFeatureList =
                genMetadata.Features.TransitPeptides;
            var locBuilder = new LocationBuilder();

            // Create a copy of transit peptide features.
            TransitPeptide cloneTransit = tansitPeptideFeatureList[0].Clone();

            // Validate transit peptide qualifiers.
            Assert.AreEqual(tansitPeptideFeatureList.Count.ToString((IFormatProvider) null), featureCount);
            Assert.AreEqual(cloneTransit.GeneSymbol, geneSymbol);
            Assert.AreEqual(cloneTransit.DatabaseCrossReference[0],
                            expectedDbReference);
            Assert.AreEqual(tansitPeptideFeatureList[0].Allele,
                            expectedAllele);
            Assert.AreEqual(tansitPeptideFeatureList[0].Citation[0],
                            expectedCitation);
            Assert.AreEqual(tansitPeptideFeatureList[0].Experiment[0],
                            expectedExperiment);
            Assert.AreEqual(tansitPeptideFeatureList[0].GenomicMapPosition,
                            expectedMap);
            Assert.AreEqual(tansitPeptideFeatureList[0].GeneSynonym[0],
                            expectedGeneSynonym);
            Assert.AreEqual(tansitPeptideFeatureList[0].Inference[0],
                            expectedInference);
            Assert.AreEqual(tansitPeptideFeatureList[0].Label,
                            expectedLabel);
            Assert.AreEqual(locBuilder.GetLocationString(
                genMetadata.Features.TransitPeptides[0].Location),
                            expectedLocation);
            Assert.AreEqual(tansitPeptideFeatureList[0].Note[0],
                            expectedNote);
            Assert.AreEqual(tansitPeptideFeatureList[0].OldLocusTag[0],
                            expectedOldLocusTag);
            Assert.AreEqual(tansitPeptideFeatureList[0].LocusTag[0],
                            expectedLocusTag);
            Assert.AreEqual(tansitPeptideFeatureList[0].Function[0],
                            expectedFunction);

            // Create a new TransitPeptide and validate the same.
            var tPeptide = new TransitPeptide(expectedLocation);
            var tPeptideWithILoc = new TransitPeptide(
                genMetadata.Features.TransitPeptides[0].Location);

            // Set qualifiers and validate them.
            tPeptide.Allele = expectedAllele;
            tPeptide.GeneSymbol = geneSymbol;
            tPeptideWithILoc.GenomicMapPosition = expectedMap;
            Assert.AreEqual(tPeptide.GeneSymbol, geneSymbol);
            Assert.AreEqual(tPeptide.Allele, expectedAllele);
            Assert.AreEqual(tPeptideWithILoc.GenomicMapPosition,
                            expectedMap);
        }