| 1 |
BioMAJ3 |
| 2 |
===== |
| 3 |
|
| 4 |
This project is a complete rewrite of BioMAJ and the documentation is available here : http://biomaj.genouest.org. |
| 5 |
|
| 6 |
BioMAJ (BIOlogie Mise A Jour) is a workflow engine dedicated to data |
| 7 |
synchronization and processing. The Software automates the update cycle and the |
| 8 |
supervision of the locally mirrored databank repository. |
| 9 |
|
| 10 |
Common usages are to download remote databanks (Genbank for example) and apply |
| 11 |
some transformations (blast indexing, emboss indexing, etc.). Any script can be |
| 12 |
applied on downloaded data. When all treatments are successfully applied, bank |
| 13 |
is put in "production" on a dedicated release directory. |
| 14 |
With cron tasks, update tasks can be executed at regular interval, data are |
| 15 |
downloaded again only if a change is detected. |
| 16 |
|
| 17 |
More documentation is available in wiki page. |
| 18 |
|
| 19 |
BioMAJ is python 2 and 3 compatible until release 3.1.17. |
| 20 |
After 3.1.17, only python 3 is supported. |
| 21 |
|
| 22 |
Getting started |
| 23 |
=============== |
| 24 |
|
| 25 |
Edit global.properties file to match your settings. Minimal conf are database connection and directories. |
| 26 |
|
| 27 |
biomaj-cli.py -h |
| 28 |
|
| 29 |
biomaj-cli.py --config global.properties --status |
| 30 |
|
| 31 |
biomaj-cli.py --config global.properties --bank alu --update |
| 32 |
|
| 33 |
Migration |
| 34 |
========= |
| 35 |
|
| 36 |
To migrate from previous BioMAJ 1.x, a script is available at: |
| 37 |
https://github.com/genouest/biomaj-migrate. Script will import old database to |
| 38 |
the new database, and update configuration files to the modified format. Data directory is the same. |
| 39 |
|
| 40 |
Migration for 3.0 to 3.1: |
| 41 |
|
| 42 |
Biomaj 3.1 provides an optional micro service architecture, allowing to separate and distributute/scale biomaj components on one or many hosts. This implementation is optional but recommended for server installations. Monolithic installation can be kept for local computer installation. |
| 43 |
To upgrade an existing 3.0 installation, as biomaj code has been split into multiple components, it is necessary to install/update biomaj python package but also biomaj-cli and biomaj-daemon packages. Then database must be upgraded manually (see Upgrading in documentation). |
| 44 |
|
| 45 |
To execute database migration: |
| 46 |
|
| 47 |
python biomaj_migrate_database.py |
| 48 |
|
| 49 |
Application Features |
| 50 |
==================== |
| 51 |
|
| 52 |
* Synchronisation: |
| 53 |
* Multiple remote protocols (ftp, ftps, http, local copy, etc.) |
| 54 |
* Data transfers integrity check |
| 55 |
* Release versioning using a incremental approach |
| 56 |
* Multi threading |
| 57 |
* Data extraction (gzip, tar, bzip) |
| 58 |
* Data tree directory normalisation |
| 59 |
* Plugins support for custom downloads |
| 60 |
|
| 61 |
* Pre &Post processing : |
| 62 |
* Advanced workflow description (D.A.G) |
| 63 |
* Post-process indexation for various bioinformatics software (blast, srs, fastacmd, readseq, etc.) |
| 64 |
* Easy integration of personal scripts for bank post-processing automation |
| 65 |
|
| 66 |
* Supervision: |
| 67 |
* Optional Administration web interface (biomaj-watcher) |
| 68 |
* CLI management |
| 69 |
* Mail alerts for the update cycle supervision |
| 70 |
* Prometheus and Influxdb optional integration |
| 71 |
* Optional consul supervision of processes |
| 72 |
|
| 73 |
|
| 74 |
* Scalability: |
| 75 |
* Monolithic (local install) or microservice architecture (remote access to a BioMAJ server) |
| 76 |
* Microservice installation allows per process scalability and supervision (number of process in charge of download, execution, etc.) |
| 77 |
|
| 78 |
* Remote access: |
| 79 |
* Optional FTP server providing authenticated or anonymous data access |
| 80 |
* HTTP access to bank files (/db endpoint, microservice setup only) |
| 81 |
|
| 82 |
Dependencies |
| 83 |
============ |
| 84 |
|
| 85 |
Packages: |
| 86 |
|
| 87 |
* Debian: libcurl-dev, gcc |
| 88 |
* CentOs: libcurl-devel, openldap-devel, gcc |
| 89 |
|
| 90 |
Linux tools: tar, unzip, gunzip, bunzip |
| 91 |
|
| 92 |
Database: |
| 93 |
* mongodb (local or remote) |
| 94 |
|
| 95 |
Indexing (optional): |
| 96 |
* elasticsearch (global property, use_elastic=1) |
| 97 |
|
| 98 |
ElasticSearch indexing adds advanced search features to biomaj to find bank having files with specific format or type. |
| 99 |
Configuration of ElasticSearch is not in the scope of BioMAJ documentation. |
| 100 |
For a basic installation, one instance of ElasticSearch is enough (low volume of data), in such a case, the ElasticSearch configuration file should be modified accordingly: |
| 101 |
|
| 102 |
node.name: "biomaj" (or any other name) |
| 103 |
index.number_of_shards: 1 |
| 104 |
index.number_of_replicas: 0 |
| 105 |
|
| 106 |
Installation |
| 107 |
============ |
| 108 |
|
| 109 |
From source: |
| 110 |
|
| 111 |
After dependencies installation, go in BioMAJ source directory: |
| 112 |
|
| 113 |
pip install . |
| 114 |
|
| 115 |
From packages: |
| 116 |
|
| 117 |
pip install biomaj biomaj-cli biomaj-daemon |
| 118 |
|
| 119 |
You should consider using a Python virtual environment (virtualenv) to install BioMAJ. |
| 120 |
|
| 121 |
In tools/examples, copy the global.properties and update it to match your local |
| 122 |
installation. |
| 123 |
|
| 124 |
The tools/process contains example process files (python and shell). |
| 125 |
|
| 126 |
Docker |
| 127 |
====== |
| 128 |
|
| 129 |
You can use BioMAJ with Docker (osallou/biomaj-docker) |
| 130 |
|
| 131 |
docker pull osallou/biomaj-docker |
| 132 |
docker pull mongo |
| 133 |
docker run --name biomaj-mongodb -d mongo |
| 134 |
# Wait ~10 seconds for mongo to initialize |
| 135 |
# Create a local directory where databases will be permanently stored |
| 136 |
# *local_path* |
| 137 |
docker run --rm -v local_path:/var/lib/biomaj --link biomaj-mongodb:biomaj-mongodb osallou/biomaj-docker --help |
| 138 |
|
| 139 |
Copy your bank properties in directory *local_path*/conf and post-processes (if any) in *local_path*/process |
| 140 |
|
| 141 |
You can override global.properties in /etc/biomaj/global.properties (-v xx/global.properties:/etc/biomaj/global.properties) |
| 142 |
|
| 143 |
No default bank property file or process are available in the container. |
| 144 |
|
| 145 |
Examples are available at https://github.com/genouest/biomaj-data |
| 146 |
|
| 147 |
|
| 148 |
Import bank templates |
| 149 |
===================== |
| 150 |
|
| 151 |
Once biomaj is installed, it is possible to import some bank examples with the biomaj client |
| 152 |
|
| 153 |
|
| 154 |
# List available templates |
| 155 |
biomaj-cli ... --data-list |
| 156 |
# Import a bank template |
| 157 |
biomaj-cli ... --data-import --bank alu |
| 158 |
# then edit bank template in config directory if needed and launch bank update |
| 159 |
biomaj-cli ... --update --bank alu |
| 160 |
|
| 161 |
Plugins |
| 162 |
======= |
| 163 |
|
| 164 |
BioMAJ support python plugins to manage custom downloads where supported protocols |
| 165 |
are not enough (http page with unformatted listing, access to protected pages, etc.). |
| 166 |
|
| 167 |
Example of plugins and how to configure them are available on [biomaj-plugins](https://github.com/genouest/biomaj-plugins) repository. |
| 168 |
|
| 169 |
Plugins can define a specific way to: |
| 170 |
|
| 171 |
* retreive release |
| 172 |
* list remote files to download |
| 173 |
* download remote files |
| 174 |
|
| 175 |
Plugin can define one or many of those features. |
| 176 |
|
| 177 |
Basically, one defined in bank property file: |
| 178 |
|
| 179 |
# Location of plugins |
| 180 |
plugins_dir=/opt/biomaj-plugins |
| 181 |
# Use plugin to fetch release |
| 182 |
release.plugin=github |
| 183 |
# List of arguments of plugin function with key=value format, comma separated |
| 184 |
release.plugin_args=repo=osallou/goterra-cli |
| 185 |
|
| 186 |
Plugins are used when related workflow step is used: |
| 187 |
|
| 188 |
* release.plugin <= returns remote release |
| 189 |
* remote.plugin <= returns list of files to download |
| 190 |
* download.plugin <= download files from list of files |
| 191 |
|
| 192 |
API documentation |
| 193 |
================= |
| 194 |
|
| 195 |
https://readthedocs.org/projects/biomaj/ |
| 196 |
|
| 197 |
Status |
| 198 |
====== |
| 199 |
|
| 200 |
[](https://travis-ci.org/genouest/biomaj) |
| 201 |
|
| 202 |
[](https://readthedocs.org/projects/biomaj/?badge=latest) |
| 203 |
|
| 204 |
[](https://landscape.io/github/genouest/biomaj/master) |
| 205 |
|
| 206 |
Testing |
| 207 |
======= |
| 208 |
|
| 209 |
Execute unit tests |
| 210 |
|
| 211 |
python -m pytest -v tests/biomaj_tests.py |
| 212 |
|
| 213 |
Execute unit tests but disable ones needing network access |
| 214 |
|
| 215 |
NETWORK=0 python -m pytest -v tests/biomaj_tests.py |
| 216 |
|
| 217 |
|
| 218 |
Monitoring |
| 219 |
========== |
| 220 |
|
| 221 |
InfluxDB (optional) can be used to monitor biomaj. Following series are available: |
| 222 |
|
| 223 |
* biomaj.banks.quantity (number of banks) |
| 224 |
* biomaj.production.size.total (size of all production directories) |
| 225 |
* biomaj.workflow.duration (workflow duration) |
| 226 |
* biomaj.production.size.latest (size of latest update) |
| 227 |
* biomaj.bank.update.downloaded_files (number of downloaded files) |
| 228 |
* biomaj.bank.update.new (track updates) |
| 229 |
|
| 230 |
*WARNING* Influxdb database must be created, biomaj does not create the database (see https://docs.influxdata.com/influxdb/v1.6/query_language/database_management/#create-database) |
| 231 |
|
| 232 |
License |
| 233 |
======= |
| 234 |
|
| 235 |
A-GPL v3+ |
| 236 |
|
| 237 |
Remarks |
| 238 |
======= |
| 239 |
|
| 240 |
To delete elasticsearch index: |
| 241 |
|
| 242 |
curl -XDELETE '<http://localhost:9200/biomaj_test/'> |
| 243 |
|
| 244 |
Credits |
| 245 |
======= |
| 246 |
|
| 247 |
Special thanks for tuco at Pasteur Institute for the intensive testing and new ideas. |
| 248 |
Thanks to the old BioMAJ team for the work they have done. |
| 249 |
|
| 250 |
BioMAJ is developped at IRISA research institute. |