当前位置: 首页>>代码示例>>C#>>正文


C# Sequence.GetComplementedSequence方法代码示例

本文整理汇总了C#中Sequence.GetComplementedSequence方法的典型用法代码示例。如果您正苦于以下问题:C# Sequence.GetComplementedSequence方法的具体用法?C# Sequence.GetComplementedSequence怎么用?C# Sequence.GetComplementedSequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sequence的用法示例。


在下文中一共展示了Sequence.GetComplementedSequence方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ValidateSingleDnaSymbolComplementation

        public void ValidateSingleDnaSymbolComplementation()
        {
            // Get Node values from XML.
            string alphabetName = this.utilityObj.xmlUtil.GetTextValue(Constants.SimpleDnaAlphabetNode, Constants.AlphabetNameNode);
            string expectedSeq = this.utilityObj.xmlUtil.GetTextValue(Constants.ComplementNode, Constants.DnaSymbol);
            string expectedComplement = this.utilityObj.xmlUtil.GetTextValue(Constants.ComplementNode, Constants.DnaSymbolComplement);

            // Complement DNA Sequence.
            ISequence seq = new Sequence(Utility.GetAlphabet(alphabetName), expectedSeq);
            ISequence complement = seq.GetComplementedSequence();

            // Validate Single DNA Symbol Complement.
            Assert.AreEqual(expectedComplement, complement.ConvertToString());

            ApplicationLog.WriteLine(string.Format(null,
                                                   "Translation P1: Complement {0} is expected.", complement));
            ApplicationLog.WriteLine(
                "Translation P1: Complement of Single DNA Symbol was validate successfully.");
        }
开发者ID:cpatmoore,项目名称:bio,代码行数:19,代码来源:TranslationP1TestCases.cs

示例2: ValidateDnaComplementation

        public void ValidateDnaComplementation()
        {
            // Get Node values from XML.
            string alphabetName = this.utilityObj.xmlUtil.GetTextValue(
                Constants.SimpleDnaAlphabetNode, Constants.AlphabetNameNode);
            string expectedSeq = this.utilityObj.xmlUtil.GetTextValue(
                Constants.ComplementNode, Constants.DnaSequence);
            string expectedComplement = this.utilityObj.xmlUtil.GetTextValue(
                Constants.ComplementNode, Constants.DnaComplement);
            ISequence complement = null;

            var seq = new Sequence(Utility.GetAlphabet(alphabetName), expectedSeq);
            // Complement DNA Sequence.
            complement = seq.GetComplementedSequence();

            // Validate Complement.
            Assert.AreEqual(new string(complement.Select(a => (char) a).ToArray()), expectedComplement);
            ApplicationLog.WriteLine(string.Format(null,
                                                   "Translation BVT: Complement {0} is expected.", seq));
            ApplicationLog.WriteLine(
                "Translation BVT: Complement of DNA sequence was validate successfully.");
        }
开发者ID:cpatmoore,项目名称:bio,代码行数:22,代码来源:TranslationBvtTestCases.cs

示例3: ValidateSequences

        /// <summary>
        /// Supporting method for validating Sequence operations.
        /// Input Data: Parent node,child node and Enum. 
        /// Output Data : Validation of public methods in Sequence class.
        /// </summary>
        void ValidateSequences(string parentNode, SequenceMethods option)
        {
            string alphabetName = this.utilityObj.xmlUtil.GetTextValue(
                                 parentNode, Constants.AlphabetNameNode);
            IAlphabet alphabet = Utility.GetAlphabet(alphabetName);
            ISequence seq = null;
            string expectedValue = "";
            ISequence sequence = new Sequence(alphabet, Encoding.UTF8.GetBytes(
                                this.utilityObj.xmlUtil.GetTextValue(parentNode, 
                                Constants.ExpectedDerivedSequence)));
            switch (option)
            {
                case SequenceMethods.Reverse:
                    seq = sequence.GetReversedSequence();
                    expectedValue = this.utilityObj.xmlUtil.GetTextValue(
                    parentNode, Constants.Reverse);
                    break;
                case SequenceMethods.ReverseComplement:
                    seq = sequence.GetReverseComplementedSequence();
                    expectedValue = this.utilityObj.xmlUtil.GetTextValue(
                    parentNode, Constants.ReverseComplement);
                    break;
                case SequenceMethods.Complement:
                    seq = sequence.GetComplementedSequence();
                    expectedValue = this.utilityObj.xmlUtil.GetTextValue(
                    parentNode, Constants.Complement);
                    break;
            }

            Assert.AreEqual(expectedValue, seq.ConvertToString());
            ApplicationLog.WriteLine(string.Concat(
                    "Sequence BVT: Validation of Sequence operation ", option, " completed successfully."));

        }
开发者ID:cpatmoore,项目名称:bio,代码行数:39,代码来源:SequenceBvtTestCases.cs


注:本文中的Sequence.GetComplementedSequence方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。