Statistiques
| Branche: | Révision :

root / doc / index.rst @ 71c3bfe5

Historique | Voir | Annoter | Télécharger (14,97 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
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. 
23
                                                                          
24
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.                                     
25
                                                                          
26
The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms.           
27

    
28
Installation Instructions
29
=========================
30

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

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

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

    
41
Prerequisites
42
-------------
43

    
44
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.
45

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

    
48
.. code:: bash
49

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

    
53

    
54
Get MyLabStocks Sources
55
------------------------
56

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

    
59
.. code:: bash
60

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

    
64

    
65
Install wwwBLAST
66
----------------
67

    
68
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.
69

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

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

    
76
.. code:: bash
77

    
78
  cd mylabstocks/opts/
79
  tar xfvz wwwblast-2.2.26-x64-linux.tar.gz
80
  sudo cp -r blast /var/www/.
81
  sudo chown www-data:www-data /var/www/blast/TmpGifs /var/www/blast/*.log /var/www/blast/db/
82
  echo "<Directory /var/www/blast/>" > /tmp/blast.conf 
83
  echo "   Options +ExecCGI" >> /tmp/blast.conf 
84
  echo "</Directory>" >> /tmp/blast.conf 
85
  echo "AddHandler cgi-script .cgi" >> /tmp/blast.conf 
86
  sudo cp /tmp/blast.conf /etc/apache2/conf.d/blast.conf 
87
  rm /tmp/blast.conf
88
  sudo /etc/init.d/apache2 restart
89
  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
90
  sudo sed -i 's/<option VALUE.*test_aa_db//g' /var/www/blast/blast.html
91
  cat /var/www/blast/blast.rc > /tmp/blast.rc
92
  echo "blastn oligostock_db" >> /tmp/blast.rc
93
  echo "tblastn oligostock_db" >> /tmp/blast.rc
94
  echo "tblastx oligostock_db" >> /tmp/blast.rc
95
  echo "blastn plasmidstock_db" >> /tmp/blast.rc
96
  echo "tblastn plasmidstock_db" >> /tmp/blast.rc
97
  echo "tblastx plasmidstock_db" >> /tmp/blast.rc
98
  echo "blastn plfeatstock_db" >> /tmp/blast.rc
99
  echo "tblastn plfeatstock_db" >> /tmp/blast.rc
100
  echo "tblastx plfeatstock_db" >> /tmp/blast.rc
101
  sudo cp /tmp/blast.rc /var/www/blast/blast.rc
102
  rm /tmp/blast.rc
103
  cd ../..
104
..
105

    
106

    
107
Now you have a wwwBLAST instance available here: http://your_server/blast.
108

    
109

    
110
Install PlasMapper
111
------------------
112

    
113
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.
114

    
115
.. code:: bash
116

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

    
148
Now you have a PlasMapper instance available here: http://your_server:8080/PlasMapper.
149

    
150

    
151
Install MyLabStocks
152
-------------------
153

    
154
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.
155

    
156
.. code:: bash
157

    
158
  sudo rsync -cauvz mylabstocks/src/ /var/www/labstocks/
159
  sudo rm /var/www/labstocks/install_db.phpsh
160
  sudo touch /var/www/labstocks/formatdb.log
161
  sudo chmod 440 /var/www/labstocks/connect_entry.php 
162
  sudo mkdir /var/www/labstocks/plasmid_files 
163
  sudo mkdir /var/www/labstocks/raw_dirs
164
  sudo mkdir /var/www/labstocks/collections
165
  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
166
..
167

    
168
Configure MyLabStocks
169
---------------------
170

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

    
173
In this script you have to update the following constants: 
174

    
175
  - SERVEUR
176
  - NOM
177
  - BASE
178
  - PASSE
179
  - LABNAME
180
  
181

    
182
.. code:: bash
183

    
184
  sudo vi /var/www/labstocks/connect_entry.php 
185
..
186

    
187
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:
188

    
189
.. code:: bash
190

    
191
  sudo php mylabstocks/src/install_db.phpsh 
192
..
193

    
194
Congratulations! Your MyLabStocks instance is now available here: http://your_server/labstocks.
195

    
196
Go to http://your_server/labstocks/wwwblast.php to initialize blast databases.
197

    
198
Links
199
-----
200

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

    
203
Gael Yvert lab: http://www.ens-lyon.fr/LBMC/gisv/
204

    
205

    
206

    
207

    
208

    
209
Usage
210
=====
211

    
212
Advanced Search
213
---------------
214

    
215
In the strain section, the form `Search in genotype` filters strains where the 
216
fields `locus1`, `locus2`, `locus3`, `locus4`, `locus5`, `ADE2`, `HIS3`, `LE  U2`, 
217
`LYS2`, `MET15`, `TRP1`, `URA3`, `HO_`, `Cytoplasmic_Character` or 
218
`extrachromosomal_plasmid` contain the given expression. This filter is case 
219
insensitive.
220

    
221
Plasmids Sequences Management
222
-----------------------------
223

    
224
Even in edit mode, users are not granted permission to directly edit a plasmid 
225
sequence, nor the URL to the plasmid sequence file. If a new sequence must be 
226
entered instead of the current one, users must upload a new sequence file, in 
227
.gb or .gb.gz format. MyLabStocks then automatically reads the file and update 
228
the sequence field and the URL. This ensures consistency between URL, sequence 
229
and the file itself.
230

    
231

    
232
Reporting Bugs
233
--------------
234

    
235
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.
236

    
237

    
238

    
239
Backing up the Mysql Database and Stored Files
240
----------------------------------------------
241

    
242
We HIGHLY RECOMMEND THAT YOU REGULARLY BACKUP your MyLabStocks
243
database. We provide two levels of backup. The first one dumps only the
244
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
245
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
246
database NOW!* allow any user to download the requested backups. It
247
could be useful for an administrator to integrate it in a robust file
248
backup system using, for example, a cron that regularly pull the
249
archives (wget http://.../labstocks/backup.php?FULL_BACK=1). A third link allow you to export the current table in ''csv'' format.
250

    
251

    
252

    
253
How To Restore System From Backup
254
---------------------------------
255

    
256
On the targeted server, you can restore the database from the last backup
257
file ''labstocks_db.sql'' by typing the following command in a
258
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.
259
You need to adapt user, password and database names according to your
260
settings.
261

    
262

    
263
.. code:: bash
264

    
265
  sudo mysql --user=root --password=root labstocks_db < labstocks_db.sql 
266
..
267

    
268

    
269
To restore the uploaded files, you have to copy backed-up directories
270
(''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
271
terminal.
272

    
273
.. code:: bash
274

    
275
  sudo cp -r plasmid_files raw_dirs /var/www/labstocks/. 
276
..
277

    
278

    
279
Extend Database
280
---------------
281

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

    
291
Adding New Boxes In The Box Manager
292
-----------------------------------
293

    
294
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''.  
295

    
296
Modifying The Session Duration
297
------------------------------
298

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

    
301

    
302
Extracting the genotypes of multiple strains when preparing a publication
303
-------------------------------------------------------------------------
304

    
305
Log in with superuser priviledges.
306
Go to the strains tab, click on the 'extract genotypes' link above the table
307
Enter IDs of strains to be retrieved, separated by blank space or commas.
308
Click on 'extract genotypes' button.
309

    
310

    
311
Clearing Existing Values and Start Over 
312
--------------------------------------- 
313

    
314
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.
315