Exemplo n.º 1
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other GCSingal instance.</param>
 private GcSingal(GcSingal other)
     : base(other)
 {
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Validate GenBank GCSignal features
        /// </summary>
        /// <param name="nodeName">XML node name</param>
        /// <param name="genMetadata">GenBank Metadata</param>
        private void ValidateGenBankGCSignalFeature(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<GcSingal> gcSignalFeatureList = genMetadata.Features.GCSignals;
            var locBuilder = new LocationBuilder();

            // Create a copy of GC_Signal feature.
            GcSingal cloneGCSignal = gcSignalFeatureList[0].Clone();

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

            // Create a new GCSignal and validate the same.
            var gcSignal = new GcSingal(expectedLocation);
            var gcSignalWithILoc = new GcSingal(
                genMetadata.Features.GCSignals[0].Location);

            // Set qualifiers and validate them.
            gcSignal.Allele = expectedAllele;
            gcSignal.GeneSymbol = geneSymbol;
            gcSignalWithILoc.GenomicMapPosition = expectedMap;
            Assert.AreEqual(gcSignal.GeneSymbol, geneSymbol);
            Assert.AreEqual(gcSignal.Allele, expectedAllele);
            Assert.AreEqual(gcSignalWithILoc.GenomicMapPosition,
                            expectedMap);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Private constructor for clone method.
 /// </summary>
 /// <param name="other">Other GCSingal instance.</param>
 private GcSingal(GcSingal other)
     : base(other) { }
Exemplo n.º 4
0
        /// <summary>
        ///     Validate GenBank Enhancer features
        /// </summary>
        /// <param name="nodeName">XML node name</param>
        /// <param name="genMetadata">GenBank Metadata</param>
        private void ValidateGenBankEnhancerFeature(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<Enhancer> enhancerFeatureList = genMetadata.Features.Enhancers;

            // Create a copy of Enhancer feature.
            Enhancer cloneEnhancer = enhancerFeatureList[0].Clone();
            var locBuilder = new LocationBuilder();

            // Validate Enhancer qualifiers.
            Assert.AreEqual(enhancerFeatureList.Count.ToString((IFormatProvider) null),
                            featureCount);
            Assert.AreEqual(cloneEnhancer.GeneSymbol,
                            geneSymbol);
            Assert.AreEqual(cloneEnhancer.DatabaseCrossReference[0],
                            expectedDbReference);
            Assert.AreEqual(enhancerFeatureList[0].Allele,
                            expectedAllele);
            Assert.AreEqual(enhancerFeatureList[0].Citation[0],
                            expectedCitation);
            Assert.AreEqual(enhancerFeatureList[0].Experiment[0],
                            expectedExperiment);
            Assert.AreEqual(enhancerFeatureList[0].GenomicMapPosition,
                            expectedMap);
            Assert.AreEqual(enhancerFeatureList[0].GeneSynonym[0],
                            expectedGeneSynonym);
            Assert.AreEqual(enhancerFeatureList[0].Inference[0],
                            expectedInference);
            Assert.AreEqual(enhancerFeatureList[0].Label,
                            expectedLabel);
            Assert.AreEqual(locBuilder.GetLocationString(
                genMetadata.Features.Enhancers[0].Location),
                            expectedLocation);
            Assert.AreEqual(enhancerFeatureList[0].Note[0],
                            expectedNote);
            Assert.AreEqual(enhancerFeatureList[0].OldLocusTag[0],
                            expectedOldLocusTag);
            Assert.AreEqual(enhancerFeatureList[0].LocusTag[0],
                            expectedLocusTag);
            Assert.IsTrue(string.IsNullOrEmpty(enhancerFeatureList[0].StandardName));

            // Create a new Enhancer and validate the same.
            var enhancer = new Enhancer(expectedLocation);
            var enhancerWithILoc = new GcSingal(
                genMetadata.Features.Enhancers[0].Location);

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