From: martinahansen Date: Mon, 17 Jan 2011 16:02:32 +0000 (+0000) Subject: added tests for find_gaps X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=40a9c05afcf4ec3136df7f0f629cca7287cf0d6a;p=biopieces.git added tests for find_gaps git-svn-id: http://biopieces.googlecode.com/svn/trunk@1208 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/find_gaps b/bp_bin/find_gaps index f885f82..300ae09 100755 --- a/bp_bin/find_gaps +++ b/bp_bin/find_gaps @@ -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 index 0000000..da54d8d --- /dev/null +++ b/bp_test/in/find_gaps.in @@ -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 index 0000000..143b6d0 --- /dev/null +++ b/bp_test/out/find_gaps.out.1 @@ -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 index 0000000..7f8abf9 --- /dev/null +++ b/bp_test/out/find_gaps.out.2 @@ -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 index 0000000..939c6f4 --- /dev/null +++ b/bp_test/test/test_find_gaps @@ -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 diff --git a/code_python/Cjung/Args.pyc b/code_python/Cjung/Args.pyc index ddc36fc..4c39c4a 100644 Binary files a/code_python/Cjung/Args.pyc and b/code_python/Cjung/Args.pyc differ