From 40a9c05afcf4ec3136df7f0f629cca7287cf0d6a Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 17 Jan 2011 16:02:32 +0000 Subject: [PATCH 1/1] added tests for find_gaps git-svn-id: http://biopieces.googlecode.com/svn/trunk@1208 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/find_gaps | 4 +-- bp_test/in/find_gaps.in | 39 ++++++++++++++++++++ bp_test/out/find_gaps.out.1 | 54 ++++++++++++++++++++++++++++ bp_test/out/find_gaps.out.2 | 69 ++++++++++++++++++++++++++++++++++++ bp_test/test/test_find_gaps | 11 ++++++ code_python/Cjung/Args.pyc | Bin 5364 -> 5375 bytes 6 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 bp_test/in/find_gaps.in create mode 100644 bp_test/out/find_gaps.out.1 create mode 100644 bp_test/out/find_gaps.out.2 create mode 100755 bp_test/test/test_find_gaps 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 ddc36fc600f13f1a86a119e0c8fadcd00d0064e1..4c39c4a68733e7fdac49e939fe26d08e98449439 100644 GIT binary patch delta 224 zcmeyO`CpUc;wN6N9q&s1{9V^A@2K$R>f@K6#^v FGXQ#$LC^pI delta 217 zcmeyb`9+iC;wN6NjZrS%8#yxAI1LyW81yspb5kcz5HZ-iimieXO(=%rIjWG(=1Q(2 zR3Yuj3Oq+q^yy5N<~@fZqPYL0ZREH|Ed9Tn(RBibH D%c4DY -- 2.39.2