JPRED-2 Current state of the SVN trank
[jpred.git] / jpred / lib / Jpred.pm
index a367d38..7119d28 100755 (executable)
@@ -10,40 +10,78 @@ use warnings;
 use strict;
 
 BEGIN {
-       use Exporter;
-       our @ISA = ('Exporter');
-       our @EXPORT = qw($WEBSERVER $WEBSERVERCGI $SERVERROOT $SRSSERVER $CHKLOG $RESULTS $PDBLNK $CSS $IMAGES $JNET $TIMEOUT $BATCHLIM $DUNDEE $JPREDUSER $JPREDEMAIL $MAILHOST $JPREDROOT $BINDIR $LIBDIR $JOBDIR $PREFIX $RESOURCE $BLASTDB $SWALL $SWALLFILT $PDB $PDB_DAT $JPREDHEAD $JPREDFOOT &xsystem); 
-       our @EXPORT_OK = @EXPORT;
+  use Exporter;
+  our @ISA = ('Exporter');
+  our @EXPORT = qw(
+    $WEBSERVER
+    $WEBSERVERCGI
+    $SERVERROOT
+    $SRSSERVER
+    $CHKLOG
+    $RESULTS
+    $PDBLNK
+    $CSS
+    $IMAGES
+    $JNET
+    $TIMEOUT
+    $BATCHLIM
+    $DUNDEE
+    $JPREDUSER
+    $JPREDEMAIL
+    $MAILHOST
+    $JPREDROOT
+    $BINDIR
+    $LIBDIR
+    $JOBDIR
+    $PREFIX
+    $RESOURCE
+    $BLASTDB
+    $SWALL
+    $SWALLFILT
+    $PDB
+    $PDB_DAT
+    $JPREDHEAD
+    $JPREDFOOT
+    &xsystem
+  );
+  our @EXPORT_OK = @EXPORT;
 }
 
+# library path for Mail::CheckUser dependency for jpred_form.
+# for some reason doesn't work if in PERL5LIB
+use lib '/sw/lib/perl5.10.1/lib/perl5';
+
 # URIs
-#our $WEBSERVER = 'http://www.compbio.dundee.ac.uk/www-jpred';
-our $WEBSERVER = 'http://webserv1.cluster.lifesci.dundee.ac.uk:3209';
+our $WEBSERVER = 'http://www.compbio.dundee.ac.uk/www-jpred';
+
+#our $WEBSERVER    = 'http://webserv1.cluster.lifesci.dundee.ac.uk:3209';
 our $WEBSERVERCGI = "$WEBSERVER/cgi-bin";
+
 #$SERVERROOT = "$WEBSERVER/~www-jpred";
 our $SERVERROOT = "$WEBSERVER";
-our $SRSSERVER = 'http://srs.ebi.ac.uk/srs6bin/cgi-bin';
-our $CHKLOG = "$WEBSERVERCGI/chklog?";
-our $RESULTS = "$SERVERROOT/results";
-our $PDBLNK = "http://www.ebi.ac.uk/pdbsum/";
-our $CSS = "$SERVERROOT/jpred.css";
-our $IMAGES = "$SERVERROOT/images";
-our $JNET = "$SERVERROOT/about.html#jnet";
+our $SRSSERVER  = 'http://srs.ebi.ac.uk/srs6bin/cgi-bin';
+our $CHKLOG     = "$WEBSERVERCGI/chklog?";
+our $RESULTS    = "$SERVERROOT/results";
+our $PDBLNK     = "http://www.ebi.ac.uk/pdbsum/";
+our $CSS        = "$SERVERROOT/jpred.css";
+our $IMAGES     = "$SERVERROOT/images";
+our $JNET       = "$SERVERROOT/about.html#jnet";
 
 # This is the time (in seconds) the job is allowed to take
