Statistiques
| Branche: | Révision :

root / doc / index.rst @ master

Historique | Voir | Annoter | Télécharger (14,93 ko)

1
*****************************************
2
Readme / Documentation for `MyLabStocks`
3
*****************************************
4

    
5

    
6
`MyLabStocks` is a web application allowing to easily store, share and retrieve
7
information about molecular biology materials stored in a laboratory.
8

    
9
License
10
=======
11

    
12
Copyright CNRS 2012-2013
13

    
14
- Florent CHUFFART
15
- Gael YVERT
16

    
17
The Software is provided “as is” without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement. You use this software at your own risk.
18

    
19
This software is governed by the CeCILL license under French law and abiding by the rules of distribution of free software.  You can  use, modify and/ or redistribute the software under the terms of the CeCILL license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
20

    
21
As a counterpart to the access to the source code and  rights to copy, modify and redistribute granted by the license, users are provided only  with a limited warranty  and the software's author,  the holder of the economic rights,  and the successive licensors  have only  limited liability.
22

    
23
This software is provided with absolutely NO WARRANTY. The authors can not be held responsible, even partially, for any damage, loss, financial loss or any other undesired facts resulting from the use of the software.
24

    
25
In this respect, the user's attention is drawn to the risks associated with loading,  using,  modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean  that it is complicated to manipulate,  and  that  also therefore means  that it is reserved for developers  and  experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and,  more generally, to use and operate it in the same conditions as regards security.
26

    
27
The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms.
28

    
29
Installation Instructions
30
=========================
31

    
32
This installation has been fully tested on:
33
  -  Debian 7.2.0 amd64 netinst [1], running on virtual machine using Oracle VM VirtualBox [2] for macosx (dev)
34
  -  Ubuntu Server 12.04.3 LTSUbuntu server LTS [3], running on physical machine (prod)
35

    
36
[1] http://cdimage.debian.org/debian-cd/7.2.0/amd64/iso-cd/debian-7.2.0-amd64-netinst.iso
37

    
38
[2] https://www.virtualbox.org
39

    
40
[3] http://www.ubuntu.com/download/server
41

    
42
Prerequisites
43
-------------
44

    
45
Prior to installing MyLabStocks, a number of packages must be installed on your system. Git is used to retrieve MyLabStocks sources. MySQL, Apache and phpMyAdmin ensure web and database services, it needs php5 and php5-curl packages. Tomcat6 will support advanced plasmid visualisation services (PlasMapper), it needs openjdk-6-jdk and ant. Finally, BLAST is used to analyse sequences, it needs csh.
46

    
47
On the targeted server, you can install these packages by typing the following command in a terminal.
48

    
49
.. code:: bash
50

    
51
  sudo apt-get install git apache2 mysql-server php5 php5-curl phpmyadmin tomcat6 ant openjdk-6-jdk blast2 csh
52
..
53

    
54

    
55
Get MyLabStocks Sources
56
------------------------
57

    
58
The first installation step is to retrieve the source code of MyLabStocks. You can do this by typing the following command in a terminal.
59

    
60
.. code:: bash
61

    
62
  git clone http://forge.cbp.ens-lyon.fr/git/mylabstocks
63
..
64

    
65

    
66
Install wwwBLAST
67
----------------
68

    
69
MyLabStocks uses BLAST queries for several of its features, wwwBLAST is a web interface which provides access to this feature in a user-friendly way.
70

    
71
MyLabStocks is distributed with wwwBLAST working on a x64 architecture.
72
For other architectures, please refer to the NCBI repositories
73
http://mirrors.vbi.vt.edu/mirrors/ftp.ncbi.nih.gov/blast/executables/release/LATEST
74

    
75
On the targeted server type the following commands in a terminal.
76

    
77
.. code:: bash
78

    
79
  cd mylabstocks/opts/
80
  tar xfvz wwwblast-2.2.26-x64-linux.tar.gz
81
  sudo cp -r blast /var/www/.
