예제 #1
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other MiscBinding instance.</param>
 private MiscBinding(MiscBinding other)
     : base(other) { }
예제 #2
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other MiscBinding instance.</param>
 private MiscBinding(MiscBinding other)
     : base(other)
 {
 }
예제 #3
0
        /// <summary>
        ///     Validate MiscBinding features
        /// </summary>
        /// <param name="nodeName">XML node name</param>
        /// <param name="genMetadata">GenBank Metadata</param>
        private void ValidateGenBankMiscBindingFeature(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 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<MiscBinding> miscBindingFeatureList = genMetadata.Features.MiscBindings;
            var locBuilder = new LocationBuilder();

            // Create a copy of Misc Binding feature.
            MiscBinding cloneMiscBinding = miscBindingFeatureList[0].Clone();

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

            // Create a new MiscBinding and validate the same.
            var miscBinding = new MiscBinding(expectedLocation);
            var miscBindingWithILoc = new MiscBinding(
                genMetadata.Features.MiscBindings[0].Location);

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