-our $TIMEOUT = 60 * 60; # now is 60mins
+our $TIMEOUT  = 60 * 60;    # now is 60mins
 our $BATCHLIM = 200;
 
 our $DUNDEE = "http://www.dundee.ac.uk";
 
 # e-mail details
-our $JPREDUSER = 'www-jpred';
+our $JPREDUSER  = 'www-jpred';
 our $JPREDEMAIL = 'www-jpred@compbio.dundee.ac.uk';
-our $MAILHOST = 'smtp.lifesci.dundee.ac.uk';   # CC 19/05/06 - updated to current smtp host from weevil
-
+our $MAILHOST   = 'smtp.lifesci.dundee.ac.uk';        # CC 19/05/06 - updated to current smtp host from weevil
 
 # Server paths
-our $JPREDROOT = '/homes/www-jpred/devel';
+our $JPREDROOT = '/homes/www-jpred/live';
+
+#our $JPREDROOT = '/homes/www-jpred/devel';
 
 # Directory for binaries either on the cluster or on the www server
 our $BINDIR = "$JPREDROOT/bin";
@@ -52,47 +90,44 @@ our $BINDIR = "$JPREDROOT/bin";
 our $LIBDIR = "$JPREDROOT/lib";
 
 # Cluster paths
-our $JOBDIR = "$JPREDROOT/public_html/results";        # directory for output
+our $JOBDIR = "$JPREDROOT/public_html/results";    # directory for output
 
 # Cluster names
-our $PREFIX = "jp_";           # Prefix for job submissions (qstat will only display 10 chars of job name)
-our $RESOURCE = "www_service2";        # Resource for the submission to use
+our $PREFIX   = "jp_";                             # Prefix for job submissions (qstat will only display 10 chars of job name)
+our $RESOURCE = "www_service2";                    # Resource for the submission to use
 
 # Variables for external programs
 # psiblast
 $ENV{BLASTMAT} = "$JPREDROOT/data/blast";
-our $BLASTDB = $JPREDROOT."/databases";
+our $BLASTDB = $JPREDROOT . "/databases";
 $ENV{BLASTDB} = $BLASTDB;
-our $SWALL = "$BLASTDB/uniref90";
+our $SWALL     = "$BLASTDB/uniref90";
 our $SWALLFILT = "$SWALL.filt";
-our $PDB = '/db/blastdb/pdb';
-our $PDB_DAT = '/db/blastdb/DB.dat';
+our $PDB       = '/db/blastdb/pdb';
+our $PDB_DAT   = '/db/blastdb/DB.dat';
 
 # ncoils matrix location
 $ENV{COILSDIR} = "$JPREDROOT/data/coils";
 
 # Error checking system call
 sub xsystem {
-       my ($command) = @_;
-       my $rc = 0xffff & system $command;
-       if ($rc == 0) {
-               return;
-       }
-       elsif ($rc == 0xff00) {
-               print "'$command' failed!\n";
-               die "Jpred failed\n";
-       }
-       elsif (($rc & 0xff) == 0) {
-               $rc >>= 8;
-               die "'$command' did something else! (exited $rc)\n";
-       }
-       else {
-               if ($rc & 0x80) {
-                       $rc &= ~0x80;
-                       print "'$command' dumped core!\n";
-                       die "Jpred failed\n";
-               }
-       }
+  my ($command) = @_;
+  my $rc = 0xffff & system $command;
+  if ( $rc == 0 ) {
+    return;
+  } elsif ( $rc == 0xff00 ) {
+    print "'$command' failed!\n";
+    die "Jpred failed\n";
+  } elsif ( ( $rc & 0xff ) == 0 ) {
+    $rc >>= 8;
+    die "'$command' did something else! (exited $rc)\n";
+  } else {
+    if ( $rc & 0x80 ) {
+      $rc &= ~0x80;
+      print "'$command' dumped core!\n";
+      die "Jpred failed\n";
+    }
+  }
 }
 
 # The header and footer for any HTML produced dynamically