JWS-67 insert Jpred 3.0.1 sources into JABAWS
[jabaws.git] / binaries / src / jpred / lib / Jpred.pm
1 package Jpred;
2
3 =head1 NAME
4
5 jpred.pm -- Jpred module to define all necessary global and environment variables
6
7 =cut
8
9 use warnings;
10 use strict;
11
12 BEGIN {
13   use Exporter;
14   our @ISA = ('Exporter');
15   our @EXPORT =
16     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);
17   our @EXPORT_OK = @EXPORT;
18 }
19
20 # library path for Mail::CheckUser dependency for jpred_form.
21 # for some reason doesn't work if in PERL5LIB
22 use lib '/sw/lib/perl5.10.1/lib/perl5';
23
24 # URIs
25 #our $WEBSERVER    = 'http://www.compbio.dundee.ac.uk/www-jpred';
26 our $WEBSERVER    = 'http://webserv1.cluster.lifesci.dundee.ac.uk:3209';
27 our $WEBSERVERCGI = "$WEBSERVER/cgi-bin";
28
29 #$SERVERROOT = "$WEBSERVER/~www-jpred";
30 our $SERVERROOT = "$WEBSERVER";
31 our $SRSSERVER  = 'http://srs.ebi.ac.uk/srs6bin/cgi-bin';
32 our $CHKLOG     = "$WEBSERVERCGI/chklog?";
33 our $RESULTS    = "$SERVERROOT/results";
34 our $PDBLNK     = "http://www.ebi.ac.uk/pdbsum/";
35 our $CSS        = "$SERVERROOT/jpred.css";
36 our $IMAGES     = "$SERVERROOT/images";
37 our $JNET       = "$SERVERROOT/about.html#jnet";
38
39 # This is the time (in seconds) the job is allowed to take
40 our $TIMEOUT  = 60 * 60;    # now is 60mins
41 our $BATCHLIM = 200;
42
43 our $DUNDEE = "http://www.dundee.ac.uk";
44
45 # e-mail details
46 our $JPREDUSER  = 'www-jpred';
47 our $JPREDEMAIL = 'www-jpred@compbio.dundee.ac.uk';
48 our $MAILHOST   = 'smtp.lifesci.dundee.ac.uk';        # CC 19/05/06 - updated to current smtp host from weevil
49
50 # Server paths
51 #our $JPREDROOT = '/homes/www-jpred/live';
52 #our $JPREDROOT = '/homes/www-jpred/devel';
53 our $JPREDROOT = '/home/asherstnev/Projects/Jpred.project/jpred/branches/portable';
54
55 # Directory for binaries either on the cluster or on the www server
56 our $BINDIR = "$JPREDROOT/bin";
57
58 # path to perl modules
59 our $LIBDIR = "$JPREDROOT/lib";
60
61 # Cluster paths
62 our $JOBDIR = "$JPREDROOT/public_html/results";       # directory for output
63
64 # Cluster names
65 our $PREFIX   = "jp_";                                # Prefix for job submissions (qstat will only display 10 chars of job name)
66 our $RESOURCE = "www_service2";                       # Resource for the submission to use
67
68 # Variables for external programs
69 # psiblast
70 $ENV{BLASTMAT} = "$JPREDROOT/data/blast";
71 our $BLASTDB = $JPREDROOT . "/databases";
72 $ENV{BLASTDB} = $BLASTDB;
73 our $SWALL     = "$BLASTDB/uniref90";
74 our $SWALLFILT = "$SWALL.filt";
75 our $PDB       = '/db/blastdb/pdb';
76 our $PDB_DAT   = '/db/blastdb/DB.dat';
77
78 # ncoils matrix location
79 $ENV{COILSDIR} = "$JPREDROOT/data/coils";
80
81 # Error checking system call
82 sub xsystem {
83   my ($command) = @_;
84   my $rc = 0xffff & system $command;
85   if ( $rc == 0 ) {
86     return;
87   } elsif ( $rc == 0xff00 ) {
88     print "'$command' failed!\n";
89     die "Jpred failed\n";
90   } elsif ( ( $rc & 0xff ) == 0 ) {
91     $rc >>= 8;
92     die "'$command' did something else! (exited $rc)\n";
93   } else {
94     if ( $rc & 0x80 ) {
95       $rc &= ~0x80;
96       print "'$command' dumped core!\n";
97       die "Jpred failed\n";
98     }
99   }
100 }
101
102 # The header and footer for any HTML produced dynamically
103 our $JPREDHEAD = "      <div id=\"header\">
104
105          <a href=\"$DUNDEE\">
106          <img class=\"uod\" src=\"$IMAGES/logo_white_small.gif\" height=\"100\" width=\"108\" title=\"University of Dundee\" alt=\"University of Dundee Logo\" />
107          </a>
108         <a href=\"$SERVERROOT/index.html\"> 
109         <img src=\"$IMAGES/jpred3.png\" border=\"0\" height=\"102\" width=\"520\" title=\"Jpred Logo\" alt=\"Jpred Logo\" />
110         </a>
111          <a href=\"http://www.compbio.dundee.ac.uk\">
112             <img src=\"$IMAGES/group.png\" border=\"0\" height=\"102\" width=\"70\" title=\"Group Link\" alt=\"The Barton Group\" />
113          </a>
114
115          <div id=\"navigation\">
116             <table border=\"0\" cellpadding=\"0\" width=\"100%\">
117                <tr>
118                   <td class=\"nav_table\"><a class=\"nav\" href=\"$SERVERROOT/index.html\">Home</a></td>
119
120                   <td class=\"nav_table\"><a class=\"nav\" href=\"$SERVERROOT/about.html\">About</a></td>
121                   <td class=\"nav_table\"><a class=\"nav\" href=\"$SERVERROOT/new.html\">News</a></td>
122                   <td class=\"nav_table\"><a class=\"nav\" href=\"$SERVERROOT/faq.html\">FAQ</a></td>
123                   <td class=\"nav_table\"><a class=\"nav\" href=\"$SERVERROOT/help.html\">Help</a></td>
124                   <td class=\"nav_table\"><a class=\"nav\" href=\"$SERVERROOT/contact.html\">Contact</a></td>
125                </tr>
126
127              </table>
128          </div> <!-- End #navigation -->
129       </div> <!-- End #header -->
130 ";
131
132 our $JPREDFOOT = '
133       <script type="text/javascript">
134          var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
135          document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
136       </script>
137       <script type="text/javascript">
138          try{
139             var pageTracker = _gat._getTracker("UA-5356328-1");
140             pageTracker._trackPageview();
141          } catch(err) {}
142       </script>
143 ';
144 1;
145
146 =head1 DESCRIPTION
147
148 This module defines all the global and envirnmental variables required by the Jpred server scripts and binaries.
149
150 =head1 AUTHOR
151
152 I'm not sure who originally wrote this module, but I guess all of the following contributed:
153
154 James Cuff
155 Jon Barber
156 Chris Cole <christian@cole.name> (current maintainer)
157
158 =cut