]> git.donarmstrong.com Git - biopieces.git/commitdiff
polished read_454 and added tests
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 13 Oct 2010 08:46:01 +0000 (08:46 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 13 Oct 2010 08:46:01 +0000 (08:46 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1124 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/read_454
bp_test/in/read_454.in [new file with mode: 0644]
bp_test/in/read_454.in.gz [new file with mode: 0644]
bp_test/in/read_454.in.qual [new file with mode: 0644]
bp_test/in/read_454.in.qual.gz [new file with mode: 0644]
bp_test/out/read_454.out.1 [new file with mode: 0644]
bp_test/out/read_454.out.2 [new file with mode: 0644]
bp_test/test/test_read_454 [new file with mode: 0755]
bp_test/test/test_write_fastq [new file with mode: 0755]

index 012bc3391525e83b1a7ecd958c2c9476e6265302..ae2f4b0ce239a2468b982d33bbaf7aea857d4399 100755 (executable)
@@ -42,13 +42,9 @@ my ( $options, $in, $out, $record, $data_in, $qual_in, $num, $fasta, $qual, @seq
 
 $options = Maasha::Biopieces::parse_options(
     [
-        { long => 'data_in',     short => 'i', type => 'file!',  mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
-        { long => 'qual_in',     short => 'q', type => 'file!',  mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
-        { long => 'num',         short => 'n', type => 'uint',   mandatory => 'no',  default => undef, allowed => undef, disallowed => '0' },
-        { long => 'convert2dec', short => 'c', type => 'flag',   mandatory => 'no',  default => undef, allowed => undef, disallowed => undef },
-        { long => 'cutoff',      short => 'C', type => 'int',    mandatory => 'no',  default => 20,    allowed => undef, disallowed => undef },
-        { long => 'soft_mask',   short => 's', type => 'flag',   mandatory => 'no',  default => undef, allowed => undef, disallowed => undef },
-        { long => 'mean',        short => 'm', type => 'flag',   mandatory => 'no',  default => undef, allowed => undef, disallowed => undef },
+        { long => 'data_in', short => 'i', type => 'file!',  mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
+        { long => 'qual_in', short => 'q', type => 'file!',  mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
+        { long => 'num',     short => 'n', type => 'uint',   mandatory => 'no',  default => undef, allowed => undef, disallowed => '0' },
     ]   
 );
 
@@ -79,11 +75,6 @@ if ( $options->{ 'data_in' } )
             SCORES      => $qual->[ 1 ],
         };
 
-        $record->{ 'SCORES_MEAN' } = sprintf "%.2f", Maasha::Fastq::solexa_str_mean( $qual->[ 1 ] ) if $options->{ 'mean' };
-        
-        Maasha::Fastq::softmask_solexa_str( $record->{ 'SEQ' }, $record->{ 'SCORES' }, $options->{ 'cutoff' } ) if $options->{ 'soft_mask' };
-        $record->{ 'SCORES' } = Maasha::Fastq::solexa_str2dec_str( $record->{ 'SCORES' } ) if $options->{ 'convert2dec' };
-
         Maasha::Biopieces::put_record( $record, $out );
 
         last if $options->{ "num" } and $num == $options->{ "num" };
diff --git a/bp_test/in/read_454.in b/bp_test/in/read_454.in
new file mode 100644 (file)
index 0000000..7ef42a3
--- /dev/null
@@ -0,0 +1,10 @@
+>FQIBXOY01DP5Y0
+tcagGGGGTGGGACGACGAAATAAATTTTGCGAAAATATCATTTCTGTCCCACCTCACTCAAAATAAATTTCACTATCCGTAAAATAAATAACTAACTATTTAAGTATCATCTCTCCCCTAATTAACAATTATAAAAATAAGAACCAATATTCGAGACAACCTAATTAATTGTGTTGTCTGTCATACTGGTTCATTTTTGTTTGACTAAATACtactctgagacacgcaacaggggataggcaaggcacacaggggatagn
+>FQIBXOY01CJUZC
+tcagAAAAGACAAAAGAAGATTTGAAGAAATATTAAAAAGATAAAATAGGAAGTCCCCAAAGATGAAACGGGCGTCAATGAAAGGTTCTGGAGAACGGAGCAGAGTTTCTTCTCAAAAAAtcccttattaagttttntttagtaggaggtgacttaaatttagtggggcggggtaacgtaacctaaaggaagttctttttgaactaaacttcctgagacacgacaacgagggatgacaagcacagaggganagnn
+>FQIBXOY01DFZRV
+tcagAAATCGATGGTAAAGGTTGGCAAAAGATAAATCTTGGGGTGGTTACAACGTTACAAGATATGAAGTGGTAAATGGTAATATCGACTTAAAACAAGCAATAGAATCATCAGATAACATTTCTTTGCTAGAGTAGCACTCGAATTAGGCAGTAAGAAATTTGAAAAAGGCAtgactgagacacgcaacaggggataggcaaggcacacaggggataggn
+>FQIBXOY01A7OGA
+tcagTTATTCAAACCATTTAATTGATTTAAATCAGTAACCGCATGTTGTTTATCGTCTGCAAGTTTTTGTATCACCGTCGTAGGTTAtctttagtcttggtttaacgtaagcttgttgtcaattagttccttcgagacacgcaacagggagtagcaaggcacacagggagtagnnn
+>FQIBXOY01A5ATT
+tcagGGTTAGCGATTCTTTCGTCGGATGCATTATCTTCAGTGGCTTACGGTCCCGAACAAATACTGATTACACTATCAGTAGTGGGTGCAGTTGCAACTTGGTATACTTTACCGATTGCAGGTGGCTGTTCTTGATCTTAtttagctgctttaatttatgtcttataggcaattatttattgcactgagacacgcaacagggagtaggcaaggcacacaggggagtaggnnn
diff --git a/bp_test/in/read_454.in.gz b/bp_test/in/read_454.in.gz
new file mode 100644 (file)
index 0000000..e51feb0
Binary files /dev/null and b/bp_test/in/read_454.in.gz differ
diff --git a/bp_test/in/read_454.in.qual b/bp_test/in/read_454.in.qual
new file mode 100644 (file)
index 0000000..a818cb2
--- /dev/null
@@ -0,0 +1,10 @@
+>FQIBXOY01DP5Y0
+37 37 35 22 22 26 26 28 28 37 37 37 37 37 37 37 37 37 28 28 28 36 26 22 18 16 16 16 16 37 36 31 22 22 22 22 33 35 37 37 37 37 37 37 40 40 40 40 40 37 37 37 37 37 37 37 37 37 37 37 32 32 32 32 37 35 35 35 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 36 36 36 36 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 36 36 36 37 37 37 37 37 37 36 35 31 22 22 22 22 22 31 35 36 35 35 35 37 37 37 37 36 36 36 37 37 37 37 37 37 37 37 36 36 36 36 36 36 36 36 30 30 29 16 16 16 16 16 16 16 24 16 16 16 24 24 24 24 24 24 30 29 27 25 16 16 16 16 22 22 22 22 0
+>FQIBXOY01CJUZC
+30 30 28 28 17 17 17 17 28 17 29 18 18 18 18 27 17 22 30 30 30 30 30 36 37 36 33 25 25 25 36 32 32 32 31 31 31 31 25 33 17 31 27 27 27 27 28 15 24 24 21 21 23 27 21 21 20 20 17 17 17 17 13 26 26 26 26 29 28 25 25 23 23 19 27 27 29 29 30 24 24 24 26 27 27 29 29 30 27 23 23 23 30 30 30 30 28 28 28 28 28 28 28 22 17 17 15 15 15 15 19 26 18 18 13 13 13 13 13 13 13 13 13 19 13 13 13 13 13 18 18 13 13 13 13 13 0 9 9 9 13 13 13 18 13 13 13 17 17 19 17 13 13 13 13 13 13 13 13 13 13 11 13 11 13 13 13 13 13 9 9 9 9 13 13 13 13 10 13 13 13 18 18 18 13 13 13 19 19 16 13 17 19 18 18 16 16 16 12 12 12 12 12 12 12 12 12 12 18 18 18 12 12 12 18 23 23 18 18 12 11 11 11 11 11 11 11 11 11 15 11 11 11 11 11 11 11 11 11 11 11 20 17 17 17 17 16 15 11 11 0 11 11 0 0
+>FQIBXOY01DFZRV
+36 36 35 26 26 26 26 32 35 36 36 36 36 36 35 31 33 31 36 36 36 36 36 36 36 21 21 21 21 31 35 37 36 36 36 36 36 32 32 28 28 28 28 36 36 36 36 36 37 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 35 35 28 28 28 28 35 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 35 32 28 28 28 28 32 35 35 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 35 35 35 35 35 35 36 36 36 36 36 36 36 36 36 35 26 26 20 20 20 20 35 35 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 35 35 31 31 31 31 31 36 36 36 36 36 36 36 36 35 35 35 31 31 31 35 35 36 0
+>FQIBXOY01A7OGA
+32 32 32 32 32 32 32 32 30 31 25 25 25 30 30 26 30 30 30 30 30 27 27 30 30 30 30 30 30 30 32 29 33 33 36 37 32 32 37 33 32 32 33 33 36 32 32 32 32 32 32 32 32 32 33 32 30 30 31 30 27 27 27 21 21 21 21 20 28 13 23 21 23 24 22 28 17 17 15 15 15 26 25 25 24 15 15 15 15 15 15 15 24 24 11 15 15 15 15 15 15 15 15 21 21 15 15 11 15 15 15 13 19 22 23 18 13 13 13 13 19 19 13 13 13 13 13 18 13 13 13 13 13 13 13 13 22 23 24 24 19 13 13 13 13 13 13 13 13 18 16 19 18 13 13 13 13 13 13 13 13 13 24 18 13 13 13 13 13 13 19 13 13 0 0 0
+>FQIBXOY01A5ATT
+34 34 34 34 34 34 34 34 34 40 34 34 34 34 34 34 34 34 34 34 34 40 40 40 40 40 40 40 40 40 40 40 40 40 40 39 39 39 40 40 40 39 39 39 38 37 36 36 36 34 30 30 30 27 26 27 27 22 20 20 20 32 31 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 35 34 34 34 34 34 34 34 34 32 32 26 26 26 26 26 34 34 34 34 34 34 34 34 34 30 26 26 26 26 26 26 31 32 17 17 15 15 17 17 27 27 22 25 22 22 25 25 27 27 28 22 16 14 14 14 16 16 27 29 27 22 14 14 14 16 16 12 12 12 15 14 27 29 32 29 22 22 22 22 27 27 22 16 16 16 16 15 14 22 25 25 17 17 22 24 24 25 25 24 24 24 29 32 30 30 24 21 14 14 14 14 14 14 14 14 12 21 21 14 14 14 14 14 14 14 14 14 21 28 27 27 21 19 19 19 19 13 22 22 14 14 0 0 0
diff --git a/bp_test/in/read_454.in.qual.gz b/bp_test/in/read_454.in.qual.gz
new file mode 100644 (file)
index 0000000..92849de
Binary files /dev/null and b/bp_test/in/read_454.in.qual.gz differ
diff --git a/bp_test/out/read_454.out.1 b/bp_test/out/read_454.out.1
new file mode 100644 (file)
index 0000000..ebcebff
--- /dev/null
@@ -0,0 +1,25 @@
+SCORES: eecVVZZ\\eeeeeeeee\\\dZVRPPPPed_VVVVaceeeeeehhhhheeeeeeeeeee````eccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeddddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedddeeeeeedc_VVVVV_cdccceeeedddeeeeeeeedddddddd^^]PPPPPPPXPPPXXXXXX^][YPPPPVVVV@
+SEQ: tcagGGGGTGGGACGACGAAATAAATTTTGCGAAAATATCATTTCTGTCCCACCTCACTCAAAATAAATTTCACTATCCGTAAAATAAATAACTAACTATTTAAGTATCATCTCTCCCCTAATTAACAATTATAAAAATAAGAACCAATATTCGAGACAACCTAATTAATTGTGTTGTCTGTCATACTGGTTCATTTTTGTTTGACTAAATACtactctgagacacgcaacaggggataggcaaggcacacaggggatagn
+SEQ_LEN: 261
+SEQ_NAME: FQIBXOY01DP5Y0
+---
+SCORES: ^^\\QQQQ\Q]RRRR[QV^^^^^dedaYYYd```____YaQ_[[[[\OXXUUW[UUTTQQQQMZZZZ]\YYWWS[[]]^XXXZ[[]]^[WWW^^^^\\\\\\\VQQOOOOSZRRMMMMMMMMMSMMMMMRRMMMMM@IIIMMMRMMMQQSQMMMMMMMMMMKMKMMMMMIIIIMMMMJMMMRRRMMMSSPMQSRRPPPLLLLLLLLLLRRRLLLRWWRRLKKKKKKKKKOKKKKKKKKKKKTQQQQPOKK@KK@@
+SEQ: tcagAAAAGACAAAAGAAGATTTGAAGAAATATTAAAAAGATAAAATAGGAAGTCCCCAAAGATGAAACGGGCGTCAATGAAAGGTTCTGGAGAACGGAGCAGAGTTTCTTCTCAAAAAAtcccttattaagttttntttagtaggaggtgacttaaatttagtggggcggggtaacgtaacctaaaggaagttctttttgaactaaacttcctgagacacgacaacgagggatgacaagcacagaggganagnn
+SEQ_LEN: 255
+SEQ_NAME: FQIBXOY01CJUZC
+---
+SCORES: ddcZZZZ`cdddddc_a_dddddddUUUU_ceddddd``\\\\dddddeddddddddddddddddddddddddddddddddddddddddcc\\\\cddddddddddddddddddddddc`\\\\`ccddddddddddddddddddddccccccdddddddddcZZTTTTccdddddddddddddddddddddddddcc_____ddddddddccc___ccd@
+SEQ: tcagAAATCGATGGTAAAGGTTGGCAAAAGATAAATCTTGGGGTGGTTACAACGTTACAAGATATGAAGTGGTAAATGGTAATATCGACTTAAAACAAGCAATAGAATCATCAGATAACATTTCTTTGCTAGAGTAGCACTCGAATTAGGCAGTAAGAAATTTGAAAAAGGCAtgactgagacacgcaacaggggataggcaaggcacacaggggataggn
+SEQ_LEN: 221
+SEQ_NAME: FQIBXOY01DFZRV
+---
+SCORES: ````````^_YYY^^Z^^^^^[[^^^^^^^`]aade``ea``aad`````````a`^^_^[[[UUUUT\MWUWXV\QQOOOZYYXOOOOOOOXXKOOOOOOOOUUOOKOOOMSVWRMMMMSSMMMMMRMMMMMMMMVWXXSMMMMMMMMRPSRMMMMMMMMMXRMMMMMMSMM@@@
+SEQ: tcagTTATTCAAACCATTTAATTGATTTAAATCAGTAACCGCATGTTGTTTATCGTCTGCAAGTTTTTGTATCACCGTCGTAGGTTAtctttagtcttggtttaacgtaagcttgttgtcaattagttccttcgagacacgcaacagggagtagcaaggcacacagggagtagnnn
+SEQ_LEN: 176
+SEQ_NAME: FQIBXOY01A7OGA
+---
+SCORES: bbbbbbbbbhbbbbbbbbbbbhhhhhhhhhhhhhhggghhhgggfedddb^^^[Z[[VTTT`_bbbbbbbbbbbbbbbbbbbbbbbbcbbbbbbbb``ZZZZZbbbbbbbbb^ZZZZZZ_`QQOOQQ[[VYVVYY[[\VPNNNPP[][VNNNPPLLLON[]`]VVVV[[VPPPPONVYYQQVXXYYXXX]`^^XUNNNNNNNNLUUNNNNNNNNNU\[[USSSSMVVNN@@@
+SEQ: tcagGGTTAGCGATTCTTTCGTCGGATGCATTATCTTCAGTGGCTTACGGTCCCGAACAAATACTGATTACACTATCAGTAGTGGGTGCAGTTGCAACTTGGTATACTTTACCGATTGCAGGTGGCTGTTCTTGATCTTAtttagctgctttaatttatgtcttataggcaattatttattgcactgagacacgcaacagggagtaggcaaggcacacaggggagtaggnnn
+SEQ_LEN: 232
+SEQ_NAME: FQIBXOY01A5ATT
+---
diff --git a/bp_test/out/read_454.out.2 b/bp_test/out/read_454.out.2
new file mode 100644 (file)
index 0000000..08844c9
--- /dev/null
@@ -0,0 +1,5 @@
+SCORES: eecVVZZ\\eeeeeeeee\\\dZVRPPPPed_VVVVaceeeeeehhhhheeeeeeeeeee````eccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeddddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedddeeeeeedc_VVVVV_cdccceeeedddeeeeeeeedddddddd^^]PPPPPPPXPPPXXXXXX^][YPPPPVVVV@
+SEQ: tcagGGGGTGGGACGACGAAATAAATTTTGCGAAAATATCATTTCTGTCCCACCTCACTCAAAATAAATTTCACTATCCGTAAAATAAATAACTAACTATTTAAGTATCATCTCTCCCCTAATTAACAATTATAAAAATAAGAACCAATATTCGAGACAACCTAATTAATTGTGTTGTCTGTCATACTGGTTCATTTTTGTTTGACTAAATACtactctgagacacgcaacaggggataggcaaggcacacaggggatagn
+SEQ_LEN: 261
+SEQ_NAME: FQIBXOY01DP5Y0
+---
diff --git a/bp_test/test/test_read_454 b/bp_test/test/test_read_454
new file mode 100755 (executable)
index 0000000..6cb2764
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+source "$BP_DIR/bp_test/lib/test.sh"
+
+run "$bp -i $in -q $in.qual -O $tmp"
+assert_no_diff $tmp $out.1
+clean
+
+run "$bp -i $in.gz -q $in.qual.gz -O $tmp"
+assert_no_diff $tmp $out.1
+clean
+
+run "$bp -i $in -q $in.qual -n 1 -O $tmp"
+assert_no_diff $tmp $out.2
+clean
diff --git a/bp_test/test/test_write_fastq b/bp_test/test/test_write_fastq
new file mode 100755 (executable)
index 0000000..db9bbc2
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+source "$BP_DIR/bp_test/lib/test.sh"
+
+run "$bp -I $in -o $tmp -x"
+assert_no_diff $tmp $out.1
+clean
+
+run "$bp -I $in -Z -o $tmp.gz -x"
+gunzip $tmp.gz
+assert_no_diff $tmp $out.1
+clean