Ejemplo n.º 1
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other Operon instance.</param>
 private OperonRegion(OperonRegion other)
     : base(other)
 {
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other Operon instance.</param>
 private OperonRegion(OperonRegion other)
     : base(other) { }
Ejemplo n.º 3
0
        /// <summary>
        ///     Validate GenBank Operon features
        /// </summary>
        /// <param name="nodeName">XML node name</param>
        /// <param name="genMetadata">GenBank Metadata</param>
        private void ValidateGenBankOperon(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 expectedCitation = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.CitationNode);
            string expectedExperiment = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ExperimentNode);
            string expectedInference = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.InferenceNode);
            string expectedLabel = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.LabelNode);
            string expectedNote = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.Note);
            string expectedMap = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.GenbankMapNode);

            List<OperonRegion> operonFeatureList =
                genMetadata.Features.OperonRegions;
            var locBuilder = new LocationBuilder();

            // Create a copy of Long Terminal Repeat feature.
            OperonRegion cloneOperon = operonFeatureList[0].Clone();

            // Validate Operon region qualifiers.
            Assert.AreEqual(operonFeatureList.Count.ToString((IFormatProvider) null),
                            featureCount);
            Assert.AreEqual(cloneOperon.DatabaseCrossReference[0],
                            expectedDbReference);
            Assert.AreEqual(operonFeatureList[0].Allele,
                            expectedAllele);
            Assert.AreEqual(operonFeatureList[0].Citation[0],
                            expectedCitation);
            Assert.AreEqual(operonFeatureList[0].Experiment[0],
                            expectedExperiment);
            Assert.AreEqual(operonFeatureList[0].GenomicMapPosition,
                            expectedMap);
            Assert.AreEqual(operonFeatureList[0].Inference[0],
                            expectedInference);
            Assert.AreEqual(operonFeatureList[0].Label,
                            expectedLabel);
            Assert.AreEqual(locBuilder.GetLocationString(
                genMetadata.Features.OperonRegions[0].Location),
                            expectedLocation);
            Assert.AreEqual(operonFeatureList[0].Note[0],
                            expectedNote);
            Assert.IsFalse(string.IsNullOrEmpty(operonFeatureList[0].Function.ToString()));
            Assert.AreEqual(operonFeatureList[0].GenomicMapPosition,
                            expectedMap);
            Assert.IsTrue(string.IsNullOrEmpty(operonFeatureList[0].Operon));
            Assert.IsFalse(string.IsNullOrEmpty(operonFeatureList[0].Phenotype.ToString()));
            Assert.IsTrue(string.IsNullOrEmpty(operonFeatureList[0].StandardName));
            Assert.IsFalse(operonFeatureList[0].Pseudo);

            // Create a new Operon feature using constructor.
            var operonRegion =
                new OperonRegion(expectedLocation);
            var operonRegionWithLoc = new OperonRegion(
                genMetadata.Features.OperonRegions[0].Location);

            // Set and validate qualifiers.
            operonRegion.Allele = expectedAllele;
            operonRegionWithLoc.GenomicMapPosition = expectedMap;
            Assert.AreEqual(operonRegionWithLoc.GenomicMapPosition,
                            expectedMap);
            Assert.AreEqual(operonRegion.Allele, expectedAllele);
        }