[Bio] / FigKernelPackages / ServerThing.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/ServerThing.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.43, Fri Mar 19 03:43:08 2010 UTC revision 1.44, Fri Mar 19 15:08:27 2010 UTC
# Line 468  Line 468 
468      my $testFileName = "$FIG_Config::organisms/$genomeA/CorrToReferenceGenomes/$genomeB";      my $testFileName = "$FIG_Config::organisms/$genomeA/CorrToReferenceGenomes/$genomeB";
469      if (0 && -f $testFileName) {      if (0 && -f $testFileName) {
470          # Use the pre-computed file.          # Use the pre-computed file.
471          Trace("Using pre-computed file $fileName for genome correspondence.") if T(3);          Trace("Using pre-computed file $fileName for genome correspondence.") if T(Corr => 3);
472          $fileName = $testFileName;          $fileName = $testFileName;
473      } elsif (-f $corrFileName) {      } elsif (-f $corrFileName) {
474          $fileName = $corrFileName;          $fileName = $corrFileName;
475          Trace("Using cached file $fileName for genome correspondence.") if T(3);          Trace("Using cached file $fileName for genome correspondence.") if T(Corr => 3);
476      }      }
477      # Return the result.      # Return the result.
478      return ($fileName, $converse);      return ($fileName, $converse);
# Line 599  Line 599 
599              # Everything is ok, fix the permissions and return the file name.              # Everything is ok, fix the permissions and return the file name.
600              chmod 0664, $corrFileName;              chmod 0664, $corrFileName;
601              $fileName = $corrFileName;              $fileName = $corrFileName;
602              Trace("Created correspondence file $fileName.") if T(3);              Trace("Created correspondence file $fileName.") if T(Corr => 3);
603          }          }
604      }      }
605      # If the temporary file exists, delete it.      # If the temporary file exists, delete it.
# Line 695  Line 695 
695      Trace("Reading correspondence file $fileName.") if T(3);      Trace("Reading correspondence file $fileName.") if T(3);
696      if (! open $ih, "<$fileName") {      if (! open $ih, "<$fileName") {
697          # Here the open failed, so we have an error.          # Here the open failed, so we have an error.
698          Trace("Failed to open gene correspondence file $fileName: $!") if T(3);          Trace("Failed to open gene correspondence file $fileName: $!") if T(Corr => 1);
699          $error = 1;          $error = 1;
700      }      }
701      # The gene correspondence list will be built in here.      # The gene correspondence list will be built in here.
# Line 716  Line 716 
716          }          }
717          # Validate the row.          # Validate the row.
718          if (ValidateGeneCorrespondenceRow(\@row)) {          if (ValidateGeneCorrespondenceRow(\@row)) {
719              Trace("Invalid row $. found in correspondence file $fileName.") if T(3);              Trace("Invalid row $. found in correspondence file $fileName.") if T(Corr => 1);
720              $error = 1;              $error = 1;
721          }          }
722          # If this row is in the correct direction, keep it.          # If this row is in the correct direction, keep it.
# Line 731  Line 731 
731          if ($reverseFound) {          if ($reverseFound) {
732              $retVal = \@corrList;              $retVal = \@corrList;
733          } else {          } else {
734              Trace("No reverse arrow found in correspondence file $fileName.") if T(3);              Trace("No reverse arrow found in correspondence file $fileName.") if T(Corr => 1);
735          }          }
736      }      }
737      # Return the result (if any).      # Return the result (if any).
# Line 801  Line 801 
801      # Check for non-numeric values in the number columns.      # Check for non-numeric values in the number columns.
802      for my $col (@{NUM_COLS()}) {      for my $col (@{NUM_COLS()}) {
803          unless ($row->[$col] =~ /^-?\d+\.?\d*(?:e[+-]?\d+)?$/) {          unless ($row->[$col] =~ /^-?\d+\.?\d*(?:e[+-]?\d+)?$/) {
804                Trace("Gene correspondence error. \"$row->[$col]\" not numeric.") if T(Corr => 2);
805              $retVal++;              $retVal++;
806          }          }
807      }      }
808      # Check the gene IDs.      # Check the gene IDs.
809      for my $col (0, 1) {      for my $col (0, 1) {
810          unless ($row->[$col] =~ /^fig\|\d+\.\d+\.\w+\.\d+$/) {          unless ($row->[$col] =~ /^fig\|\d+\.\d+\.\w+\.\d+$/) {
811                Trace("Gene correspondence error. \"$row->[$col]\" not a gene ID.") if T(Corr => 2);
812              $retVal++;              $retVal++;
813          }          }
814      }      }
815      # Verify the arrow.      # Verify the arrow.
816      unless (exists ARROW_FLIP->{$row->[8]}) {      unless (exists ARROW_FLIP->{$row->[8]}) {
817            Trace("Gene correspondence error. \"$row->[8]\" not an arrow.") if T(Corr => 2);
818          $retVal++;          $retVal++;
819      }      }
820      # Return the error count.      # Return the error count.

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3