Exemplo n.º 1
0
        public void TestComplementation()
        {
            ISequence seq        = new Sequence(Alphabets.DNA, "GATACCCAAGGT");
            ISequence complement = Complementation.Complement(seq);

            Assert.AreEqual("CTATGGGTTCCA", complement.ToString());

            ISequence reverseComplement = Complementation.ReverseComplement(seq);

            Assert.AreEqual("ACCTTGGGTATC", reverseComplement.ToString());
        }
Exemplo n.º 2
0
        public void ValidateRevComplementForNull()
        {
            bool Exthrown = false;

            // Reverse Complement null Sequence.
            try
            {
                Complementation.ReverseComplement(null);
            }
            catch (NullReferenceException)
            {
                Exthrown = true;
            }
            // Validate if Reverse Complement method is throwing an exception.
            Assert.IsTrue(Exthrown);
            ApplicationLog.WriteLine(
                "Translation P2: Reverse complement method was throwing an expection for null value.");
        }
Exemplo n.º 3
0
        public void ValidateDnaReverseComplementationWithTweleveChars()
        {
            // Get Node values from XML.
            string alphabetName = _utilityObj._xmlUtil.GetTextValue(
                Constants.SimpleDnaAlphabetNode, Constants.AlphabetNameNode);
            string expectedSeq = _utilityObj._xmlUtil.GetTextValue(
                Constants.ComplementNode, Constants.DnaSequence);
            string expectedRevComplement = _utilityObj._xmlUtil.GetTextValue(
                Constants.ComplementNode, Constants.DnaRevComplement);

            ISequence seq = new Sequence(Utility.GetAlphabet(alphabetName), expectedSeq);

            // Reverse Complement DNA Sequence.
            ISequence revComplement = Complementation.ReverseComplement(seq);

            // Validate Reverse Complement for a given sequence.
            Assert.AreEqual(revComplement.ToString(), expectedRevComplement);
            ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                                                   "Translation P1: Reverse Complement {0} is expected.", revComplement));
            ApplicationLog.WriteLine(
                "Translation P1: Reverse Complement of twelve DNA characters sequence validated successfully.");
        }
Exemplo n.º 4
0
        public void ValidateDnaRevComplementation()
        {
            // Get Node values from XML.
            string alphabetName = Utility._xmlUtil.GetTextValue(
                Constants.SimpleDnaAlphabetNode, Constants.AlphabetNameNode);
            string expectedSeq = Utility._xmlUtil.GetTextValue(
                Constants.ComplementNode, Constants.DnaSequence);
            string expectedRevComplement = Utility._xmlUtil.GetTextValue(
                Constants.ComplementNode, Constants.DnaRevComplement);

            ISequence seq = new Sequence(Utility.GetAlphabet(alphabetName), expectedSeq);

            // Reverse Complement of DNA Sequence.
            ISequence revComplement = Complementation.ReverseComplement(seq);

            // Validate Reverse Complement.
            Assert.AreEqual(revComplement.ToString(), expectedRevComplement);
            ApplicationLog.WriteLine(string.Format(null,
                                                   "Translation BVT: Reverse Complement {0} is expected.", seq));
            ApplicationLog.WriteLine(
                "Translation BVT: Reverse Complement of DNA sequence was validate successfully.");
        }
Exemplo n.º 5
0
        public void ValidateMoreThanTwelveCharsDnaRevComplementation()
        {
            // Get Node values from XML.
            string alphabetName = Utility._xmlUtil.GetTextValue(
                Constants.SimpleDnaAlphabetNode, Constants.AlphabetNameNode);
            string expectedSeq = Utility._xmlUtil.GetTextValue(
                Constants.ComplementNode, Constants.DnaSequenceWithMoreThanTwelveChars);
            string expectedComplement = Utility._xmlUtil.GetTextValue(
                Constants.ComplementNode, Constants.DnaRevComplementForMoreThanTwelveChars);

            ISequence seq = new Sequence(Utility.GetAlphabet(alphabetName), expectedSeq);

            // Reverse Complement DNA Sequence.
            ISequence revComplement = Complementation.ReverseComplement(seq);

            // Validate Reverse Complement. for a given sequence.
            Assert.AreEqual(revComplement.ToString(), expectedComplement);
            ApplicationLog.WriteLine(string.Format(null,
                                                   "Translation P1: Rev Complement {0} is expected.", revComplement));
            ApplicationLog.WriteLine(
                "Translation P1: Reverse Complement of More than twelve DNA characters sequence was validate successfully.");
        }