public void TestSetGet () { Sequence seq = new Sequence( AlphabetType.DNA, "atcg" ); Match m = new Match( null ); m.Set( seq, 3, 4, +1, 0.75 ); Assert.AreEqual( seq, m.BaseSequence ); Assert.AreEqual( 3, m.Start ); Assert.AreEqual( 4, m.Length ); Assert.AreEqual( 1, m.Strand ); Assert.AreEqual( 0.75, m.Similarity, 1e-3 ); Assert.AreEqual( 1, m.CalcMismatches() ); Assert.AreEqual( 3, m.Matches ); }
public void TestSetMatch () { Sequence seq = new Sequence( AlphabetType.DNA, "atcg" ); Match m1 = new Match( null ); Match m2 = new Match( null ); m1.Set( seq, 3, 2, +1, 0.5 ); m2.Set( m1 ); Assert.AreEqual( seq, m2.BaseSequence ); Assert.AreEqual( 3, m2.Start ); Assert.AreEqual( 2, m2.Length ); Assert.AreEqual( 1, m2.Strand ); Assert.AreEqual( 0.5, m2.Similarity, 1e-3 ); Assert.AreEqual( "cg", m2.Letters() ); }
/// <summary> /// Creates a deep copy of the given match object. /// </summary> /// <param name="match">Match object to copy.</param> /// <returns>Returns a deep copy.</returns> public Match Clone(Match match) { Match newMatch = new Match(null); newMatch.Set(match); newMatch.SubMatchedList = null; for (int i = 0; i < match.SubMatchNumber; i++) newMatch.Add(Clone(match.GetSubMatch(i))); return (newMatch); }