]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/Biopieces.pm
corrected bug in clean tmp to deal with permision problem
[biopieces.git] / code_perl / Maasha / Biopieces.pm
index ee38e282d4392a56f181713480cfe66b59d40576..43fd96e2a12ba30821b6f25e8e821e2d367b3475 100644 (file)
@@ -574,6 +574,7 @@ sub get_options
         @options = qw(
             in_file|i=s
             genome|g=s
+            seed_size|s=s
             mismatches|m=s
             gap_size|G=s
             cpus|c=s
@@ -3582,6 +3583,7 @@ sub script_soap_seq
 
     my ( $genome, $tmp_in, $tmp_out, $fh_in, $fh_out, $record, $line, @fields, $entry );
 
+    $options->{ "seed_size" }  ||= 10;
     $options->{ "mismatches" } ||= 2;
     $options->{ "gap_size" }   ||= 0;
     $options->{ "cpus" }       ||= 1;
@@ -3604,7 +3606,7 @@ sub script_soap_seq
 
     close $fh_out;
 
-    Maasha::Common::run( "soap", "-r 2 -a $tmp_in -v $options->{ 'mismatches' } -g $options->{ 'gap_size' } -p $options->{ 'cpus' } -d $options->{ 'in_file' } -o $tmp_out > /dev/null 2>&1", 1 );
+    Maasha::Common::run( "soap", "-s $options->{ 'seed_size' } -r 2 -a $tmp_in -v $options->{ 'mismatches' } -g $options->{ 'gap_size' } -p $options->{ 'cpus' } -d $options->{ 'in_file' } -o $tmp_out > /dev/null 2>&1", 1 );
 
     unlink $tmp_in;
 
@@ -6085,15 +6087,18 @@ sub clean_tmp
             $sid  = $2;
             $pid  = $3;
 
-            if ( not Maasha::Common::process_running( $pid ) )
+            if ( $user eq Maasha::Common::get_user() )
             {
-                # print STDERR "Removing stale dir: $dir\n";
-                Maasha::Common::dir_remove( $dir );
-            }
-            elsif ( $pid == $curr_pid )
-            {
-                # print STDERR "Removing current dir: $dir\n";
-                Maasha::Common::dir_remove( $dir );
+                if ( not Maasha::Common::process_running( $pid ) )
+                {
+                    # print STDERR "Removing stale dir: $dir\n";
+                    Maasha::Common::dir_remove( $dir );
+                }
+                elsif ( $pid == $curr_pid )
+                {
+                    # print STDERR "Removing current dir: $dir\n";
+                    Maasha::Common::dir_remove( $dir );
+                }
             }
         }
     }