Modify Jpred for JABAWS
[jabaws.git] / binaries / src / jpred / lib / Jpred.pm
index 79c533d..17f6bc1 100755 (executable)
@@ -12,8 +12,39 @@ 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 = 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
+  setup_jpred_env
+  );
   our @EXPORT_OK = @EXPORT;
 }
 
@@ -78,6 +109,22 @@ our $PDB_DAT   = '/db/blastdb/DB.dat';
 # ncoils matrix location
 $ENV{COILSDIR} = "$JPREDROOT/data/coils";
 
+sub setup_jpred_env {
+  my $newJPREDROOT = shift;
+
+  $JPREDROOT = $newJPREDROOT if (defined $newJPREDROOT);
+
+  $BINDIR = "$JPREDROOT/bin";
+  $LIBDIR = "$JPREDROOT/lib";
+  $JOBDIR = "$JPREDROOT/public_html/results";
+
+  $ENV{BLASTMAT} = "$JPREDROOT/data/blast";
+  $BLASTDB = $JPREDROOT . "/databases";
+  $ENV{BLASTDB} = $BLASTDB;
+  $SWALL     = "$BLASTDB/uniref90";
+  $SWALLFILT = "$SWALL.filt";
+}
+
 # Error checking system call
 sub xsystem {
   my ($command) = @_;