root / README @ 59cc9448
Historique | Voir | Annoter | Télécharger (14,82 ko)
1 |
|
---|---|
2 |
Readme / Documentation for *MyLabStocks* |
3 |
**************************************** |
4 |
|
5 |
*MyLabStocks* is a web application allowing to easily store, share and |
6 |
retrieve information about molecular biology materials stored in a |
7 |
laboratory. |
8 |
|
9 |
|
10 |
License |
11 |
======= |
12 |
|
13 |
Copyright CNRS 2012-2013 |
14 |
|
15 |
* Florent CHUFFART |
16 |
|
17 |
* Gael YVERT |
18 |
|
19 |
The Software is provided “as is” without warranty of any kind, either |
20 |
express or implied, including without limitation any implied |
21 |
warranties of condition, uninterrupted use, merchantability, fitness |
22 |
for a particular purpose, or non-infringement. You use this software |
23 |
at your own risk. |
24 |
|
25 |
This software is governed by the CeCILL license under French law and |
26 |
abiding by the rules of distribution of free software. You can use, |
27 |
modify and/ or redistribute the software under the terms of the CeCILL |
28 |
license as circulated by CEA, CNRS and INRIA at the following URL |
29 |
"http://www.cecill.info". |
30 |
|
31 |
As a counterpart to the access to the source code and rights to copy, |
32 |
modify and redistribute granted by the license, users are provided |
33 |
only with a limited warranty and the software's author, the holder |
34 |
of the economic rights, and the successive licensors have only |
35 |
limited liability. |
36 |
|
37 |
This software is provided with absolutely NO WARRANTY. The authors can |
38 |
not be held responsible, even partially, for any damage, loss, |
39 |
financial loss or any other undesired facts resulting from the use of |
40 |
the software. |
41 |
|
42 |
In this respect, the user's attention is drawn to the risks associated |
43 |
with loading, using, modifying and/or developing or reproducing the |
44 |
software by the user in light of its specific status of free software, |
45 |
that may mean that it is complicated to manipulate, and that also |
46 |
therefore means that it is reserved for developers and experienced |
47 |
professionals having in-depth computer knowledge. Users are therefore |
48 |
encouraged to load and test the software's suitability as regards |
49 |
their requirements in conditions enabling the security of their |
50 |
systems and/or data to be ensured and, more generally, to use and |
51 |
operate it in the same conditions as regards security. |
52 |
|
53 |
The fact that you are presently reading this means that you have had |
54 |
knowledge of the CeCILL license and that you accept its terms. |
55 |
|
56 |
|
57 |
Installation Instructions |
58 |
========================= |
59 |
|
60 |
This installation has been fully tested on: |
61 |
* Debian 7.2.0 amd64 netinst [1], running on virtual machine |
62 |
using Oracle VM VirtualBox [2] for macosx (dev) |
63 |
|
64 |
* Ubuntu Server 12.04.3 LTSUbuntu server LTS [3], running on |
65 |
physical machine (prod) |
66 |
|
67 |
[1] http://cdimage.debian.org/debian-cd/7.2.0/amd64/iso- |
68 |
cd/debian-7.2.0-amd64-netinst.iso |
69 |
|
70 |
[2] https://www.virtualbox.org |
71 |
|
72 |
[3] http://www.ubuntu.com/download/server |
73 |
|
74 |
|
75 |
Prerequisites |
76 |
------------- |
77 |
|
78 |
Prior to installing MyLabStocks, a number of packages must be |
79 |
installed on your system. Git is used to retrieve MyLabStocks sources. |
80 |
MySQL, Apache and phpMyAdmin ensure web and database services, it |
81 |
needs php5 and php5-curl packages. Tomcat6 will support advanced |
82 |
plasmid visualisation services (PlasMapper), it needs openjdk-6-jdk |
83 |
and ant. Finally, BLAST is used to analyse sequences, it needs csh. |
84 |
|
85 |
On the targeted server, you can install these packages by typing the |
86 |
following command in a terminal. |
87 |
|
88 |
sudo apt-get install git apache2 mysql-server php5 php5-curl phpmyadmin tomcat6 ant openjdk-6-jdk blast2 csh |
89 |
|
90 |
|
91 |
Get MyLabStocks Sources |
92 |
----------------------- |
93 |
|
94 |
The first installation step is to retrieve the source code of |
95 |
MyLabStocks. You can do this by typing the following command in a |
96 |
terminal. |
97 |
|
98 |
git clone http://forge.cbp.ens-lyon.fr/git/mylabstocks |
99 |
|
100 |
|
101 |
Install wwwBLAST |
102 |
---------------- |
103 |
|
104 |
MyLabStocks uses BLAST queries for several of its features, wwwBLAST |
105 |
is a web interface which provides access to this feature in a user- |
106 |
friendly way. |
107 |
|
108 |
MyLabStocks is distributed with wwwBLAST working on a x64 |
109 |
architecture. For other architectures, please refer to the NCBI |
110 |
repositories http://mirrors.vbi.vt.edu/mirrors/ftp.ncbi.nih.gov/blast |
111 |
/executables/release/LATEST |
112 |
|
113 |
On the targeted server type the following commands in a terminal. |
114 |
|
115 |
cd mylabstocks/opts/ |
116 |
tar xfvz wwwblast-2.2.26-x64-linux.tar.gz |
117 |
sudo cp -r blast /var/www/. |
118 |
sudo chown www-data:www-data /var/www/blast/TmpGifs /var/www/blast/*.log /var/www/blast/db/ |
119 |
|
120 |
echo "Alias /blast /var/www/blast/" > /tmp/blast.conf |
121 |
echo "<Directory /var/www/blast/>" > /tmp/blast.conf |
122 |
echo " Options +ExecCGI" >> /tmp/blast.conf |
123 |
echo "</Directory>" >> /tmp/blast.conf |
124 |
echo "AddHandler cgi-script .cgi" >> /tmp/blast.conf |
125 |
sudo cp /tmp/blast.conf /etc/apache2/conf.d/blast.conf |
126 |
sudo ln -s ../conf.d/blast.conf /etc/apache2/conf-available/blast.conf |
127 |
sudo ln -s ../conf-available/blast.conf /etc/apache2/conf-enabled/blast.conf |
128 |
rm /tmp/blast.conf |
129 |
sudo /etc/init.d/apache2 restart |
130 |
sudo sed -i 's/<option VALUE.*test_na_db/<option VALUE=oligostock_db>oligostock_db<option VALUE=plasmidstock_db>plasmidstock_db<option VALUE=plfeatstock_db>plfeatstock_db/g' /var/www/blast/blast.html |
131 |
sudo sed -i 's/<option VALUE.*test_aa_db//g' /var/www/blast/blast.html |
132 |
cat /var/www/blast/blast.rc > /tmp/blast.rc |
133 |
echo "blastn oligostock_db" >> /tmp/blast.rc |
134 |
echo "tblastn oligostock_db" >> /tmp/blast.rc |
135 |
echo "tblastx oligostock_db" >> /tmp/blast.rc |
136 |
echo "blastn plasmidstock_db" >> /tmp/blast.rc |
137 |
echo "tblastn plasmidstock_db" >> /tmp/blast.rc |
138 |
echo "tblastx plasmidstock_db" >> /tmp/blast.rc |
139 |
echo "blastn plfeatstock_db" >> /tmp/blast.rc |
140 |
echo "tblastn plfeatstock_db" >> /tmp/blast.rc |
141 |
echo "tblastx plfeatstock_db" >> /tmp/blast.rc |
142 |
sudo cp /tmp/blast.rc /var/www/blast/blast.rc |
143 |
rm /tmp/blast.rc |
144 |
cd ../.. |
145 |
|
146 |
Now you have a wwwBLAST instance available here: |
147 |
http://your_server/blast. |
148 |
|
149 |
|
150 |
Install PlasMapper |
151 |
------------------ |
152 |
|
153 |
PlasMapper provides advanced plasmid visualisation features. We use it |
154 |
to produced annoted plasmid maps. To install it, type the following |
155 |
command under a targeted server terminal. |
156 |
|
157 |
cd mylabstocks/opts/ |
158 |
tar xfvz PlasMapper_download.tar.gz |
159 |
cd PlasMapper |
160 |
# modify installdir as /var/lib/tomcat6 |
161 |
sed -i 's/\/home\/tomcat/\/var\/lib\/tomcat6/g' build.xml |
162 |
# modify servletjar as /usr/share/tomcat6/lib/servlet-api.jar |
163 |
sed -i 's/${installdir}\/common\/lib\/servlet-api.jar/\/usr\/share\/tomcat6\/lib\/servlet-api.jar/g' build.xml |
164 |
# change /home/tomcat for /var/lib/tomcat6 |
165 |
sed -i 's/\/home\/tomcat/\/var\/lib\/tomcat6/g' src/ca/ualberta/xdong/plasMapper/annotate/plasMapConfiguration_en_CA.properties |
166 |
# and set blastallDir=/usr/bin/ |
167 |
sed -i 's/\/usr\/local\/bin\//\/usr\/bin\//g' src/ca/ualberta/xdong/plasMapper/annotate/plasMapConfiguration_en_CA.properties |
168 |
# After these steps, PlasMapper is ready to be configured |
169 |
ant clean |
170 |
ant build |
171 |
sudo ant install |
172 |
sudo rm -Rf /var/lib/tomcat6/webapps/PlasMapper/tmp |
173 |
sudo ln -s /tmp/tomcat6-tomcat6-tmp/ /var/lib/tomcat6/webapps/PlasMapper/tmp |
174 |
echo '<?xml version="1.0" encoding="UTF-8"?><Context path="/myapp" allowLinking="true"></Context>' > context.xml |
175 |
sudo mv context.xml /var/lib/tomcat6/webapps/PlasMapper/META-INF/ |
176 |
sudo /etc/init.d/tomcat6 restart |
177 |
# After these steps, PlasMapper works on your server at the url http://myserver:8080/PlasMapper |
178 |
sudo chown root:www-data /var/lib/tomcat6/webapps/PlasMapper/dataBase/db_vectorFeature/*.* |
179 |
sudo chmod 664 /var/lib/tomcat6/webapps/PlasMapper/dataBase/db_vectorFeature/*.* |
180 |
sudo chown root:www-data /var/lib/tomcat6/webapps/PlasMapper/dataBase/db_vectorFeature/ |
181 |
sudo chmod 775 /var/lib/tomcat6/webapps/PlasMapper/dataBase/db_vectorFeature/ |
182 |
sudo chown root:www-data /var/lib/tomcat6/webapps/PlasMapper/html/feature.html |
183 |
sudo chmod 664 /var/lib/tomcat6/webapps/PlasMapper/html/feature.html |
184 |
# Now, plasmid features are ready to be searched by MyLabStocks via BLAST queries. |
185 |
cd ../../.. |
186 |
|
187 |
Now you have a PlasMapper instance available here: |
188 |
http://your_server:8080/PlasMapper. |
189 |
|
190 |
|
191 |
Install MyLabStocks |
192 |
------------------- |
193 |
|
194 |
Now your are ready to install the core of MyLabStocks. It consists of |
195 |
a set of php scripts that you have to deploy on your apache server. To |
196 |
do that, type the following commands in a targeted server terminal. |
197 |
|
198 |
sudo rsync -cauvz mylabstocks/src/ /var/www/labstocks/ |
199 |
sudo rm /var/www/labstocks/install_db.phpsh |
200 |
sudo touch /var/www/labstocks/formatdb.log |
201 |
sudo chmod 440 /var/www/labstocks/connect_entry.php |
202 |
sudo mkdir /var/www/labstocks/plasmid_files |
203 |
sudo mkdir /var/www/labstocks/raw_dirs |
204 |
sudo mkdir /var/www/labstocks/collections |
205 |
sudo chown -R www-data:www-data /var/www/labstocks/connect_entry.php /var/www/labstocks/formatdb.log /var/www/labstocks/plasmid_files /var/www/labstocks/raw_dirs |
206 |
echo "Alias /blast /var/www/blast/" > /tmp/blast.conf |
207 |
echo "<Directory /var/www/blast/>" > /tmp/blast.conf |
208 |
echo " Options +ExecCGI" >> /tmp/blast.conf |
209 |
echo "</Directory>" >> /tmp/blast.conf |
210 |
echo "AddHandler cgi-script .cgi" >> /tmp/blast.conf |
211 |
sudo cp /tmp/blast.conf /etc/apache2/conf.d/blast.conf |
212 |
sudo ln -s ../conf.d/blast.conf /etc/apache2/conf-available/blast.conf |
213 |
sudo ln -s ../conf-available/blast.conf /etc/apache2/conf-enabled/blast.conf |
214 |
rm /tmp/blast.conf |
215 |
|
216 |
|
217 |
Configure MyLabStocks |
218 |
--------------------- |
219 |
|
220 |
For obvious security reasons, it is essential that you now update |
221 |
connexion parameters by editing the script: |
222 |
/var/www/labstocks/connect_entry.php |
223 |
|
224 |
In this script you have to update the following constants: |
225 |
|
226 |
* SERVEUR |
227 |
|
228 |
* NOM |
229 |
|
230 |
* BASE |
231 |
|
232 |
* PASSE |
233 |
|
234 |
* LABNAME |
235 |
|
236 |
sudo vi /var/www/labstocks/connect_entry.php |
237 |
|
238 |
We have prepared the following script to help you define passwords and |
239 |
instantiate the database. This script will ask you to choose a |
240 |
password for basic and administrative access. To use this script, |
241 |
simply type the following command line: |
242 |
|
243 |
sudo php mylabstocks/src/install_db.phpsh |
244 |
|
245 |
Congratulations! Your MyLabStocks instance is now available here: |
246 |
http://your_server/labstocks. |
247 |
|
248 |
Go to http://your_server/labstocks/wwwblast.php to initialize blast |
249 |
databases. |
250 |
|
251 |
|
252 |
Links |
253 |
----- |
254 |
|
255 |
*MyLabStocks* home, repository and documentation: http://forge.cbp |
256 |
.ens-lyon.fr/redmine/projects/mylabstocks |
257 |
|
258 |
Gael Yvert lab: http://www.ens-lyon.fr/LBMC/gisv/ |
259 |
|
260 |
|
261 |
Usage |
262 |
===== |
263 |
|
264 |
|
265 |
Advanced Search |
266 |
--------------- |
267 |
|
268 |
In the strain section, the form *Search in genotype* filters strains |
269 |
where the fields *locus1*, *locus2*, *locus3*, *locus4*, *locus5*, |
270 |
*ADE2*, *HIS3*, *LE U2*, *LYS2*, *MET15*, *TRP1*, *URA3*, *HO_*, |
271 |
*Cytoplasmic_Character* or *extrachromosomal_plasmid* contain the |
272 |
given expression. This filter is case insensitive. |
273 |
|
274 |
|
275 |
Plasmids Sequences Management |
276 |
----------------------------- |
277 |
|
278 |
Even in edit mode, users are not granted permission to directly edit a |
279 |
plasmid sequence, nor the URL to the plasmid sequence file. If a new |
280 |
sequence must be entered instead of the current one, users must upload |
281 |
a new sequence file, in .gb or .gb.gz format. MyLabStocks then |
282 |
automatically reads the file and update the sequence field and the |
283 |
URL. This ensures consistency between URL, sequence and the file |
284 |
itself. |
285 |
|
286 |
|
287 |
Reporting Bugs |
288 |
-------------- |
289 |
|
290 |
If you think you have found a bug and would like to report the |
291 |
problem, then please ensure you have applied all applicable updates. |
292 |
If this is the case, send a description of your problem and some |
293 |
screenshot to florent.chuffart on its ens-lyon.fr email. Thank you for |
294 |
your contribution. |
295 |
|
296 |
|
297 |
Backing up the Mysql Database and Stored Files |
298 |
---------------------------------------------- |
299 |
|
300 |
We HIGHLY RECOMMEND THAT YOU REGULARLY BACKUP your MyLabStocks |
301 |
database. We provide two levels of backup. The first one dumps only |
302 |
the MySQL database. The second one also adds the items' files that |
303 |
were uploaded on the server (plasmid_files and raw_dirs directories |
304 |
from your /var/www/labstocks directory). These two features are |
305 |
available on the bottom of each entry page. The two links in the |
306 |
sentence *Backup the entire system or only the database NOW!* allow |
307 |
any user to download the requested backups. It could be useful for an |
308 |
administrator to integrate it in a robust file backup system using, |
309 |
for example, a cron that regularly pull the archives (wget |
310 |
http://.../labstocks/backup.php?FULL_BACK=1). A third link allow you |
311 |
to export the current table in ''csv'' format. |
312 |
|
313 |
|
314 |
How To Restore System From Backup |
315 |
--------------------------------- |
316 |
|
317 |
On the targeted server, you can restore the database from the last |
318 |
backup file ''labstocks_db.sql'' by typing the following command in a |
319 |
terminal. Not that you need administrator priviledges on the server to |
320 |
do that. This will drop existing tables, create new ones and populate |
321 |
them with data. You need to adapt user, password and database names |
322 |
according to your settings. |
323 |
|
324 |
sudo mysql --user=root --password=root labstocks_db < labstocks_db.sql |
325 |
|
326 |
To restore the uploaded files, you have to copy backed-up directories |
327 |
(''plasmid_files'' and ''raw_dirs'') to the labstocks directory of |
328 |
your server. To do that, on the targeted server, type the following |
329 |
commands in a terminal. |
330 |
|
331 |
sudo cp -r plasmid_files raw_dirs /var/www/labstocks/. |
332 |
|
333 |
|
334 |
Extend Database |
335 |
--------------- |
336 |
|
337 |
MyLabstocks is delivered under a free licence. Feel free to modify and |
338 |
extend it to meet the needs of your lab. To do that you can create new |
339 |
tables using phpMyAdmin (http://your_server/phpmyadmin) or mysql |
340 |
command line tools (documentation here |
341 |
http://dev.mysql.com/doc/refman/5.6/en/mysql.html). MyLabStocks uses |
342 |
the framework phpMyEdit to manage the user interface. You can use the |
343 |
provided tool (http://your_server/phpMyEditSetup.php) to generate |
344 |
code. You can learn how to customize the interface by reading the |
345 |
phpMyEdit embedded documentation |
346 |
(http://your_server/labstocks/doc/html/). |
347 |
|
348 |
|
349 |
Adding New Boxes In The Box Manager |
350 |
----------------------------------- |
351 |
|
352 |
Tu add new boxes in the box manager you have to connect to the box |
353 |
manager in super user mode (or asking to your admin to). In this |
354 |
contexte, at the top of the page appears a link ''Add a new box for |
355 |
your Liquid N2 storage''. Follow this link, fill the form and click |
356 |
the button ''Add this new box''. |
357 |
|
358 |
|
359 |
Modifying The Session Duration |
360 |
------------------------------ |
361 |
|
362 |
To modify the session duration, edit the connect_entry.php |
363 |
configuration file and modify the SESSION_DURATION default value. |
364 |
|
365 |
|
366 |
Extracting the genotypes of multiple strains when preparing a publication |
367 |
------------------------------------------------------------------------- |
368 |
|
369 |
Log in with superuser priviledges. Go to the strains tab, click on the |
370 |
'extract genotypes' link above the table Enter IDs of strains to be |
371 |
retrieved, separated by blank space or commas. Click on 'extract |
372 |
genotypes' button. |
373 |
|
374 |
|
375 |
Clearing Existing Values and Start Over |
376 |
--------------------------------------- |
377 |
|
378 |
Existing values can be deleted from the admin tab using the superuser |
379 |
password. By doing so, you have to take care of the order in which you |
380 |
delete entries. For example, your are allowed to delete an "author" |
381 |
only if this author is no longer associated with any item entry |
382 |
("strain", "lab book", ...). It is therefore necessary to first delete |
383 |
these item entries befor this author. Existing entries can also be |
384 |
deleted via SQL requests or through the phpMyAdmin graphical |
385 |
interface, using the DUMP TABLE command. |