コード例 #1
0
        public void TestAlignedSequenceToString()
        {
            IList <ISequence> seqList = new List <ISequence>();

            seqList.Add(new Sequence(Alphabets.DNA, "CAAAAGGGATTGC---TGTTGGAGTGAATGCCATTACCTACCGGCTAGGAGGAGTAGTACAAAGGAGC"));
            seqList.Add(new Sequence(Alphabets.DNA, "CAAAAGGGATTGC---"));
            seqList.Add(new Sequence(Alphabets.DNA, "TAGTAGTTCTGCTATATACATTTG"));
            seqList.Add(new Sequence(Alphabets.DNA, "GTTATCATGCGAACAATTCAACAGACACTGTAGA"));
            NucmerPairwiseAligner num = new NucmerPairwiseAligner();

            num.BreakLength       = 8;
            num.FixedSeparation   = 0;
            num.MinimumScore      = 0;
            num.MaximumSeparation = 0;
            num.SeparationFactor  = 0;
            num.LengthOfMUM       = 8;
            IList <ISequence>          sequenceList = seqList;
            IList <ISequenceAlignment> alignmentObj = num.Align(sequenceList);
            AlignedSequence            alignedSeqs  = (AlignedSequence)alignmentObj[0].AlignedSequences[0];

            string actualString   = alignedSeqs.ToString();
            string expectedString = "CAAAAGGGATTGC---\r\nCAAAAGGGATTGC---\r\nCAAAAGGGATTGC---\r\n";

            Assert.AreEqual(actualString, expectedString);
        }
コード例 #2
0
        public void ValidateAlignedSequenceToString()
        {
            IList <ISequence> seqList = new List <ISequence>();
            string            actualAlignedSeqString = utilityObj.xmlUtil.GetTextValue(Constants.ToStringNodeName,
                                                                                       Constants.AlignedSeqActualNode);

            seqList.Add(new Sequence(Alphabets.DNA,
                                     actualAlignedSeqString));
            seqList.Add(new Sequence(Alphabets.DNA, "CAAAAGGGATTGC---"));
            seqList.Add(new Sequence(Alphabets.DNA, "TAGTAGTTCTGCTATATACATTTG"));
            seqList.Add(new Sequence(Alphabets.DNA, "GTTATCATGCGAACAATTCAACAGACACTGTAGA"));
            NucmerPairwiseAligner num = new NucmerPairwiseAligner();

            num.BreakLength       = 8;
            num.FixedSeparation   = 0;
            num.MinimumScore      = 0;
            num.MaximumSeparation = 0;
            num.SeparationFactor  = 0;
            num.LengthOfMUM       = 8;
            IList <ISequence>          sequenceList = seqList;
            IList <ISequenceAlignment> alignmentObj = num.Align(sequenceList);
            AlignedSequence            alignedSeqs  = (AlignedSequence)alignmentObj[0].AlignedSequences[0];

            string actualString   = alignedSeqs.ToString();
            string expectedString = utilityObj.xmlUtil.GetTextValue(Constants.ToStringNodeName,
                                                                    Constants.AlignedSeqExpectedNode);

            Assert.AreEqual(actualString.Replace("\r\n", ""), expectedString.Replace("\\r\\n", ""));
        }