Changeset 269

Show
Ignore:
Timestamp:
09/24/09 11:42:35 (2 months ago)
Author:
cholt
Message:

try to fix weird randon cwd regular expression related error

Files:

Legend:

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

    r268 r269  
    606606      #fix non standard peptides 
    607607      if (defined $alt) { 
    608          $$seq_ref =~ s/\*//g; 
     608         $$seq_ref =~ s/[\*\-]//g; 
    609609         $$seq_ref =~ s/[^abcdefghiklmnpqrstvwyzxABCDEFGHIKLMNPQRSTVWYZX\-\n]/$alt/g; 
     610      } 
     611      #fix nucleotide sequences 
     612      elsif($key !~ /protein/){ 
     613          #most programs use N for masking but for some reason the NCBI decided to 
     614          #use X to mask their sequence, which causes many many programs to fail 
     615          $$seq_ref =~ s/\-//g; 
     616          $$seq_ref =~ s/X/N/g; 
     617          die "ERROR: The nucleotide sequence file \'$file\'\n". 
     618              "appears to contain protein sequence or unrecognized characters.\n". 
     619              "Please check/fix the file before continuing.\n". 
     620              "Invalid Character: $1\n\n" 
     621              if($$seq_ref =~ /([^acgturykmswbdhvnxACGTURYKMSWBDHVNX\-\n])/); 
    610622      } 
    611623 
     
    22372249      $CTL_OPT{'single_length'} = 250; 
    22382250      $CTL_OPT{'min_protein'} = 0; 
    2239       $CTL_OPT{'AED_threshod'} = 1; 
     2251      $CTL_OPT{'AED_threshold'} = 1; 
    22402252      $CTL_OPT{'keep_preds'} = 0; 
    22412253      $CTL_OPT{'map_forward'} = 0; 
  • lib/ds_utility.pm

    r209 r269  
    127127 
    128128   #remove deep directory data so log is relative 
    129    my $cwd = Cwd::cwd(); 
     129   my $cwd = Cwd::getcwd(); 
    130130   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   } 
    131137 
    132138   if($entry =~ /\tFINISHED|\tSTARTED|\tDIED|\tSKIPPED|\tRETRY/){ 
  • lib/runlog.pm

    r268 r269  
    197197        if($continue_flag >= 0 || $continue_flag == -1){ 
    198198            #CHECK CONTROL FILE OPTIONS FOR CHANGES 
    199             my $cwd = Cwd::cwd(); 
    200             while (my $key = each %{$logged_vals{CTL_OPTIONS}}) { 
     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            } 
     206 
     207            foreach my $key (@ctl_to_log) { 
    201208                #these are only sometimes important 
    202209                if($key =~ /^est_pass$|^altest_pass$|^protein_pass$|^rm_pass$/ || 
     
    204211                   ){ 
    205212                    next unless($CTL_OPTIONS{genome_gff}); 
    206                     my $old = $logged_vals{CTL_OPTIONS}{genome_gff}; 
     213                    my $old = (exists $logged_vals{CTL_OPTIONS}{genome_gff}) ?  
     214                        $logged_vals{CTL_OPTIONS}{genome_gff} : ''; 
    207215                    $old =~ s/^$cwd\/*//; 
    208216                    my $new = $CTL_OPTIONS{genome_gff}; 
    209217                    $new =~ s/^$cwd\/*//; 
     218 
     219                    #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 
    210227 
    211228                    #only continue if change not already happening 
     
    365382                        "did not finish on the last run and must be erased\n"; 
    366383                    push(@files, $key); 
     384 
     385                    #this next step will get both temp directories and files that 
     386                    #have the incorrect location in the log but are in theVoid 
    367387                    $key =~ /([^\/]+)$/; 
    368388                    my $rm_f_name = $1; 
     389 
     390                    if(! -e $key && -e "$the_void/$rm_f_name"){ 
     391                        push(@files, $rm_f_name); 
     392                    } 
     393 
    369394                    $rm_f_name =~ s/\.fasta$//; 
    370395                    my @d = <$the_void/*$rm_f_name*>; 
     
    589614 
    590615   #log control file options 
    591    my $cwd = Cwd::cwd(); 
     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   } 
     623  
    592624   foreach my $key (@ctl_to_log) { 
    593625      my $ctl_val = ''; 
     
    618650 
    619651   my $log_file = $self->{file_name}; 
    620    my $cwd = Cwd::cwd(); 
     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   } 
    621659 
    622660   #this line hides unnecessarilly deep directory details 
    623661   #this is important for maker webserver security 
     662   #also important when moving work directory around 
    624663   if(defined $key && defined $type){ 
    625664       $key =~ s/^$cwd\/*// if($type =~ /^STARTED$|^FINISHED$/);