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