Révision d072e29c src/wwwblast.php
b/src/wwwblast.php | ||
---|---|---|
2 | 2 |
session_start (); |
3 | 3 |
require("headers.php"); |
4 | 4 |
|
5 |
/*************************/ |
|
6 |
// |
|
7 |
// Connect to DB and |
|
8 |
// handle session/authentification |
|
9 |
// |
|
10 |
/*************************/ |
|
11 |
require_once ("connect_entry.php"); |
|
12 |
require_once ("session.php"); |
|
13 |
// connect to DB |
|
14 |
$connexion = mysql_pconnect (SERVEUR, NOM, PASSE); |
|
15 |
if (!$connexion) |
|
16 |
{ |
|
17 |
echo "Sorry, connexion to " . SERVEUR . " failed\n"; |
|
18 |
exit; |
|
19 |
} |
|
20 |
if (!mysql_select_db (BASE, $connexion)) |
|
21 |
{ |
|
22 |
echo "Sorry, connexion to database " . BASE . " failed\n"; |
|
23 |
exit; |
|
24 |
} |
|
25 |
// authentification |
|
26 |
CleanOldSessions($connexion); |
|
27 |
$session = ControleAcces ("wwwblast.php", $_POST, session_id(), $connexion); |
|
28 |
if (!is_object($session)) { |
|
29 |
exit; |
|
30 |
} |
|
31 |
|
|
32 |
/*************************/ |
|
33 |
// |
|
34 |
// Verify login and priviledges |
|
35 |
// |
|
36 |
/*************************/ |
|
37 |
|
|
38 |
// just in case: |
|
39 |
// check that visitor is in read-only mode |
|
40 |
if ($session->mode != "view" && $session->login != "superuser"){ |
|
41 |
echo "Sorry, you should log in <B> view </B> mode<p>"; |
|
42 |
echo "Please logout and try again with appropriate login<P>"; |
|
43 |
exit; |
|
44 |
} |
|
45 |
|
|
46 |
require_once("seq2fasta.php"); |
|
5 |
require_once("lib/seq.lib.php"); |
|
47 | 6 |
|
48 | 7 |
// Create an updated fasta |
49 | 8 |
// file of all oligos |
... | ... | |
170 | 129 |
$fasta_content .= $toprint[$i] . "\n"; |
171 | 130 |
} |
172 | 131 |
} |
173 |
|
|
174 | 132 |
fclose($FastaFile); |
175 |
|
|
176 |
/*************************/ |
|
177 |
// |
|
178 | 133 |
// Using the fasta file |
179 | 134 |
// Create the blast database |
180 | 135 |
// and place it in the appropriate directory for wwwblast |
181 |
// |
|
182 |
/*************************/ |
|
183 |
|
|
184 | 136 |
$cmd_formatdb = FORMATDB_CMD." -i $blastbasename -p F -o T"; |
185 | 137 |
echo "<pre>$cmd_formatdb</pre>"; |
186 | 138 |
system($cmd_formatdb, $retval1); |
187 | 139 |
|
188 | 140 |
if ($retval1 != 0){ |
189 |
echo "<b><font color='red'>ERROR!</font></b> while formatting the FASTA database into BLAST format. <a href=formatdb.log>formatdb.log</a>";
|
|
141 |
echo "Error while formatting the FASTA database into BLAST format";
|
|
190 | 142 |
exit; |
191 | 143 |
} |
192 |
|
|
193 | 144 |
$html_feat_cnt = <<<EOD |
194 | 145 |
<html> |
195 | 146 |
<head> |
... | ... | |
206 | 157 |
</body> |
207 | 158 |
</html> |
208 | 159 |
EOD; |
209 |
|
|
210 | 160 |
$html_feat_filename = PLASMAPPER_HOME . "html/feature.html"; |
211 | 161 |
$fp = fopen($html_feat_filename, 'w'); |
212 | 162 |
fwrite($fp, $html_feat_cnt); |
213 | 163 |
fclose($fp); |
214 |
|
|
215 | 164 |
echo "Blast has updated PlasMapper with the latest plasmid's features."; |
216 |
|
|
217 | 165 |
?> |
218 | 166 |
|
219 |
|
|
220 |
|
|
221 |
|
|
222 |
|
|
223 |
|
|
224 |
|
|
225 |
|
|
226 |
|
|
227 |
|
|
228 |
|
|
229 | 167 |
<center> |
230 | 168 |
<iframe src="/blast/blast.html" width="100%" height="90%" border="0"/> |
231 |
</center> |
|
232 |
|
|
233 |
|
|
234 |
|
|
235 |
|
|
236 |
|
|
237 |
|
|
238 |
|
|
239 |
|
|
240 |
|
|
241 |
|
|
242 |
|
|
243 |
|
|
244 |
|
|
169 |
</center> |
Formats disponibles : Unified diff