README.md 8.4 KB
Newer Older
ysard's avatar
ysard committed
1
2
3
4
CADBIOM (Computer Aided Design of Biological Models) is an open source modelling software.
Based on Guarded transition semantic, it gives a formal framework to help the modelling of
biological systems such as cell signaling network.

VIGNET Pierre's avatar
VIGNET Pierre committed
5
Official website: [link](http://cadbiom.genouest.org/)
6

ysard's avatar
ysard committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

# Installation

## System requirements

CADBIOM is mainly developed in Python 2.7.
Before running Cadbiom, the following system packages have to be installed from
the distribution packages library (or similar, depending on your operating system):

* python-gtksourceview2
* python2.7-dev
* libxml2-dev
* libxslt1-dev
* libgraphviz-dev
* python-glade2
* python-gtk2

24
25
26
27
28
29
30
31
32
Fix errors when installing pygraphviz and when config is not loaded:

* pkg-config

For Matplotlib installation:

* libpng12-dev
* libfreetype6-dev

ysard's avatar
ysard committed
33
34
You can install these dependencies with the following command (on Debian systems):

35
36
    sudo apt-get install python-gtksourceview2 python2.7-dev libxml2-dev libxslt1-dev \
    libxslt1-dev libgraphviz-dev pkg-config python-glade2 python-gtk2 libpng12-dev libfreetype6-dev
ysard's avatar
ysard committed
37
38
39
40


## Python requirements

41
42
When `cadbiom` library is installed, the following Python packages
will be installed from pypi repository:
ysard's avatar
ysard committed
43
44
45
46

* lxml
* networkx
* pygraphviz
47
48
* matplotlib
* numpy
ysard's avatar
ysard committed
49
50
* pycryptosat

VIGNET Pierre's avatar
VIGNET Pierre committed
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

### Virtual environment

This is not a mandatory step but it is a good practice to use virtual environments
to separate projects from each other.

* Install virtualenvwrapper:

    pip install virtualenvwrapper


* Edit your .bashrc or .zshrc file to source the virtualenvwrapper.sh script with these lines:

    export WORKON_HOME=~/.virtualenvs
    mkdir -p $WORKON_HOME
    source /usr/bin/virtualenvwrapper.sh

The location of this script may vary depending on your Linux distro


* Restart your terminal or run:

    source /usr/bin/virtualenvwrapper.sh


* Create your virtualenv:

    mkvirtualenv cadbiom -p /usr/bin/python2.7


* Later if you want to reactivate the virtualenv:

    workon cadbiom


86
87
### SAT solver

VIGNET Pierre's avatar
VIGNET Pierre committed
88
Cadbiom software requires a SAT solver which is
ysard's avatar
ysard committed
89
90
proposed as a Python wrapper by an independant library (pycryptosat).

VIGNET Pierre's avatar
VIGNET Pierre committed
91
92
*For now, pycryptosat is not on pypi; so we use a fork from
[Cryptominisat repository](https://github.com/msoos/cryptominisat/tree/5.0.1)*
93

VIGNET Pierre's avatar
VIGNET Pierre committed
94
Here you will find the installation commands of the pycryptosat package:
95
96
97
98
99
100

    git clone https://gitlab.irisa.fr/0000B8EG/pycryptosat/tree/5.0.1_cmake_dev
    mkdir build
    cd build && cmake ../
    make python_interface_install

VIGNET Pierre's avatar
VIGNET Pierre committed
101

102
103
### Cadbiom

VIGNET Pierre's avatar
VIGNET Pierre committed
104
If you want to install the library with its GUI, and command line in one command,
105
106
107
108
109
after the git clone step, just do:

    make install

---
ysard's avatar
ysard committed
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167

For the library itself:

* From Python Package Index:

    pip install cadbiom_cmd


* From the current repository

    cd library && make install
    cd ../command_line && make install


For the command line tool:


* From Python Package Index:

    pip install cadbiom_cmd


* From the current repository

    cd library && make install
    cd ../command_line && make install


For the GUI:

* From Python Package Index:

    pip install cadbiom_gui


* From the current repository

    cd library && make install
    cd ../gui && make install


# Structure of packages

The library contains the cadbiom folder with 4 modules:

    antlr3 (folder)
    bio_models (folder)
    models (folder)

The command line tool exposes the command `cadbiom_cmd` to the current context.

The gui package exposes the command `cadbiom` to the current context.


# Utilization

## Command line

ysard's avatar
ysard committed
168
### General:
ysard's avatar
ysard committed
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199

    $ cadbiom_cmd -h

    usage: cadbiom_cmd [-h] [-vv [VERBOSE]]
                        {compute_macs,sort_solutions,parse_trajectories,merge_cams}
                        ...

    optional arguments:
    -h, --help            show this help message and exit
    -vv [VERBOSE], --verbose [VERBOSE]

    subcommands:
    {compute_macs,sort_solutions,parse_trajectories,merge_cams}
        compute_macs        Parse arguments and launch Cadbiom search of MACs
                            (Minimal Activation Conditions). - If there is no
                            input file, there will be only one process. - If an
                            input file is given, there will be 1 process per line
                            (per logical formula on each line). - all_macs: Solver
                            will try to search all macs with 0 to the maximum of
                            steps allowed. - continue: If there is a mac file from
                            a previous work, last frontier places will be
                            reloaded.
        sort_solutions      Parse a solution file and sort all frontier places in
                            alphabetical order.
        parse_trajectories  Parse a complete solution file and make a
                            representation of trajectories.
                            The output is in graphml file format and is exported
                            in 'graphs' directory. .. note:: Requires the
                            model file.
        merge_cams          Merge solutions to a csv file. .. note:: CSV file:
                            <Final property formula>;<cam>
200
201
202
203
        model_comp          Model consistency checking. Check if the 2 given
                            models have the same topology, nodes & edges
                            attributes/roles. .. note:: You can export a graphml
                            file for the 2 models.
204
205
206
        model_infos         Model informations. Get number of nodes, edges,
                            centralities (degree, closeness, betweenness). ..
                            note:: You can export a graphml file for model.
ysard's avatar
ysard committed
207
208


ysard's avatar
ysard committed
209
### compute_macs:
ysard's avatar
ysard committed
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233

    usage: cadbiom_cmd compute_macs [-h] [--input_file [INPUT_FILE]]
                                    [--combinations] [--steps [STEPS]]
                                    [--all_macs] [--continue]
                                    [--start_prop [START_PROP]]
                                    [--inv_prop [INV_PROP]] [--output [OUTPUT]]
                                    chart_file [final_prop]

    positional arguments:
    chart_file
    final_prop

    optional arguments:
    -h, --help            show this help message and exit
    --input_file [INPUT_FILE]
    --combinations
    --steps [STEPS]
    --all_macs
    --continue
    --start_prop [START_PROP]
    --inv_prop [INV_PROP]
    --output [OUTPUT]


ysard's avatar
ysard committed
234
### parse_trajectories:
ysard's avatar
ysard committed
235
236
237
238
239
240
241
242

    usage: cadbiom_cmd parse_trajectories [-h] chart_file sol_file

    positional arguments:
    chart_file
    sol_file

<br>
ysard's avatar
ysard committed
243
* Result:
ysard's avatar
ysard committed
244
245
246

[image](examples/graph_example_with_legend.png)

ysard's avatar
ysard committed
247
* Cytoscape styles:
ysard's avatar
ysard committed
248

249
[file](examples/cytoscape_styles.xml)
ysard's avatar
ysard committed
250
251


ysard's avatar
ysard committed
252
### sort_solutions:
ysard's avatar
ysard committed
253
254
255
256
257
258
259

    usage: cadbiom_cmd sort_solutions [-h] sol_file

    positional arguments:
    sol_file


ysard's avatar
ysard committed
260
### merge_cams:
ysard's avatar
ysard committed
261
262
263
264
265
266
267

    usage: cadbiom_cmd merge_cams [-h] [--output [OUTPUT]] [solutions_directory]

    positional arguments:
    solutions_directory


268
269
270
271
272
273
274
275
276
277
### model_comp:

    usage: cadbiom_cmd model_comp [-h] [--make_graphs] model_file_1 model_file_2

    positional arguments:
    model_file_1
    model_file_2

    optional arguments:
    -h, --help     show this help message and exit
VIGNET Pierre's avatar
VIGNET Pierre committed
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
    --graphs
    --json
    --output [OUTPUT]

<br>

Usage in scripts:

    >>> from cadbiom_cmd.solution_repr import graph_isomorph_test
    >>> print(graph_isomorph_test('test.bcx', 'test2.bcx', output_dir='graphs/',
        make_graphs=False, make_json=False))
    INFO: 3 transitions loaded
    INFO: 3 transitions loaded
    INFO: BUILD GRAPH FOR SOL: Connexin_32_0 Connexin_26_0
    INFO: BUILD GRAPH FOR SOL: Connexin_32_0 Connexin_26_0
    INFO: Topology checking: True
    INFO: Nodes checking: True
    INFO: Edges checking: True
    {u'nodes': True, u'edges': True, u'topology': True}
297
298


299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
### model_infos

    usage: cadbiom_cmd model_infos [-h] [--graph] [--json] [--output [OUTPUT]]
                                model_file

    positional arguments:
    model_file

    optional arguments:
    -h, --help         show this help message and exit
    --graph
    --json
    --output [OUTPUT]


ysard's avatar
ysard committed
314
315
316
317
318
319
320
## Graphical User Interface

Usage:

    $ cadbiom


ysard's avatar
ysard committed
321
322
323
324
325
326
327
328
329
## Logging

Logs are stored in the system temporary dictory:

* On Windows, the directories C:\TEMP, C:\TMP, \TEMP, and \TMP, in that order.
* On all other platforms, the directories /tmp, /var/tmp, and /usr/tmp, in that order.
* As a last resort, the current working directory.


ysard's avatar
ysard committed
330
331
332
# License

CADBIOM is freely available on cadbiom.genouest.org,
ysard's avatar
ysard committed
333
and distributed under the terms of the GNU General Public License.