public void NeedlemanWunschDnaSeqSimpleGap() { IPairwiseSequenceAligner nw = new NeedlemanWunschAligner { SimilarityMatrix = new DiagonalSimilarityMatrix(2, -1), GapOpenCost = -2 }; ISequence sequence1 = new Sequence(Alphabets.DNA, "GAATTCAGTTA"); ISequence sequence2 = new Sequence(Alphabets.DNA, "GGATCGA"); IList <IPairwiseSequenceAlignment> result = nw.AlignSimple(sequence1, sequence2); AlignmentHelpers.LogResult(nw, result); IList <IPairwiseSequenceAlignment> expectedOutput = new List <IPairwiseSequenceAlignment>(); IPairwiseSequenceAlignment align = new PairwiseSequenceAlignment(); align.PairwiseAlignedSequences.Add(new PairwiseAlignedSequence { FirstSequence = new Sequence(Alphabets.DNA, "GAATTCAGTTA"), SecondSequence = new Sequence(Alphabets.DNA, "GGAT-C-G--A"), Consensus = new Sequence(AmbiguousDnaAlphabet.Instance, "GRATTCAGTTA"), Score = 3, FirstOffset = 0, SecondOffset = 0 }); expectedOutput.Add(align); Assert.IsTrue(AlignmentHelpers.CompareAlignment(result, expectedOutput)); }
public static void Test1BPDeletionCall() { string seq1seq = "ATACCCCTT"; string seq2seq = "ATA-CCCTT".Replace("-", String.Empty); int[] seq2qual = new int[] { 30, 30, 30, 2, 30, 30, 30, 30 }; var refseq = new Sequence(AmbiguousDnaAlphabet.Instance, seq1seq, false); var query = new Sequence(AmbiguousDnaAlphabet.Instance, seq2seq, false); NeedlemanWunschAligner aligner = new NeedlemanWunschAligner(); var aln = aligner.Align(refseq, query).First(); // Need to add in the QV Values. ConvertAlignedSequenceToQualSeq(aln, seq2qual); var variants = VariantCaller.CallVariants(aln); Assert.AreEqual(variants.Count, 1); var variant = variants.First(); Assert.AreEqual(2, variant.QV); Assert.AreEqual(2, variant.StartPosition); Assert.AreEqual(VariantType.INDEL, variant.Type); var vi = variant as IndelVariant; Assert.AreEqual("C", vi.InsertedOrDeletedBases); Assert.AreEqual('C', vi.HomopolymerBase); Assert.AreEqual(4, vi.HomopolymerLengthInReference); Assert.AreEqual(true, vi.InHomopolymer); Assert.AreEqual(vi.InsertionOrDeletion, IndelType.Deletion); }
public void NeedlemanWunschProteinSeqAffineGap() { IPairwiseSequenceAligner nw = new NeedlemanWunschAligner { SimilarityMatrix = new SimilarityMatrix(SimilarityMatrix.StandardSimilarityMatrix.Blosum62), GapOpenCost = -8, GapExtensionCost = -1 }; ISequence sequence1 = new Sequence(Alphabets.Protein, "HEAGAWGHEE"); ISequence sequence2 = new Sequence(Alphabets.Protein, "PAWHEAE"); IList <IPairwiseSequenceAlignment> result = nw.Align(sequence1, sequence2); AlignmentHelpers.LogResult(nw, result); IList <IPairwiseSequenceAlignment> expectedOutput = new List <IPairwiseSequenceAlignment>(); IPairwiseSequenceAlignment align = new PairwiseSequenceAlignment(); align.PairwiseAlignedSequences.Add(new PairwiseAlignedSequence { FirstSequence = new Sequence(Alphabets.Protein, "HEAGAWGHE-E"), SecondSequence = new Sequence(Alphabets.Protein, "P---AW-HEAE"), Consensus = new Sequence(AmbiguousProteinAlphabet.Instance, "XEAGAWGHEAE"), Score = 5, FirstOffset = 0, SecondOffset = 0 }); expectedOutput.Add(align); Assert.IsTrue(AlignmentHelpers.CompareAlignment(result, expectedOutput)); }
public static void TestTrickyQVInversions() { // This will be hard because normally flip the QV value for a homopolymer, but in this case we won't. // Note the whole notion of flipping is poorly defined. string seq1seq = "ATTGC"; string seq2seq = "ATAGC"; int[] seq2qual = new int[] { 30, 30, 2, 30, 30 }; var refseq = new Sequence(DnaAlphabet.Instance, seq1seq); var query = new Sequence(DnaAlphabet.Instance, seq2seq); var s1rc = refseq.GetReverseComplementedSequence(); var s2rc = query.GetReverseComplementedSequence(); NeedlemanWunschAligner aligner = new NeedlemanWunschAligner(); var aln = aligner.Align(s1rc, s2rc).First(); VariantCallTests.ConvertAlignedSequenceToQualSeq(aln, seq2qual.Reverse().ToArray()); aln.PairwiseAlignedSequences [0].Sequences [1].MarkAsReverseComplement(); var variants = VariantCaller.CallVariants(aln); Assert.AreEqual(1, variants.Count); var variant = variants.First(); Assert.AreEqual(VariantType.SNP, variant.Type); Assert.AreEqual(2, variant.QV); var vs = variant as SNPVariant; Assert.AreEqual('T', vs.AltBP); Assert.AreEqual('A', vs.RefBP); }
public static void TestSNPCallAtStart() { string seq1seq = "CTCCCCCTT"; string seq2seq = "TTCCCCCTT"; int[] seq2qual = new int[] { 10, 30, 30, 30, 5, 3, 30, 30, 10 }; var refseq = new Sequence(DnaAlphabet.Instance, seq1seq); var query = new Sequence(DnaAlphabet.Instance, seq2seq); NeedlemanWunschAligner aligner = new NeedlemanWunschAligner(); var aln = aligner.Align(refseq, query).First(); ConvertAlignedSequenceToQualSeq(aln, seq2qual); var variants = VariantCaller.CallVariants(aln); Assert.AreEqual(variants.Count, 1); var variant = variants.First(); Assert.AreEqual(10, variant.QV); Assert.AreEqual(0, variant.StartPosition); Assert.AreEqual(variant.Type, VariantType.SNP); var vi = variant as SNPVariant; Assert.AreEqual(1, vi.Length); Assert.AreEqual('T', vi.AltBP); Assert.AreEqual('C', vi.RefBP); Assert.AreEqual(VariantType.SNP, vi.Type); Assert.AreEqual(true, vi.AtEndOfAlignment); }
/// <summary> /// Method to align two sequences, this sample code uses NeedlemanWunschAligner. /// </summary> /// <param name="referenceSequence">Reference sequence for alignment</param> /// <param name="querySequence">Query sequence for alignment</param> /// <returns>List of IPairwiseSequenceAlignment</returns> public static IList <IPairwiseSequenceAlignment> AlignSequences(ISequence referenceSequence, ISequence querySequence) { // Initialize the Aligner NeedlemanWunschAligner aligner = new NeedlemanWunschAligner(); aligner.GapExtensionCost = -10; aligner.GapOpenCost = -20; //aligner.SimilarityMatrix = new SimilarityMatrix(Bio.SimilarityMatrices.SimilarityMatrix.StandardSimilarityMatrix.AmbiguousRna); // Calling align method to do the alignment. return(aligner.Align(referenceSequence, querySequence)); }
protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext) { NeedlemanWunschAligner NWA = new NeedlemanWunschAligner(); Result = NWA.AlignSimple(SimilarityMatrix, GapPenalty, Sequence1, Sequence2); if (Result.Count >= 1 && Result[0].PairwiseAlignedSequences.Count >= 1) { Result1 = Result[0].PairwiseAlignedSequences[0].FirstSequence; Result2 = Result[0].PairwiseAlignedSequences[0].SecondSequence; Consensus = Result[0].PairwiseAlignedSequences[0].Consensus; } return(ActivityExecutionStatus.Closed); }
public void NeedlemanWunschProteinSeqAffineGap() { string sequenceString1 = "HEAGAWGHEE"; string sequenceString2 = "PAWHEAE"; Sequence sequence1 = new Sequence(Alphabets.Protein, sequenceString1); Sequence sequence2 = new Sequence(Alphabets.Protein, sequenceString2); SimilarityMatrix sm = new SimilarityMatrix(SimilarityMatrix.StandardSimilarityMatrix.Blosum50); int gapPenalty = -8; NeedlemanWunschAligner nw = new NeedlemanWunschAligner(); nw.SimilarityMatrix = sm; nw.GapOpenCost = gapPenalty; nw.GapExtensionCost = -1; IList <IPairwiseSequenceAlignment> result = nw.Align(sequence1, sequence2); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "{0}, Affine; Matrix {1}; GapOpenCost {2}; GapExtenstionCost {3}", nw.Name, nw.SimilarityMatrix.Name, nw.GapOpenCost, nw.GapExtensionCost)); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "score {0}", result[0].PairwiseAlignedSequences[0].Score)); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "input 0 {0}", result[0].FirstSequence.ToString())); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "input 1 {0}", result[0].SecondSequence.ToString())); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "result 0 {0}", result[0].PairwiseAlignedSequences[0].FirstSequence.ToString())); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "result 1 {0}", result[0].PairwiseAlignedSequences[0].SecondSequence.ToString())); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "consesus {0}", result[0].PairwiseAlignedSequences[0].Consensus)); IList <IPairwiseSequenceAlignment> expectedOutput = new List <IPairwiseSequenceAlignment>(); IPairwiseSequenceAlignment align = new PairwiseSequenceAlignment(); PairwiseAlignedSequence alignedSeq = new PairwiseAlignedSequence(); alignedSeq.FirstSequence = new Sequence(Alphabets.Protein, "HEAGAWGHE-E"); alignedSeq.SecondSequence = new Sequence(Alphabets.Protein, "---PAW-HEAE"); alignedSeq.Consensus = new Sequence(AmbiguousProteinAlphabet.Instance, "HEAXAWGHEAE"); alignedSeq.Score = 14; alignedSeq.FirstOffset = 0; alignedSeq.SecondOffset = 3; align.PairwiseAlignedSequences.Add(alignedSeq); expectedOutput.Add(align); Assert.IsTrue(CompareAlignment(result, expectedOutput)); }
public static decimal AlignedSequenceSimilarityPercentage(ISequence alignableSequenceA, ISequence alignableSequenceB) { if (alignableSequenceA == null || alignableSequenceA.Count == 0 || alignableSequenceB == null || alignableSequenceB.Count == 0) { return(0); } var firstSequence = alignableSequenceA; var secondSequence = alignableSequenceB; var needlemanWunschAligner = new NeedlemanWunschAligner(); try { /* * for (var index = 0; index < alignableSequenceA.Count; index++) * { * if (alignableSequenceA[index] == Convert.ToByte('X')) * { * alignableSequenceA[index] = Convert.ToByte('L'); * * } * } */ if (!alignableSequenceA.Contains(Convert.ToByte('X')) && !alignableSequenceB.Contains(Convert.ToByte('X'))) { IList <IPairwiseSequenceAlignment> alignedList = needlemanWunschAligner.AlignSimple(alignableSequenceA, alignableSequenceB); if (alignedList != null && alignedList.Count > 0 && alignedList[0].PairwiseAlignedSequences.Count > 0) { firstSequence = alignedList[0].PairwiseAlignedSequences[0].FirstSequence; secondSequence = alignedList[0].PairwiseAlignedSequences[0].SecondSequence; } } } catch (KeyNotFoundException) { } catch (ArgumentException) { } return(SequenceSimilarityPercentage(firstSequence, secondSequence)); }
public void NeedlemanWunschDnaSeqSimpleGap() { Sequence sequence1 = new Sequence(Alphabets.DNA, "GAATTCAGTTA"); Sequence sequence2 = new Sequence(Alphabets.DNA, "GGATCGA"); SimilarityMatrix sm = new DiagonalSimilarityMatrix(2, -1); int gapPenalty = -2; NeedlemanWunschAligner nw = new NeedlemanWunschAligner(); nw.SimilarityMatrix = sm; nw.GapOpenCost = gapPenalty; IList <IPairwiseSequenceAlignment> result = nw.AlignSimple(sequence1, sequence2); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "{0}, Simple; Matrix {1}; GapOpenCost {2}", nw.Name, nw.SimilarityMatrix.Name, nw.GapOpenCost)); ApplicationLog.WriteLine(string.Format( (IFormatProvider)null, "score {0}", result[0].PairwiseAlignedSequences[0].Score)); ApplicationLog.WriteLine(string.Format( (IFormatProvider)null, "input 0 {0}", result[0].FirstSequence.ToString())); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "input 1 {0}", result[0].SecondSequence.ToString())); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "result 0 {0}", result[0].PairwiseAlignedSequences[0].FirstSequence.ToString())); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "result 1 {0}", result[0].PairwiseAlignedSequences[0].SecondSequence.ToString())); ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "consesus {0}", result[0].PairwiseAlignedSequences[0].Consensus)); IList <IPairwiseSequenceAlignment> expectedOutput = new List <IPairwiseSequenceAlignment>(); IPairwiseSequenceAlignment align = new PairwiseSequenceAlignment(); PairwiseAlignedSequence alignedSeq = new PairwiseAlignedSequence(); alignedSeq.FirstSequence = new Sequence(Alphabets.DNA, "GAATTCAGTTA"); alignedSeq.SecondSequence = new Sequence(Alphabets.DNA, "GGA-TC-G--A"); alignedSeq.Consensus = new Sequence(AmbiguousDnaAlphabet.Instance, "GRATTCAGTTA"); alignedSeq.Score = 3; alignedSeq.FirstOffset = 0; alignedSeq.SecondOffset = 0; align.PairwiseAlignedSequences.Add(alignedSeq); expectedOutput.Add(align); Assert.IsTrue(CompareAlignment(result, expectedOutput)); }
public void ValidateSequenceAlignersAll() { MUMmer mumobj = new MUMmer3(); Assert.AreEqual(mumobj.ToString(), SequenceAligners.MUMmer.ToString()); NeedlemanWunschAligner nwAlignerobj = new NeedlemanWunschAligner(); Assert.AreEqual(nwAlignerobj.ToString(), SequenceAligners.NeedlemanWunsch.ToString()); NUCmer nucobj = new NUCmer3(); Assert.AreEqual(nucobj.ToString(), SequenceAligners.NUCmer.ToString()); PairwiseOverlapAligner poAlignerobj = new PairwiseOverlapAligner(); Assert.AreEqual(poAlignerobj.ToString(), SequenceAligners.PairwiseOverlap.ToString()); SmithWatermanAligner swAlignerobj = new SmithWatermanAligner(); Assert.AreEqual(swAlignerobj.ToString(), SequenceAligners.SmithWaterman.ToString()); Assert.IsNotNull(SequenceAligners.All); Console.Write("Successfully created all the objects in Sequence Aligners"); ApplicationLog.Write("Successfully created all the objects in Sequence Aligners"); }
public static void TestReverseComplement1BPIndelCall() { string seq1seq = "ATACCCCTTGCGC"; string seq2seq = "ATA-CCCTTGCGC".Replace("-", String.Empty); int[] seq2qual = new int[] { 30, 30, 30, 2, 30, 30, 30, 30, 30, 30, 30, 30 }; var refseq = new Sequence(DnaAlphabet.Instance, seq1seq); var query = new Sequence(DnaAlphabet.Instance, seq2seq); var s1rc = refseq.GetReverseComplementedSequence(); var s2rc = query.GetReverseComplementedSequence(); NeedlemanWunschAligner aligner = new NeedlemanWunschAligner(); var aln = aligner.Align(s1rc, s2rc).First(); VariantCallTests.ConvertAlignedSequenceToQualSeq(aln, seq2qual.Reverse().ToArray()); aln.PairwiseAlignedSequences [0].Sequences [1].MarkAsReverseComplement(); var variants = VariantCaller.CallVariants(aln); Assert.AreEqual(variants.Count, 1); var variant = variants.First(); Assert.AreEqual(2, variant.QV); Assert.AreEqual(5, variant.StartPosition); Assert.AreEqual(VariantType.INDEL, variant.Type); var vi = variant as IndelVariant; Assert.AreEqual(IndelType.Deletion, vi.InsertionOrDeletion); Assert.AreEqual('G', vi.HomopolymerBase); Assert.AreEqual(1, vi.Length); Assert.AreEqual(4, vi.HomopolymerLengthInReference); Assert.AreEqual(true, vi.InHomopolymer); Assert.AreEqual("G", vi.InsertedOrDeletedBases); Assert.AreEqual(false, vi.AtEndOfAlignment); Assert.AreEqual(6, vi.EndPosition); }
public void PerformNeedlemanWunschPerf() { // Get Sequence file path. string refPath = Utility._xmlUtil.GetTextValue(Constants.AlignmentAlgorithmNodeName, Constants.RefFilePathNode); string queryPath = Utility._xmlUtil.GetTextValue(Constants.AlignmentAlgorithmNodeName, Constants.QueryFilePathNode); string smFilePath = Utility._xmlUtil.GetTextValue(Constants.AlignmentAlgorithmNodeName, Constants.SMFilePathNode); // Create a List for input files. List <string> lstInputFiles = new List <string>(); lstInputFiles.Add(refPath); lstInputFiles.Add(queryPath); FastaParser parserObj = new FastaParser(); IList <ISequence> seqs1 = parserObj.Parse(refPath); parserObj = new FastaParser(); IList <ISequence> seqs2 = parserObj.Parse(queryPath); IAlphabet alphabet = Alphabets.DNA; ISequence originalSequence1 = seqs1[0]; ISequence originalSequence2 = seqs2[0]; ISequence aInput = new Sequence(alphabet, originalSequence1.ToString()); ISequence bInput = new Sequence(alphabet, originalSequence2.ToString()); SimilarityMatrix sm = new SimilarityMatrix(smFilePath); nwObj = new NeedlemanWunschAligner(); nwObj.GapOpenCost = -10; nwObj.GapExtensionCost = -10; nwObj.SimilarityMatrix = sm; _watchObj = new Stopwatch(); _watchObj.Reset(); _watchObj.Start(); long memoryStart = GC.GetTotalMemory(false); // Align sequences using smith water man algorithm. IList <IPairwiseSequenceAlignment> alignment = nwObj.AlignSimple(aInput, bInput); _watchObj.Stop(); long memoryEnd = GC.GetTotalMemory(false); string memoryUsed = (memoryEnd - memoryStart).ToString(); // Display Needlemanwunsch perf test case execution details. DisplayTestCaseHeader(lstInputFiles, _watchObj, memoryUsed, "NeedlemanWunsch"); Console.WriteLine(string.Format( "Needleman Wunsch AlignSimple() method, Alignment Score is : {0}", alignment[0].PairwiseAlignedSequences[0].Score.ToString())); // Dispose NeedlemanWunsch object nwObj = null; }
private void ValidateNeedlemanWunschAlignment(bool isTextFile, AlignmentParamType alignParam, AlignmentType alignType) { ISequence aInput, bInput; IAlphabet alphabet = Utility.GetAlphabet(this.utilityObj.xmlUtil.GetTextValue(Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.AlphabetNameNode)); if (isTextFile) { // Read the xml file for getting both the files for aligning. string filePath1 = this.utilityObj.xmlUtil.GetTextValue(Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.FilePathNode1); string filePath2 = this.utilityObj.xmlUtil.GetTextValue(Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.FilePathNode2); // Parse the files and get the sequence. var parseObjectForFile1 = new FastAParser { Alphabet = alphabet }; aInput = parseObjectForFile1.Parse(filePath1).First(); var parseObjectForFile2 = new FastAParser { Alphabet = alphabet }; bInput = parseObjectForFile2.Parse(filePath2).First(); } else { // Read the xml file for getting both the files for aligning. string origSequence1 = this.utilityObj.xmlUtil.GetTextValue(Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.SequenceNode1); string origSequence2 = this.utilityObj.xmlUtil.GetTextValue(Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.SequenceNode2); aInput = new Sequence(alphabet, origSequence1); bInput = new Sequence(alphabet, origSequence2); } string blosumFilePath = this.utilityObj.xmlUtil.GetTextValue(Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.BlosumFilePathNode); var sm = new SimilarityMatrix(new StreamReader(blosumFilePath)); int gapOpenCost = int.Parse(this.utilityObj.xmlUtil.GetTextValue(Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.GapOpenCostNode), null); int gapExtensionCost = int.Parse(this.utilityObj.xmlUtil.GetTextValue(Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.GapExtensionCostNode), null); var needlemanWunschObj = new NeedlemanWunschAligner(); if (AlignmentParamType.AllParam != alignParam) { needlemanWunschObj.SimilarityMatrix = sm; needlemanWunschObj.GapOpenCost = gapOpenCost; needlemanWunschObj.GapExtensionCost = gapExtensionCost; } IList <IPairwiseSequenceAlignment> result = null; switch (alignParam) { case AlignmentParamType.AlignList: switch (alignType) { case AlignmentType.Align: result = needlemanWunschObj.Align(new List <ISequence> { aInput, bInput }); break; default: result = needlemanWunschObj.AlignSimple(new List <ISequence> { aInput, bInput }); break; } break; case AlignmentParamType.AlignTwo: switch (alignType) { case AlignmentType.Align: result = needlemanWunschObj.Align(aInput, bInput); break; default: result = needlemanWunschObj.AlignSimple(aInput, bInput); break; } break; case AlignmentParamType.AllParam: switch (alignType) { case AlignmentType.Align: result = needlemanWunschObj.Align( sm, gapOpenCost, gapExtensionCost, aInput, bInput); break; default: result = needlemanWunschObj.AlignSimple(sm, gapOpenCost, aInput, bInput); break; } break; default: break; } // Read the xml file for getting both the files for aligning. string expectedSequence1, expectedSequence2, expectedScore; switch (alignType) { case AlignmentType.Align: expectedScore = this.utilityObj.xmlUtil.GetTextValue( Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.ExpectedGapExtensionScoreNode); expectedSequence1 = this.utilityObj.xmlUtil.GetTextValue( Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.ExpectedGapExtensionSequence1Node); expectedSequence2 = this.utilityObj.xmlUtil.GetTextValue( Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.ExpectedGapExtensionSequence2Node); break; default: expectedScore = this.utilityObj.xmlUtil.GetTextValue( Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.ExpectedScoreNode); expectedSequence1 = this.utilityObj.xmlUtil.GetTextValue( Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.ExpectedSequenceNode1); expectedSequence2 = this.utilityObj.xmlUtil.GetTextValue( Constants.NeedlemanWunschAlignAlgorithmNodeName, Constants.ExpectedSequenceNode2); break; } IList <IPairwiseSequenceAlignment> expectedOutput = new List <IPairwiseSequenceAlignment>(); IPairwiseSequenceAlignment align = new PairwiseSequenceAlignment(); var alignedSeq = new PairwiseAlignedSequence { FirstSequence = new Sequence(alphabet, expectedSequence1), SecondSequence = new Sequence(alphabet, expectedSequence2), Score = Convert.ToInt32(expectedScore, null), FirstOffset = Int32.MinValue, SecondOffset = Int32.MinValue, }; align.PairwiseAlignedSequences.Add(alignedSeq); expectedOutput.Add(align); ApplicationLog.WriteLine(string.Format(null, "NeedlemanWunschAligner BVT : Final Score '{0}'.", expectedScore)); ApplicationLog.WriteLine(string.Format(null, "NeedlemanWunschAligner BVT : Aligned First Sequence is '{0}'.", expectedSequence1)); ApplicationLog.WriteLine(string.Format(null, "NeedlemanWunschAligner BVT : Aligned Second Sequence is '{0}'.", expectedSequence2)); Assert.IsTrue(CompareAlignment(result, expectedOutput)); }
public NeedlemanWunschAlignerProvider(ISequenceProvider provider, NeedlemanWunschAligner aligner) { _provider = provider; _aligner = aligner; }