]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed match_seq bug
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 16 Sep 2009 07:47:39 +0000 (07:47 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 16 Sep 2009 07:47:39 +0000 (07:47 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@668 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/match_seq
code_perl/Maasha/Fasta.pm
code_perl/Maasha/Match.pm
code_perl/Maasha/Plot.pm

index bb95a3f14fd14fe70561ba75fdb8338e1755a4f6..d5362fa1a8f12dbd38dcc224aa8a50901c111260 100755 (executable)
@@ -64,9 +64,9 @@ if ( @entries == 1 )
 
     map { Maasha::Biopieces::put_record( $_, $out ) } @{ $results };
 }
-elsif ( @entries == 2 )
+else
 {
-    $results = Maasha::Match::match_mummer( [ $entries[ 0 ] ], [ $entries[ 1 ] ], $options, $tmp_dir );
+    $results = Maasha::Match::match_mummer( [ shift @entries ], \@entries, $options, $tmp_dir );
 
     map { Maasha::Biopieces::put_record( $_, $out ) } @{ $results };
 }
index 4e28f8733e488781c538ef5039ff831717f36d36..20661555ae220302dd382d3ce9ebb3f0f8f6274d 100644 (file)
@@ -95,7 +95,7 @@ sub put_entry
 {
     # Martin A. Hansen, January 2007.
 
-    # Writes FASTA entries to STDOUT or file.
+    # Writes a FASTA entry to a file handle.
 
     my ( $entry,     # a FASTA entries
          $fh,        # file handle to output file - OPTIONAL
@@ -119,6 +119,29 @@ sub put_entry
 }
 
 
+sub put_entries
+{
+    # Martin A. Hansen, September 2009
+
+    # Write FASTA entries to a file.
+
+    my ( $entries,   # list of FASTA entries
+         $file,      # output file
+         $wrap,      # line width  -  OPTIONAL
+       ) = @_;
+
+    # Returns nothing
+
+    my ( $fh );
+
+    $fh = Maasha::Filesys::file_write_open( $file );
+
+    map { put_entry( $_, $fh, $wrap ) } @{ $entries };
+
+    close $fh;
+}
+
+
 sub wrap
 {
     # Martin A. Hansen, June 2007
index 9d315b7d6f84aba42e9e5dbb2fdef5423181341f..1e971baf03b1787d351169cdf03091e3d83c9742 100644 (file)
@@ -123,7 +123,6 @@ sub match_mummer
 
             push @results, dclone $result;
         }
-    
     }
 
     unlink $file_in1;
index 4981b627d774a58e7ef209c05e2aea4c0583a58f..a662fbcd99683e6cb0ba2edff8e7ed5f28adeb04 100644 (file)
@@ -97,8 +97,11 @@ sub lineplot_simple
 
     for ( $i = 1; $i < scalar @{ $data->[ 0 ] } + 1; $i++ )
     {
-        $title = $options->{ 'keys' }->[ $i - 1 ] || $options->{ 'list' };
-        push @plot_cmd, qq("$tmp_file" using $i with lines title "$title"); 
+        if ( ( $i % 5 ) == 0 )
+        {
+            $title = $options->{ 'keys' }->[ $i - 1 ] || $options->{ 'list' };
+            push @plot_cmd, qq("$tmp_file" using $i with lines title "$title"); 
+        }
     }
 
     print $fh_in "plot " . join( ", ", @plot_cmd ) . "\n";