]> git.donarmstrong.com Git - biopieces.git/commitdiff
added tests for find_gaps
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 17 Jan 2011 16:02:32 +0000 (16:02 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 17 Jan 2011 16:02:32 +0000 (16:02 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1208 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/find_gaps
bp_test/in/find_gaps.in [new file with mode: 0644]
bp_test/out/find_gaps.out.1 [new file with mode: 0644]
bp_test/out/find_gaps.out.2 [new file with mode: 0644]
bp_test/test/test_find_gaps [new file with mode: 0755]
code_python/Cjung/Args.pyc

index f885f82ff74a99d496230c2029e545441cdf73ba..300ae0952b9cb9c0c194eab4d3bf7087d490aff2 100755 (executable)
@@ -47,6 +47,8 @@ $out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } );
 
 while ( $record = Maasha::Biopieces::get_record( $in ) )
 {
+    Maasha::Biopieces::put_record( $record, $out );
+
     if ( exists $record->{ 'SEQ' } )
     {
         $gaps = find_gaps( $record->{ 'SEQ' }, $options->{ 'min_len' } );
@@ -58,8 +60,6 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
             Maasha::Biopieces::put_record( $gap, $out ); 
         }
     }
-
-    Maasha::Biopieces::put_record( $record, $out );
 }
 
 Maasha::Biopieces::close_stream( $in );
diff --git a/bp_test/in/find_gaps.in b/bp_test/in/find_gaps.in
new file mode 100644 (file)
index 0000000..da54d8d
--- /dev/null
@@ -0,0 +1,39 @@
+SEQ: NNNNNNNNNNtatcgatcgatcgaacgt
+SEQ_LEN: 28
+SEQ_NAME: test1
+---
+S_LEN: 10
+S_ID: test1
+S_BEG: 0
+S_END: 9
+---
+SEQ: tatcgatcgatcgaacgtnnnnnnnnnn
+SEQ_LEN: 28
+SEQ_NAME: test2
+---
+S_LEN: 10
+S_ID: test2
+S_BEG: 18
+S_END: 27
+---
+SEQ: tatcgatcNNNNNNNNNNgatcgaacgt
+SEQ_LEN: 28
+SEQ_NAME: test3
+---
+S_LEN: 10
+S_ID: test3
+S_BEG: 8
+S_END: 17
+---
+SEQ: NNNNtatcgatcgatcgaacgt
+SEQ_LEN: 22
+SEQ_NAME: test4
+---
+SEQ: tatcgatcgatcgaacgtnnnn
+SEQ_LEN: 22
+SEQ_NAME: test5
+---
+SEQ: tatcgatcNNNNgatcgaacgt
+SEQ_LEN: 22
+SEQ_NAME: test6
+---
diff --git a/bp_test/out/find_gaps.out.1 b/bp_test/out/find_gaps.out.1
new file mode 100644 (file)
index 0000000..143b6d0
--- /dev/null
@@ -0,0 +1,54 @@
+SEQ: NNNNNNNNNNtatcgatcgatcgaacgt
+SEQ_NAME: test1
+SEQ_LEN: 28
+---
+S_LEN: 10
+S_ID: test1
+S_BEG: 0
+S_END: 9
+---
+S_LEN: 10
+S_ID: test1
+S_BEG: 0
+S_END: 9
+---
+SEQ: tatcgatcgatcgaacgtnnnnnnnnnn
+SEQ_NAME: test2
+SEQ_LEN: 28
+---
+S_LEN: 10
+S_ID: test2
+S_BEG: 18
+S_END: 27
+---
+S_LEN: 10
+S_ID: test2
+S_BEG: 18
+S_END: 27
+---
+SEQ: tatcgatcNNNNNNNNNNgatcgaacgt
+SEQ_NAME: test3
+SEQ_LEN: 28
+---
+S_LEN: 10
+S_ID: test3
+S_BEG: 8
+S_END: 17
+---
+S_LEN: 10
+S_ID: test3
+S_BEG: 8
+S_END: 17
+---
+SEQ: NNNNtatcgatcgatcgaacgt
+SEQ_NAME: test4
+SEQ_LEN: 22
+---
+SEQ: tatcgatcgatcgaacgtnnnn
+SEQ_NAME: test5
+SEQ_LEN: 22
+---
+SEQ: tatcgatcNNNNgatcgaacgt
+SEQ_NAME: test6
+SEQ_LEN: 22
+---
diff --git a/bp_test/out/find_gaps.out.2 b/bp_test/out/find_gaps.out.2
new file mode 100644 (file)
index 0000000..7f8abf9
--- /dev/null
@@ -0,0 +1,69 @@
+SEQ: NNNNNNNNNNtatcgatcgatcgaacgt
+SEQ_NAME: test1
+SEQ_LEN: 28
+---
+S_LEN: 10
+S_ID: test1
+S_BEG: 0
+S_END: 9
+---
+S_LEN: 10
+S_ID: test1
+S_BEG: 0
+S_END: 9
+---
+SEQ: tatcgatcgatcgaacgtnnnnnnnnnn
+SEQ_NAME: test2
+SEQ_LEN: 28
+---
+S_LEN: 10
+S_ID: test2
+S_BEG: 18
+S_END: 27
+---
+S_LEN: 10
+S_ID: test2
+S_BEG: 18
+S_END: 27
+---
+SEQ: tatcgatcNNNNNNNNNNgatcgaacgt
+SEQ_NAME: test3
+SEQ_LEN: 28
+---
+S_LEN: 10
+S_ID: test3
+S_BEG: 8
+S_END: 17
+---
+S_LEN: 10
+S_ID: test3
+S_BEG: 8
+S_END: 17
+---
+SEQ: NNNNtatcgatcgatcgaacgt
+SEQ_NAME: test4
+SEQ_LEN: 22
+---
+S_LEN: 4
+S_ID: test4
+S_BEG: 0
+S_END: 3
+---
+SEQ: tatcgatcgatcgaacgtnnnn
+SEQ_NAME: test5
+SEQ_LEN: 22
+---
+S_LEN: 4
+S_ID: test5
+S_BEG: 18
+S_END: 21
+---
+SEQ: tatcgatcNNNNgatcgaacgt
+SEQ_NAME: test6
+SEQ_LEN: 22
+---
+S_LEN: 4
+S_ID: test6
+S_BEG: 8
+S_END: 11
+---
diff --git a/bp_test/test/test_find_gaps b/bp_test/test/test_find_gaps
new file mode 100755 (executable)
index 0000000..939c6f4
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+source "$BP_DIR/bp_test/lib/test.sh"
+
+run "$bp -I $in -O $tmp"
+assert_no_diff $tmp $out.1
+clean
+
+run "$bp -I $in -m 3 -O $tmp"
+assert_no_diff $tmp $out.2
+clean
index ddc36fc600f13f1a86a119e0c8fadcd00d0064e1..4c39c4a68733e7fdac49e939fe26d08e98449439 100644 (file)
Binary files a/code_python/Cjung/Args.pyc and b/code_python/Cjung/Args.pyc differ