From: martinahansen Date: Mon, 11 Oct 2010 12:48:23 +0000 (+0000) Subject: upgraded find_genes X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d9a358c37bd08343930921b5145376474f669692;p=biopieces.git upgraded find_genes git-svn-id: http://biopieces.googlecode.com/svn/trunk@1106 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/find_genes b/bp_bin/find_genes index f80fa88..2880a36 100755 --- a/bp_bin/find_genes +++ b/bp_bin/find_genes @@ -37,7 +37,7 @@ use Maasha::Filesys; # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -my ( $options, $in, $out, $record, $tmp_dir, $tmp_file, $fh_out, $fh_in, $entry, $chunk, @lines, $line, $s_id, $type, $s_beg, $s_end, $strand, @fields ); +my ( $options, $in, $out, $record, $tmp_dir, $tmp_file, $fh_out, $fh_in, $entry, $chunk, @lines, $line, $s_id, $type, $s_beg, $s_end, $strand, @fields, $def ); $options = Maasha::Biopieces::parse_options(); @@ -57,7 +57,11 @@ while ( $record = Maasha::Biopieces::get_record( $in ) ) Maasha::Biopieces::put_record( $record, $out ); } -Maasha::Common::run( "draft_prodigal.pl", "< $tmp_file > $tmp_file.out 2> /dev/null" ); +if ( $options->{ 'verbise' } ) { + Maasha::Common::run( "prodigal", "< $tmp_file > $tmp_file.out" ); +} else { + Maasha::Common::run( "prodigal", "< $tmp_file > $tmp_file.out 2> /dev/null" ); +} $fh_in = Maasha::Filesys::file_read_open( "$tmp_file.out" ); @@ -71,46 +75,63 @@ while ( $chunk = <$fh_in> ) $line = shift @lines; - if ( $line =~ /.*>(.+)/ ) + if ( $line =~ /^DEFINITION\s+(.+)/ ) { - $s_id = $1; - - foreach $line ( @lines ) - { - @fields = split " ", $line; + $def = $1; - $type = $fields[ 0 ]; + if ( $def =~ /seqhdr="([^"]+)"/ ) { + $s_id = $1; + } else { + Maasha::Common::error( qq(BAD sequence header: $def) ); + } - if ( $fields[ 1 ] =~ /complement/ ) { - $strand = "-"; - } else { - $strand = "+"; - } + $line = shift @lines; - if ( $fields[ 1 ] =~ /(\d+)\.\.>?(\d+)/ ) - { - $s_beg = $1; - $s_end = $2; - } - else + if ( $line =~ /^FEATURES/ ) + { + foreach $line ( @lines ) { - Maasha::Common::error( qq(BAD locator: $line) ); + next if $line =~ /.+\//; + + @fields = split " ", $line; + + $type = $fields[ 0 ]; + + if ( $fields[ 1 ] =~ /complement/ ) { + $strand = "-"; + } else { + $strand = "+"; + } + + if ( $fields[ 1 ] =~ /(\d+)\.\.>?(\d+)/ ) + { + $s_beg = $1; + $s_end = $2; + } + else + { + Maasha::Common::error( qq(BAD locator: $line) ); + } + + $record = { + S_ID => $s_id, + S_BEG => $s_beg - 1, + S_END => $s_end - 1, + Q_ID => $type, + STRAND => $strand, + }; + + Maasha::Biopieces::put_record( $record, $out ); } - - $record = { - S_ID => $s_id, - S_BEG => $s_beg - 1, - S_END => $s_end - 1, - Q_ID => $type, - STRAND => $strand, - }; - - Maasha::Biopieces::put_record( $record, $out ); + } + else + { + Maasha::Common::error( qq(BAD feature: $line) ); } } else { - Maasha::Commom::error( qq(BAD definition: $line) ); + Maasha::Common::error( qq(BAD definition: $line) ); } } diff --git a/code_ruby/Maasha/lib/doc/created.rid b/code_ruby/Maasha/lib/doc/created.rid index 120565f..7d21b41 100644 --- a/code_ruby/Maasha/lib/doc/created.rid +++ b/code_ruby/Maasha/lib/doc/created.rid @@ -1 +1,4 @@ -Wed, 18 Aug 2010 21:48:07 +0200 +Mon, 27 Sep 2010 12:56:47 +0200 +biopieces.rb Mon, 13 Sep 2010 09:27:58 +0200 +fasta.rb Mon, 06 Sep 2010 16:36:25 +0200 +seq.rb Mon, 20 Sep 2010 10:38:53 +0200 diff --git a/code_ruby/Maasha/lib/doc/index.html b/code_ruby/Maasha/lib/doc/index.html index b25b07d..7622b70 100644 --- a/code_ruby/Maasha/lib/doc/index.html +++ b/code_ruby/Maasha/lib/doc/index.html @@ -1,21 +1,225 @@ - - - + - RDoc Documentation - + + + RDoc Documentation + + + + + + + + - - - - - - - - + + + +

RDoc Documentation

+ + +

This is the API documentation for 'RDoc Documentation'.

+ + + + + +

Classes/Modules

+ + +

Methods

+ + +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+