Changeset 271

Show
Ignore:
Timestamp:
09/30/09 14:05:39 (2 months ago)
Author:
cholt
Message:

make runlog softmask instensitive for old data. Fix fgenesh xdef errors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/GI.pm

    r269 r271  
    352352   } 
    353353 
    354    if ($p_cutoff <= 1 && $m_cutoff <= 1) { #too small, all are heldover for next round 
    355       push (@holdovers, @{$hit_groups}); 
     354   #too small, all are heldover for next round 
     355   if ($p_cutoff <= 1 + $chunk->offset && 
     356       $m_cutoff <= 1 + $chunk->offset) { 
     357     foreach my $g (@{$hit_groups}){ 
     358         push (@holdovers, $g); 
     359         push (@keepers, []); 
     360     } 
    356361      return @holdovers, @keepers; 
    357362   } 
     
    368373         ($b, $e) = ($e, $b) if $b > $e; 
    369374 
    370          if (($e < $p_cutoff && $strand eq '1') || 
    371              ($e < $m_cutoff && $strand eq '-1'
     375         if (($e < $p_cutoff && $strand eq '1' && $p_cutoff > $chunk->offset +1) || 
     376             ($e < $m_cutoff && $strand eq '-1' && $m_cutoff > $chunk->offset +1
    372377            ) { 
     378            push(@{$group_keepers}, $hit); 
     379         } 
     380         else { 
     381            push(@{$group_holdovers}, $hit); 
     382         } 
     383      } 
     384 
     385      push(@keepers, $group_keepers); 
     386      push(@holdovers, $group_holdovers); 
     387   } 
     388 
     389   #hit holdovers and keepers are returned in same order given by user 
     390   return @holdovers, @keepers; 
     391} 
     392#----------------------------------------------------------------------------- 
     393sub process_the_chunk_divide_temp{ 
     394   my $chunk = shift @_; 
     395   my $split_hit = shift @_; 
     396   my $hit_groups = \@_; #processed and returned in order given by user 
     397 
     398   my $p_hits; 
     399 
     400   foreach my $group (@{$hit_groups}) { 
     401      push(@{$p_hits}, @{$group}); 
     402   } 
     403 
     404   my $coors  = PhatHit_utils::to_begin_and_end_coors($p_hits, 'query'); 
     405 
     406   foreach my $coor (@{$coors}) { 
     407      $coor->[0] -= $chunk->offset(); 
     408      $coor->[1] -= $chunk->offset(); 
     409      #fix coordinates for hits outside of chunk end    
     410      $coor->[0] = $chunk->length if($coor->[0] > $chunk->length); 
     411      $coor->[1] = $chunk->length if($coor->[1] > $chunk->length); 
     412      #fix coordinates for hits outside of chunk begin 
     413      $coor->[0] = 0 if($coor->[0] < 0); 
     414      $coor->[1] = 0 if($coor->[1] < 0); 
     415   } 
     416 
     417   my $pieces = Shadower::getPieces(\($chunk->seq), $coors, 10); 
     418   $pieces = [sort {$b->{e} <=> $a->{e}} @{$pieces}]; 
     419 
     420   my @keepers; 
     421   my @holdovers; 
     422 
     423   my $cutoff = $chunk->length + $chunk->offset - $split_hit; 
     424   my $p_cutoff = $chunk->length + $chunk->offset + 1; 
     425 
     426   foreach my $piece (@{$pieces}) { 
     427      if ($piece->{e} + $chunk->offset >= $cutoff) { 
     428         $p_cutoff = $piece->{b} + $chunk->offset; 
     429      } 
     430   } 
     431 
     432   #too small, all are heldover for next round 
     433   if ($p_cutoff <= 1 + $chunk->offset) { 
     434     foreach my $g (@{$hit_groups}){ 
     435         push (@holdovers, $g); 
     436         push (@keepers, []); 
     437     } 
     438      return @holdovers, @keepers; 
     439   } 
     440 
     441   foreach my $group (@{$hit_groups}) { 
     442      my $group_keepers = []; 
     443      my $group_holdovers = []; 
     444 
     445      foreach my $hit (@{$group}) { 
     446         my $b = $hit->nB('query'); 
     447         my $e = $hit->nE('query'); 
     448         my $strand = $hit->strand; 
     449 
     450         ($b, $e) = ($e, $b) if $b > $e; 
     451 
     452         if (($e < $p_cutoff && $p_cutoff > $chunk->offset +1)) { 
    373453            push(@{$group_keepers}, $hit); 
    374454         } 
     
    598678   #my $FA; 
    599679   #open($FA, "> $t_full"); #full file 
     680 
    600681   my $wflag = 1; #flag set so warnings gets printed only once  
    601682   while (my $fasta = $fasta_iterator->nextEntry()) { 
     
    842923   $command .= " -p $pro"; 
    843924   $command .= " -o $out_file"; 
    844    $command .= " -t $TMP"; 
     925   #$command .= " -t $TMP"; 
    845926   $command .= " $in_file"; 
    846927 
     
    9351016 
    9361017   my $command  = "$wrap $exe"; 
    937    $command .= " -tmp $TMP"; 
     1018   #$command .= " -tmp $TMP"; 
    9381019   $command .= " $org"; 
    9391020   $command .= " $in_file"; 
     
    27362817   ($CTL_OPT{out_name}) = $genome =~ /([^\/]+)$/; 
    27372818   $CTL_OPT{out_name} =~ s/\.[^\.]+$//; 
     2819   $CTL_OPT{CWD} = Cwd::cwd(); 
    27382820   if(! $CTL_OPT{out_base}){ 
    2739       $CTL_OPT{out_base} = Cwd::cwd()."/$CTL_OPT{out_name}.maker.output"; 
     2821      $CTL_OPT{out_base} = $CTL_OPT{CWD}."/$CTL_OPT{out_name}.maker.output"; 
    27402822   } 
    27412823   mkdir($CTL_OPT{out_base}) if(! -d $CTL_OPT{out_base}); 
  • lib/Process/MpiChunk.pm

    r256 r271  
    12211221                $pred_gff_keepers, 
    12221222                $model_gff_keepers 
    1223                ) = GI::process_the_chunk_divide($chunk, 
     1223               ) = GI::process_the_chunk_divide_temp($chunk, 
    12241224                                                $CTL_OPT{'split_hit'}, 
    12251225                                                $blastn_keepers, 
  • lib/Widget/fgenesh.pm

    r244 r271  
    44package Widget::fgenesh; 
    55use strict; 
    6 use lib '~/maker/lib'; 
    7 use lib '/data1/hao/projects/MAKER-fgenesh/lib'; 
    8  
    9 use vars qw(@ISA $TMP); 
     6#use lib '~/maker/lib'; 
     7#use lib '/data1/hao/projects/MAKER-fgenesh/lib'; 
     8 
     9use vars qw(@ISA); 
    1010use PostData; 
    1111use FileHandle; 
     
    144144           } 
    145145           waitpid $pid, 0; 
    146            #die "ERROR: FgenesH failed\n" if $? != 0; 
     146           die "ERROR: FgenesH failed\n" if $? != 0; 
    147147        } 
    148148        else { 
     
    293293        $command = $wrap . " $command"; #prepend wrapper 
    294294        $command .= " $file_name"; 
    295       $command .= " -tmp $TMP";                         
     295#     $command .= " -tmp $TMP";                         
    296296        $command .= ' -exon_table:'.$xdef_file if -e $xdef_file; 
    297297                            
     
    530530        my @xdef; 
    531531 
    532         my $num = (scalar @{$p_pieces} ) + (scalar @{$n_pieces}); 
    533         push @xdef, "$num $s"; 
    534532        for (my $i = 0; $i < @{$p_pieces}; $i++){ 
    535533                my $p = $p_pieces->[$i]; 
     
    537535                my $c_e = $p->{e} - $offset; 
    538536 
    539                 my $l = $c_b.' '.$c_e.' '.'1000'
     537                my $l = "$c_b $c_e 100"
    540538                 
    541539                push(@xdef, $l); 
    542540        } 
    543          
    544          
    545         return \@xdef if !defined($n_pieces->[1]); 
    546          
     541                 
    547542        for (my $i = @{$n_pieces} - 1; $i > 0;  $i--){ 
    548543                my $p_r = $n_pieces->[$i];  
     
    554549                next if abs($i_b - $i_e) < 25; 
    555550 
    556                 my $l  = $i_b.' '.$i_e.' -1000'
     551                my $l  = "$i_b $i_e -1000"
    557552 
    558553                push(@xdef, $l); 
    559554        } 
     555 
     556        my $num = @xdef; 
     557        unshift(@xdef, "$num $s"); 
    560558 
    561559        # The next part also put ESTs as arbitrary exons. 
  • lib/clean.pm

    r268 r271  
    216216 
    217217        #if average basepair hits twice on both query and subject, skip 
    218         push(@keepers, $f) unless(($q_ave + $h_ave)/2 > 2); 
     218        push(@keepers, $f) unless(($q_ave + $h_ave)/2 > 1.5); 
    219219    } 
    220220     
  • lib/ds_utility.pm

    r269 r271  
    1414@ISA = qw( 
    1515       ); 
     16 
     17my $CWD = Cwd::getcwd(); 
     18 
    1619#------------------------------------------------------------------------ 
    1720#--------------------------- METHODS   ---------------------------------- 
     
    3235   my $self = shift @_; 
    3336   my %CTL_OPTIONS = %{shift @_}; 
     37 
     38   $CWD = $CTL_OPTIONS{CWD}; 
    3439 
    3540   my $out_base = $CTL_OPTIONS{out_base}; 
     
    127132 
    128133   #remove deep directory data so log is relative 
    129    my $cwd = Cwd::getcwd(); 
     134   my $cwd = ($CWD) ? $CWD : Cwd::getcwd(); 
    130135   my $entry = join("\t", @F); 
    131  
    132    #while loop is used to solve weird incorrect cwd 
    133    #that happens randomly on the cluster 
    134    while($cwd ne Cwd::getcwd()){ 
    135        $cwd = Cwd::getcwd(); 
    136    } 
    137136 
    138137   if($entry =~ /\tFINISHED|\tSTARTED|\tDIED|\tSKIPPED|\tRETRY/){ 
  • lib/maker/auto_annotator.pm

    r268 r271  
    605605    my $the_void         = shift; 
    606606    my $build            = shift; 
    607     my $CTL_OPTIONS      = shift; 
     607    my $CTL_OPTS      = shift; 
    608608    $LOG                 = shift; 
    609609     
     
    615615     
    616616    #reset gene names 
    617     #my $GFF_DB = new GFFDB($CTL_OPTIONS); 
     617    #my $GFF_DB = new GFFDB($CTL_OPTS); 
    618618    $SEEN = {};#$GFF_DB->get_existing_gene_names($seq_id); 
    619619     
     
    625625                                                  $models, 
    626626                                                  $v_seq_ref, 
    627                                                   $CTL_OPTIONS->{single_exon}, 
    628                                                   $CTL_OPTIONS->{single_length}, 
    629                                                   $CTL_OPTIONS->{organism_type} 
     627                                                  $CTL_OPTS->{single_exon}, 
     628                                                  $CTL_OPTS->{single_length}, 
     629                                                  $CTL_OPTS->{organism_type} 
    630630                                                  ); 
    631631     
     
    642642                                 'model_gff', 
    643643                                 $predictions, 
    644                                  $CTL_OPTION
     644                                 $CTL_OPT
    645645                                 ); 
    646646         
     
    652652                                                      'model_gff', 
    653653                                                      $the_void, 
    654                                                       $CTL_OPTION
     654                                                      $CTL_OPT
    655655                                                      ); 
    656656    } 
    657657     
    658658    #---hint based gene prediction here (includes est2genome) 
    659     foreach my $prdr (@{$CTL_OPTIONS->{_predictor}}){ 
     659    foreach my $prdr (@{$CTL_OPTS->{_predictor}}){ 
    660660        next if($prdr eq 'model_gff' || $prdr eq 'pred_gff'); 
    661661        print STDERR "Producing $prdr hint based annotations\n" unless($main::quiet); 
     
    668668                                 $prdr, 
    669669                                 $predictions, 
    670                                  $CTL_OPTION
     670                                 $CTL_OPT
    671671                                 ); 
    672672         
     
    678678                                      $prdr, 
    679679                                      $the_void, 
    680                                       $CTL_OPTION
     680                                      $CTL_OPT
    681681                                      ); 
    682682         
     
    694694                            'abinit', #all abinits not just pref_gff 
    695695                            $predictions, 
    696                             $CTL_OPTION
     696                            $CTL_OPT
    697697                            ); 
    698698     
     
    704704                                   'abinit', #all abinits not_just pred_gff 
    705705                                   $the_void, 
    706                                    $CTL_OPTION
     706                                   $CTL_OPT
    707707                                   ); 
    708708 
     
    873873    my $annotations = shift; 
    874874    my $out_base = shift; 
    875     my $CTL_OPTIONS = shift; 
     875    my $CTL_OPTS = shift; 
    876876 
    877877    print STDERR "Choosing best annotations\n" unless($main::quiet); 
     
    881881 
    882882    #keep all gff3 passthrough if there's nothing else 
    883     if(@{$CTL_OPTIONS->{_predictor}} == 1 && $CTL_OPTIONS->{_predictor}->[0] eq 'model_gff'){ 
     883    if(@{$CTL_OPTS->{_predictor}} == 1 && $CTL_OPTS->{_predictor}->[0] eq 'model_gff'){ 
    884884        foreach my $g (@{$annotations->{'model_gff'}}){ 
    885885            if($g->{g_strand} == 1){ 
     
    891891        } 
    892892    } 
    893     elsif(@{$CTL_OPTIONS->{_predictor}}){ 
     893    elsif(@{$CTL_OPTS->{_predictor}}){ 
    894894        #set up lists for plus and minus strands as well as possible mergers 
    895895        #predictor types are processed in the order given by control files 
     
    898898        my @p_est2g; 
    899899        my @m_est2g; 
    900         foreach my $p (@{$CTL_OPTIONS->{_predictor}}){ 
     900        foreach my $p (@{$CTL_OPTS->{_predictor}}){ 
    901901            foreach my $g (@{$annotations->{$p}}){ 
    902902                if($p ne 'est2genome' && $p ne 'protein2genome' && $g->{g_strand} == 1){ 
    903                     push(@$p_list, $g) if($g->{AED} < 1 || $p eq 'model_gff'); 
     903                    push(@$p_list, $g) if(($g->{AED} < 1 && $g->{AED} <= $CTL_OPTS->{AED_threshold}) 
     904                                          || $p eq 'model_gff' 
     905                                          ); 
    904906                } 
    905907                elsif($p ne 'est2genome' && $p ne 'protein2genome' && $g->{g_strand} == -1) { 
    906                     push(@$m_list, $g) if($g->{AED} < 1 || $p eq 'model_gff'); 
     908                    push(@$m_list, $g) if(($g->{AED} < 1 && $g->{AED} <= $CTL_OPTS->{AED_threshold}) 
     909                                          || $p eq 'model_gff' 
     910                                          ); 
    907911                } 
    908912                elsif($g->{g_strand} == 1){ 
    909                     push(@p_est2g, $g); #seperate est2genome and protein2genome genes 
     913                    #seperate est2genome and protein2genome genes 
     914                    push(@p_est2g, $g) if($g->{AED} < 1 && $g->{AED} <= $CTL_OPTS->{AED_threshold}); 
    910915                } 
    911916                elsif($g->{g_strand} == -1){ 
    912                     push(@m_est2g, $g); #seperate est2genome and protein2genome genes 
     917                    #seperate est2genome and protein2genome genes 
     918                    push(@m_est2g, $g) if($g->{AED} < 1 && $g->{AED} <= $CTL_OPTS->{AED_threshold}); 
    913919                } 
    914920                else{ 
     
    11551161   my $g = shift; 
    11561162    
    1157    return ($g->{AED} + $g->{abAED})/2
     1163   return $g->{AED} + ($g->{abAED} * 1/3)
    11581164} 
    11591165#------------------------------------------------------------------------ 
     
    12071213        my $model    = $set->{model}; 
    12081214        my $gomiph   = $set->{gomiph}; 
     1215        my $blastx   = get_selected_types($gomiph,'blastx', 'protein_gff'); 
     1216        my $pol_p    = get_selected_types($gomiph,'protein2genome'); 
     1217        my $alt_ests = $set->{alt_ests}; 
     1218        my $preds    = $set->{preds}; 
    12091219 
    12101220        #------gff passthrough 
     
    12241234        if ($predictor eq 'abinit') { 
    12251235            next if(! defined $model); 
    1226              
     1236 
     1237            #added 2/23/2009 to reduce spurious gene predictions with only single exon blastx suport 
     1238            if(! defined $mia && (!@$pol_p  || (@$pol_p == 1 && $pol_p->[0]->hsps == 1))){ 
     1239                my $clean  = clean::purge_single_exon_hits($alt_ests); 
     1240                next if(@$clean); 
     1241                 
     1242                my $coors  = PhatHit_utils::get_hsp_coors($blastx, 'query'); 
     1243                my $pieces = Shadower::getPieces($seq, $coors, 0); 
     1244                 
     1245                if(@$pieces <= 1){ 
     1246                    my $keep; 
     1247                     
     1248                    my $set = get_overlapping_hits($model, $predictions); 
     1249                    $keep = 1 if(@$set); 
     1250                     
     1251                    my $abAED = shadow_AED::get_abAED($set, $model); 
     1252                    $keep = 0 if($abAED > 0.3); 
     1253                         
     1254                    my $AED = shadow_AED::get_AED($blastx,$model); 
     1255                    $keep = 0 if($AED > 0.3); 
     1256                     
     1257                    next if(! $keep); #skip these spurious predictions 
     1258                } 
     1259            }        
     1260   
    12271261            #add UTR to ab-inits 
    12281262            my $transcript = pneu($ests, $model, $seq); 
     
    12961330         
    12971331        #------default hint based behavior 
    1298         my $blastx   = get_selected_types($gomiph,'blastx', 'protein_gff'); 
    1299         my $pol_p    = get_selected_types($gomiph,'protein2genome'); 
    1300         my $alt_ests = $set->{alt_ests}; 
    1301         my $preds    = $set->{preds}; 
    1302          
    13031332        my ($pred_shots, $strand) = get_pred_shot($seq,  
    13041333                                                  $def,  
     
    13131342        my $on_right_strand = get_best_pred_shots($strand, $pred_shots); 
    13141343         
    1315         #added 2/23/2009 to reduce spurious gene predictions with only blastx 
    1316         if(@$on_right_strand > 1 && ! defined $mia && ! @$pol_p && ! @$preds){ 
     1344        #added 2/23/2009 to reduce spurious gene predictions with only single exon blastx suport 
     1345        if(@$on_right_strand && ! defined $mia && (!@$pol_p  || (@$pol_p == 1 && $pol_p->[0]->hsps == 1))){ 
    13171346            my $clean  = clean::purge_single_exon_hits($alt_ests); 
     1347            next if(@$clean); 
     1348 
    13181349            my $coors  = PhatHit_utils::get_hsp_coors($blastx, 'query'); 
    13191350            my $pieces = Shadower::getPieces($seq, $coors, 0); 
    13201351             
    1321             if(! @$clean && @$pieces <= 1){ 
     1352            if(@$pieces <= 1){ 
    13221353                my $keep; 
    13231354                foreach my $h (@$on_right_strand){ 
    13241355                    my $set = get_overlapping_hits($h, $predictions); 
    13251356                    $keep = 1 if(@$set); 
     1357                     
     1358                    my $abAED = shadow_AED::get_abAED($set, $h); 
     1359                    $keep = 0 if($abAED > 0.3); 
     1360 
     1361                    my $AED = shadow_AED::get_AED($blastx,$h); 
     1362                    $keep = 0 if($AED > 0.3); 
    13261363                } 
    13271364 
     
    13551392   my $set         = shift; 
    13561393   my $predictor   = shift; 
    1357    my $CTL_OPTIONS = shift; 
     1394   my $CTL_OPTS = shift; 
    13581395   my $LOG         = shift; 
    13591396 
    13601397   if($predictor eq 'snap'){ 
    1361       my $pred_command = $CTL_OPTIONS->{snap}.' '.$CTL_OPTIONS->{snaphmm}; 
     1398      my $pred_command = $CTL_OPTS->{snap}.' '.$CTL_OPTS->{snaphmm}; 
    13621399      return Widget::snap::get_pred_shot($seq,  
    13631400                                         $def,  
     
    13651402                                         $the_void,  
    13661403                                         $set,  
    1367                                          $CTL_OPTIONS->{pred_flank},  
     1404                                         $CTL_OPTS->{pred_flank},  
    13681405                                         $pred_command, 
    1369                                          $CTL_OPTIONS->{force}, 
     1406                                         $CTL_OPTS->{force}, 
    13701407                                         $LOG 
    13711408                                        ); 
    13721409   } 
    13731410   elsif($predictor eq 'augustus'){ 
    1374       my $pred_command = $CTL_OPTIONS->{augustus}.' --species='.$CTL_OPTIONS->{augustus_species}; 
     1411      my $pred_command = $CTL_OPTS->{augustus}.' --species='.$CTL_OPTS->{augustus_species}; 
    13751412      return Widget::augustus::get_pred_shot($seq,  
    13761413                                             $def,  
     
    13781415                                             $the_void,  
    13791416                                             $set,  
    1380                                              $CTL_OPTIONS->{pred_flank},  
     1417                                             $CTL_OPTS->{pred_flank},  
    13811418                                             $pred_command, 
    1382                                              $CTL_OPTIONS->{force}, 
     1419                                             $CTL_OPTS->{force}, 
    13831420                                             $LOG 
    13841421                                            ); 
    13851422   } 
    13861423   elsif($predictor eq 'fgenesh'){ 
    1387       my $pred_command = $CTL_OPTIONS->{fgenesh}.' '.$CTL_OPTIONS->{fgenesh_par_file}; 
     1424      my $pred_command = $CTL_OPTS->{fgenesh}.' '.$CTL_OPTS->{fgenesh_par_file}; 
    13881425      return Widget::fgenesh::get_pred_shot($seq,  
    13891426                                            $def,  
     
    13911428                                            $the_void,  
    13921429                                            $set,  
    1393                                             $CTL_OPTIONS->{pred_flank},  
     1430                                            $CTL_OPTS->{pred_flank},  
    13941431                                            $pred_command, 
    1395                                             $CTL_OPTIONS->{force}, 
     1432                                            $CTL_OPTS->{force}, 
    13961433                                            $LOG 
    13971434                                           ); 
    13981435   } 
    13991436   elsif($predictor eq 'twinscan'){ 
    1400       my $pred_command = $CTL_OPTIONS->{twinscan}; 
     1437      my $pred_command = $CTL_OPTS->{twinscan}; 
    14011438      return Widget::twinscan::get_pred_shot($seq,  
    14021439                                             $def,  
     
    14041441                                             $the_void,  
    14051442                                             $set,  
    1406                                              $CTL_OPTIONS->{pred_flank},  
     1443                                             $CTL_OPTS->{pred_flank},  
    14071444                                             $pred_command, 
    1408                                              $CTL_OPTIONS->{force}, 
     1445                                             $CTL_OPTS->{force}, 
    14091446                                             $LOG 
    14101447                                            ); 
     
    14271464        my $p_base       = shift; 
    14281465        my $the_void     = shift; 
    1429         my $CTL_OPTIONS  = shift; 
     1466        my $CTL_OPTS  = shift; 
    14301467 
    14311468        my $transcript_seq  = get_transcript_seq($f, $seq); 
     
    15651602   my $predictor    = shift; 
    15661603   my $the_void     = shift; 
    1567    my $CTL_OPTIONS  = shift; 
     1604   my $CTL_OPTS  = shift; 
    15681605 
    15691606   #fix weird sequence names 
     
    16881725         my $p_base = defined($f->{set_id}) ? $p_bases{$f->{set_id}} : undef; 
    16891726 
    1690          my $t_struct = load_transcript_struct($f, $g_name, $i, $seq, $evidence, $p_base, $the_void, $CTL_OPTIONS); 
    1691  
    1692          push(@t_structs, $t_struct) unless ($t_struct->{p_length} < $CTL_OPTIONS->{min_protein} || 
    1693                                              $t_struct->{AED} > $CTL_OPTIONS->{AED_threshold} 
     1727         my $t_struct = load_transcript_struct($f, $g_name, $i, $seq, $evidence, $p_base, $the_void, $CTL_OPTS); 
     1728 
     1729         push(@t_structs, $t_struct) unless ($t_struct->{p_length} < $CTL_OPTS->{min_protein} || 
     1730                                             $t_struct->{AED} > $CTL_OPTS->{AED_threshold} 
    16941731                                             ); 
    16951732 
  • lib/runlog.pm

    r269 r271  
    7777 
    7878my %SEEN; 
     79my $CWD = Cwd::getcwd(); 
    7980 
    8081#------------------------------------------------------------------------------- 
     
    107108   print STDERR "\n\n\n--Next Contig--\n\n" unless($main::quiet); 
    108109 
     110   $CWD = $self->{CTL_OPTIONS}->{CWD}; 
    109111   my $min_contig = $self->{CTL_OPTIONS}->{min_contig}; 
    110112   my $length = $self->{params}->{seq_length}; 
     
    197199        if($continue_flag >= 0 || $continue_flag == -1){ 
    198200            #CHECK CONTROL FILE OPTIONS FOR CHANGES 
    199             my $cwd = Cwd::getcwd();  
    200  
    201             #while loop is used to solve weird incorrect cwd 
    202             #that happens randomly on the cluster 
    203             while($cwd ne Cwd::getcwd()){ 
    204                 $cwd = Cwd::getcwd(); 
    205             } 
     201            my $cwd = ($CWD) ?$CWD : Cwd::getcwd(); 
    206202 
    207203            foreach my $key (@ctl_to_log) { 
     
    218214 
    219215                    #temp lamprey 
    220                     my $chpc = "scratch/serial-pio/u0045039/lamprey2/"; 
    221                     $old =~ s/^$chpc\/*//; 
    222                     $new =~ s/^$chpc\/*//; 
    223                     $chpc = "scratch/serial/u0045039/lamprey2/"; 
    224                     $old =~ s/^$chpc\/*//; 
    225                     $new =~ s/^$chpc\/*//; 
    226  
     216                    $old =~ s/^\/*scratch\/serial[^\/]*\/u0045039\/lamprey2\/*//; 
     217                    $new =~ s/^\/*scratch\/serial[^\/]*\/u0045039\/lamprey2\/*//; 
    227218 
    228219                    #only continue if change not already happening 
     
    269260                if($key eq 'organism_type' && ! $log_val){ 
    270261                    $log_val = 'eukaryotic'; 
     262                } 
     263 
     264                #softmask was always true before and not logged 
     265                if($key eq 'softmask' && $log_val eq ''){ 
     266                    $log_val = 1; 
    271267                } 
    272268                 
     
    614610 
    615611   #log control file options 
    616    my $cwd = Cwd::getcwd(); 
    617  
    618    #while loop is used to solve weird incorrect cwd 
    619    #that happens randomly on the cluster 
    620    while($cwd ne Cwd::getcwd()){ 
    621        $cwd = Cwd::getcwd(); 
    622    } 
     612   my $cwd = ($CWD) ?$CWD : Cwd::getcwd(); 
    623613  
    624614   foreach my $key (@ctl_to_log) { 
     
    650640 
    651641   my $log_file = $self->{file_name}; 
    652    my $cwd = Cwd::getcwd(); 
    653  
    654    #while loop is used to solve weird incorrect cwd 
    655    #that happens randomly on the cluster 
    656    while($cwd ne Cwd::getcwd()){ 
    657        $cwd = Cwd::getcwd(); 
    658    } 
     642   my $cwd = ($CWD) ?$CWD : Cwd::getcwd(); 
    659643 
    660644   #this line hides unnecessarilly deep directory details