82
  sudo chown www-data:www-data /var/www/blast/TmpGifs /var/www/blast/*.log /var/www/blast/db/
83

    
84
  echo "Alias /blast /var/www/blast/" > /tmp/blast.conf
85
  echo "<Directory /var/www/blast/>" > /tmp/blast.conf
86
  echo "   Options +ExecCGI" >> /tmp/blast.conf
87
  echo "</Directory>" >> /tmp/blast.conf
88
  echo "AddHandler cgi-script .cgi" >> /tmp/blast.conf
89
  sudo cp /tmp/blast.conf /etc/apache2/conf.d/blast.conf
90
  sudo ln -s ../conf.d/blast.conf /etc/apache2/conf-available/blast.conf
91
  sudo ln -s ../conf-available/blast.conf /etc/apache2/conf-enabled/blast.conf
92
  rm /tmp/blast.conf
93
  sudo /etc/init.d/apache2 restart
94
  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
95
  sudo sed -i 's/<option VALUE.*test_aa_db//g' /var/www/blast/blast.html
96
  cat /var/www/blast/blast.rc > /tmp/blast.rc
97
  echo "blastn oligostock_db" >> /tmp/blast.rc
98
  echo "tblastn oligostock_db" >> /tmp/blast.rc
99
  echo "tblastx oligostock_db" >> /tmp/blast.rc
100
  echo "blastn plasmidstock_db" >> /tmp/blast.rc
101
  echo "tblastn plasmidstock_db" >> /tmp/blast.rc
102
  echo "tblastx plasmidstock_db" >> /tmp/blast.rc
103
  echo "blastn plfeatstock_db" >> /tmp/blast.rc
104
  echo "tblastn plfeatstock_db" >> /tmp/blast.rc
105
  echo "tblastx plfeatstock_db" >> /tmp/blast.rc
106
  sudo cp /tmp/blast.rc /var/www/blast/blast.rc
107
  rm /tmp/blast.rc
108
  cd ../..
109
..
110

    
111

    
112
Now you have a wwwBLAST instance available here: http://your_server/blast.
113

    
114

    
115
Install PlasMapper
116
------------------
117

    
118
PlasMapper provides advanced plasmid visualisation features. We use it to produced annoted plasmid maps. To install it, type the following command under a targeted server terminal.
119

    
120
.. code:: bash
121

    
122
  cd mylabstocks/opts/
123
  tar xfvz PlasMapper_download.tar.gz
124
  cd PlasMapper
125
  # modify installdir as /var/lib/tomcat6
126
  sed -i 's/\/home\/tomcat/\/var\/lib\/tomcat6/g' build.xml
127
  # modify servletjar as /usr/share/tomcat6/lib/servlet-api.jar
128
  sed -i 's/${installdir}\/common\/lib\/servlet-api.jar/\/usr\/share\/tomcat6\/lib\/servlet-api.jar/g' build.xml
129
  # change /home/tomcat for /var/lib/tomcat6
130
  sed -i 's/\/home\/tomcat/\/var\/lib\/tomcat6/g' src/ca/ualberta/xdong/plasMapper/annotate/plasMapConfiguration_en_CA.properties
131
  # and set blastallDir=/usr/bin/
132
  sed -i 's/\/usr\/local\/bin\//\/usr\/bin\//g' src/ca/ualberta/xdong/plasMapper/annotate/plasMapConfiguration_en_CA.properties
133
  # After these steps, PlasMapper is ready to be configured
134
  ant clean
135
  ant build
136
  sudo ant install
137
  sudo rm -Rf /var/lib/tomcat6/webapps/PlasMapper/tmp
138
  sudo ln -s /tmp/tomcat6-tomcat6-tmp/ /var/lib/tomcat6/webapps/PlasMapper/tmp
139
  echo '<?xml version="1.0" encoding="UTF-8"?><Context path="/myapp" allowLinking="true"></Context>' > context.xml
140
  sudo mv context.xml /var/lib/tomcat6/webapps/PlasMapper/META-INF/
141
  sudo /etc/init.d/tomcat6 restart
142
  # After these steps, PlasMapper works on your server at the url http://myserver:8080/PlasMapper
143
  sudo chown root:www-data /var/lib/tomcat6/webapps/PlasMapper/dataBase/db_vectorFeature/*.*
144
  sudo chmod 664 /var/lib/tomcat6/webapps/PlasMapper/dataBase/db_vectorFeature/*.*
145
  sudo chown root:www-data /var/lib/tomcat6/webapps/PlasMapper/dataBase/db_vectorFeature/
146
  sudo chmod 775 /var/lib/tomcat6/webapps/PlasMapper/dataBase/db_vectorFeature/
147
  sudo chown root:www-data /var/lib/tomcat6/webapps/PlasMapper/html/feature.html
148
  sudo chmod 664 /var/lib/tomcat6/webapps/PlasMapper/html/feature.html
149
  #  Now, plasmid features are ready to be searched by MyLabStocks via BLAST queries.
150
  cd ../../..
151
..
152

    
153
Now you have a PlasMapper instance available here: http://your_server:8080/PlasMapper.
154

    
155

    
156
Install MyLabStocks
157
-------------------
158

    
159
Now your are ready to install the core of MyLabStocks. It consists of a set of php scripts that you have to deploy on your apache server. To do that, type the following commands in a targeted server terminal.
160

    
161
.. code:: bash
162

    
163
  sudo rsync -cauvz mylabstocks/src/ /var/www/labstocks/
164
  sudo rm /var/www/labstocks/install_db.phpsh
165
  sudo touch /var/www/labstocks/formatdb.log
166
  sudo chmod 440 /var/www/labstocks/connect_entry.php
167
  sudo mkdir /var/www/labstocks/plasmid_files
168
  sudo mkdir /var/www/labstocks/raw_dirs
169
  sudo mkdir /var/www/labstocks/collections
170
  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
171
  echo "Alias /blast /var/www/blast/" > /tmp/blast.conf
172
  echo "<Directory /var/www/blast/>" > /tmp/blast.conf
173
  echo "   Options +ExecCGI" >> /tmp/blast.conf
174
  echo "</Directory>" >> /tmp/blast.conf
175
  echo "AddHandler cgi-script .cgi" >> /tmp/blast.conf
176
  sudo cp /tmp/blast.conf /etc/apache2/conf.d/blast.conf
177
  sudo ln -s ../conf.d/blast.conf /etc/apache2/conf-available/blast.conf
178
  sudo ln -s ../conf-available/blast.conf /etc/apache2/conf-enabled/blast.conf
179
  rm /tmp/blast.conf
180
..
181

    
182
Configure MyLabStocks
183
---------------------
184

    
185
For obvious security reasons, it is essential that you now update connexion parameters by editing the script: /var/www/labstocks/connect_entry.php
186

    
187
In this script you have to update the following constants:
188

    
189
  - SERVEUR
190
  - NOM
191
  - BASE
192
  - PASSE
193
  - LABNAME
194

    
195

    
196
.. code:: bash
197

    
198
  sudo vi /var/www/labstocks/connect_entry.php
199
..
200

    
201
We have prepared the following script to help you define passwords and instantiate the database. This script will ask you to choose a password for basic and administrative access. To use this script, simply type the following command line:
202

    
203
.. code:: bash
204

    
205
  sudo php mylabstocks/src/install_db.phpsh
206
..
207

    
208
Congratulations! Your MyLabStocks instance is now available here: http://your_server/labstocks.
209

    
210
Go to http://your_server/labstocks/wwwblast.php to initialize blast databases.
211

    
212
Links
213
-----
214

    
215
`MyLabStocks` home, repository and documentation: http://forge.cbp.ens-lyon.fr/redmine/projects/mylabstocks
216

    
217
Gael Yvert lab: http://www.ens-lyon.fr/LBMC/gisv/
218

    
219

    
220

    
221

    
222

    
223
Usage
224
=====
225

    
226
Advanced Search
227
---------------
228

    
229
In the strain section, the form `Search in genotype` filters strains where the
230
fields `locus1`, `locus2`, `locus3`, `locus4`, `locus5`, `ADE2`, `HIS3`, `LE  U2`,
231
`LYS2`, `MET15`, `TRP1`, `URA3`, `HO_`, `Cytoplasmic_Character` or
232
`extrachromosomal_plasmid` contain the given expression. This filter is case
233
insensitive.
234

    
235
Plasmids Sequences Management
236
-----------------------------
237

    
238
Even in edit mode, users are not granted permission to directly edit a plasmid
239
sequence, nor the URL to the plasmid sequence file. If a new sequence must be
240
entered instead of the current one, users must upload a new sequence file, in
241
.gb or .gb.gz format. MyLabStocks then automatically reads the file and update
242
the sequence field and the URL. This ensures consistency between URL, sequence
243
and the file itself.
244

    
245

    
246
Reporting Bugs
247
--------------
248

    
249
If you think you have found a bug and would like to report the problem, then please ensure you have applied all applicable updates. If this is the case, send a description of your problem and some screenshot to florent.chuffart on its ens-lyon.fr email. Thank you for your contribution.
250

    
251

    
252

    
253
Backing up the Mysql Database and Stored Files
254
----------------------------------------------
255

    
256
We HIGHLY RECOMMEND THAT YOU REGULARLY BACKUP your MyLabStocks
257
database. We provide two levels of backup. The first one dumps only the
258
MySQL database. The second one also adds the items' files that were uploaded on the server (plasmid_files and raw_dirs directories from your /var/www/labstocks
259
directory). These two features are available on the bottom of each entry page. The two links in the sentence *Backup the entire system or only the
260
database NOW!* allow any user to download the requested backups. It
261
could be useful for an administrator to integrate it in a robust file
262
backup system using, for example, a cron that regularly pull the
263
archives (wget http://.../labstocks/backup.php?FULL_BACK=1). A third link allow you to export the current table in ''csv'' format.
264

    
265

    
266

    
267
How To Restore System From Backup
268
---------------------------------
269

    
270
On the targeted server, you can restore the database from the last backup
271
file ''labstocks_db.sql'' by typing the following command in a
272
terminal. Not that you need administrator priviledges on the server to do that. This will drop existing tables, create new ones and populate them with data.
273
You need to adapt user, password and database names according to your
274
settings.
275

    
276

    
277
.. code:: bash
278

    
279
  sudo mysql --user=root --password=root labstocks_db < labstocks_db.sql
280
..
281

    
282

    
283
To restore the uploaded files, you have to copy backed-up directories
284
(''plasmid_files'' and ''raw_dirs'') to the labstocks directory of your server. To do that, on the targeted server, type the following commands in a
285
terminal.
286

    
287
.. code:: bash
288

    
289
  sudo cp -r plasmid_files raw_dirs /var/www/labstocks/.
290
..
291

    
292

    
293
Extend Database
294
---------------
295

    
296
MyLabstocks is delivered under a free licence. Feel free to modify and
297
extend it to meet the needs of your lab. To do that you can
298
create new tables using phpMyAdmin
299
(http://your_server/phpmyadmin)
300
or mysql command line tools (documentation here
301
http://dev.mysql.com/doc/refman/5.6/en/mysql.html).
302
MyLabStocks uses the  framework phpMyEdit to manage the user interface. You can use the provided tool (http://your_server/phpMyEditSetup.php) to generate code.
303
You can learn how to customize the interface by reading the phpMyEdit embedded documentation (http://your_server/labstocks/doc/html/).
304

    
305
Adding New Boxes In The Box Manager
306
-----------------------------------
307

    
308
Tu add new boxes in the box manager you have to connect to the box manager in super user mode (or asking to your admin to). In this contexte, at the top of the page appears a link ''Add a new box for your Liquid N2 storage''. Follow this link, fill the form and click the button ''Add this new box''.
309

    
310
Modifying The Session Duration
311
------------------------------
312

    
313
To modify the session duration, edit the connect_entry.php configuration file and modify the SESSION_DURATION default value.
314

    
315

    
316
Extracting the genotypes of multiple strains when preparing a publication
317
-------------------------------------------------------------------------
318

    
319
Log in with superuser priviledges.
320
Go to the strains tab, click on the 'extract genotypes' link above the table
321
Enter IDs of strains to be retrieved, separated by blank space or commas.
322
Click on 'extract genotypes' button.
323

    
324

    
325
Clearing Existing Values and Start Over
326
---------------------------------------
327

    
328
Existing values can be deleted from the admin tab using the superuser password. By doing so, you have to take care of the order in which you delete entries. For example, your are allowed to delete an "author" only if this author is no longer associated with any item entry ("strain", "lab book", ...). It is therefore necessary to first delete these item entries befor this author. Existing entries can also be deleted via SQL requests or through the phpMyAdmin graphical interface, using the DUMP TABLE command.
329