コード例 #1
0
		public void TestExtract2 () {
			Sequence seq = new Sequence( AlphabetType.AA, "artg", true );

			Assert.AreEqual( "AR", seq.Extract( 0, 2, +1 ).Letters() );
			Assert.AreEqual( "RT", seq.Extract( 1, 2, +1 ).Letters() );
			Assert.AreEqual( "GA", seq.Extract( -1, 2, +1 ).Letters() );

			Assert.AreEqual( "TG", seq.Extract( 0, 2, -1 ).Letters() );
			Assert.AreEqual( "RT", seq.Extract( 1, 2, -1 ).Letters() );
			Assert.AreEqual( "GA", seq.Extract( -1, 2, -1 ).Letters() );

			Assert.AreEqual( "RT", seq.Extract( 0, 2, 0 ).Letters() );
			Assert.AreEqual( "AR", seq.Extract( -1, 2, 0 ).Letters() );
			Assert.AreEqual( "TG", seq.Extract( +1, 2, 0 ).Letters() );

			Assert.AreEqual( "ART", seq.Extract( 0, 3, 0 ).Letters() );
			Assert.AreEqual( "R", seq.Extract( 0, 1, 0 ).Letters() );

			seq = new Sequence( AlphabetType.AA, "artga", true );

			Assert.AreEqual( "T", seq.Extract( 0, 1, 0 ).Letters() );
			Assert.AreEqual( "RTG", seq.Extract( 0, 3, 0 ).Letters() );
			Assert.AreEqual( "ARTG", seq.Extract( 0, 4, 0 ).Letters() );
		}
コード例 #2
0
		public void TestExtract () {
			Sequence seq = new Sequence( AlphabetType.AA, "artg", true );

			Assert.AreEqual( "ARTG", seq.Extract( 1, 4 ).Letters() );
			Assert.AreEqual( "RT", seq.Extract( 2, 3 ).Letters() );
			Assert.AreEqual( "GARTGA", seq.Extract( 0, 5 ).Letters() );
		}