Nov 29, 2015
Generate readme
|
|
|
74 |
``` |
|
75 |
|
|
76 |
| | bptf| cbfa2t3h| csf1r| dnmt3a| eif2b1| |
|
77 |
|-----------|--------:|---------:|--------:|--------:|-------:| |
|
78 |
| lmpp\_002 | 1.0261| 2.3944| 2.6847| 1.6636| 2.0203| |
|
79 |
| lmpp\_003 | 2.6496| 1.7800| 1.6821| 1.5941| 2.7736| |
|
80 |
| lmpp\_004 | 10.3080| 0.5889| 4.2653| -0.5565| 0.0026| |
|
81 |
| lmpp\_007 | 0.5419| 1.8631| 10.8468| 0.1757| 1.0873| |
|
82 |
| lmpp\_008 | 0.9209| 2.6637| 2.8549| 2.1965| 2.3663| |
|
83 |
|
Nov 29, 2015
Generate readme
|
|
|
88 |
1. Initial Boolean model. A data frame with two columns, targets and update functions. |
|
89 |
|
|
90 |
Note that if an update function contains both activation and inhibition genes, they must be expressed with a separate clause containing only activation genes, and a separate clause containing only inhibition genes. (See the update functions of Gata1 and Gata2 for examples) |
|
91 |
|
|
92 |
Use `initialise_model` to convert the input Boolean model into a BoolModel object. |
|
93 |
|
|
94 |
``` r |
|
95 |
data(krum_bmodel) |
|
96 |
head(krum_bmodel) |
|
97 |
``` |
|
98 |
|
|
99 |
| targets | factors | |
|
100 |
|:--------|:-----------------------------------| |
|
101 |
| gata2 | gata2 & ! ((gata1 & fog1) | sfpi1) | |
|
102 |
| gata1 | (gata1 | gata2 | fli1) & ! sfpi1 | |
|
103 |
| fog1 | gata1 | |
|
104 |
| eklf | gata1 & ! fli1 | |
|
105 |
| fli1 | gata1 & ! eklf | |
|
106 |
| scl | gata1 & ! sfpi1 | |
|
107 |
|
Nov 29, 2015
Generate readme
|
|
|
146 |
- `simulate_model` - Simulate a Boolean model asynchronously using an initial state, and return its state space. |
|
147 |
- `calc_mscore` - Calculate a distance score for a Boolean model with respect to an expression data. |
|
148 |
- `model_dist` - Calculate the number of genes in the update functions that differ between two Boolean models. |
|
149 |
- `model_setdiff` - Show the genes in the update functions that differ between two Boolean models. |
|
150 |
|
|
151 |
Example workflows |
|
152 |
================= |
|
153 |
|
|
154 |
Three example workflows will be discussed in this vignette: (1) Inferring model without an initial model, (2) Inferring model with an initial model, (3) Extending model with more genes. The two workflows are largely similar, which only differ in the data preparation step. |
|
155 |
|
|
156 |
Inferring model without an initial model |
|
157 |
---------------------------------------- |
|
158 |
|
|
159 |
This workflow is intended for use on inferring a Boolean model without an initial model. |
|
160 |
|
Nov 29, 2015
Generate readme
|
|
|
256 |
|
|
257 |
Inferring model with an initial model |
|
258 |
------------------------------------- |
|
259 |
|
|
260 |
This workflow is intended for use on inferring a Boolean model with an initial model. |
|
261 |
|
|
262 |
When an initial model is used, note that only genes that are both present in the initial model and expression data will be used for reconstructing gene interactions. Any genes in the initial model that do not have corresponding expression values in the data will keep their original gene interactions as specified in the initial model without any modifications. |
|
263 |
|
|
264 |
### Full workflow |
|
265 |
|
|
266 |
Full workflow is included here for easy referencing. Each step is discussed in further details below. |
|
267 |
|
|
268 |
``` r |
|
269 |
set.seed(0) #use to ensure reproducibility. remove in actual use. |
|
270 |
|
|
271 |
# (1) Setup paths and environment. |
Nov 29, 2015
Generate readme
|
|
|
273 |
|
|
274 |
# If intending to use parallel processing, uncomment the following lines. |
|
275 |
# library(doParallel) num_core = 4 #specify the number of cores to be used. |
|
276 |
# doParallel::registerDoParallel(cores=num_core) |
|
277 |
|
|
278 |
# (2) Load data. |
|
279 |
data(krum_bmodel) #load a data frame of Boolean model. |
|
280 |
data(krum_istate) #load a data frame of initial state. |
|
281 |
data(wilson_raw_data) #load a data frame of expression data. |
|
282 |
|
|
283 |
bmodel = initialise_model(krum_bmodel) |
|
284 |
istate = krum_istate |
Nov 29, 2015
Generate readme
|
|
|
361 |
|
|
362 |
Extending model with more genes |
|
363 |
------------------------------- |
|
364 |
|
|
365 |
This workflow is intended for use on extending an initial Boolean model with additional genes. |
|
366 |
|
|
367 |
When an initial model is used, note that only genes that are both present in the initial model and expression data will be used for reconstructing gene interactions. Any genes in the initial model that do not have corresponding expression values in the data will keep their original gene interactions as specified in the initial model without any modifications. |
|
368 |
|
|
369 |
### Full workflow |
|
370 |
|
|
371 |
Full workflow is included here for easy referencing. Each step is discussed in further details below. |
|
372 |
|
|
373 |
*Note that this example takes a few minutes to run on a single core. The use of parallel processing is recommended.* |
|
374 |
|
|
375 |
``` r |
|
376 |
set.seed(0) #use to ensure reproducibility. remove in actual use. |
|
377 |
|
|
378 |
# (1) Setup paths and environment. |
Nov 29, 2015
Generate readme
|
|
|
380 |
|
|
381 |
# If intending to use parallel processing, uncomment the following lines. |
|
382 |
# library(doParallel) num_core = 4 #specify the number of cores to be used. |
|
383 |
# doParallel::registerDoParallel(cores=num_core) |
|
384 |
|
|
385 |
# (2) Load data. |
|
386 |
data(krum_bmodel) #load a data frame of Boolean model. |
|
387 |
data(krum_istate) #load a data frame of initial state. |
|
388 |
data(wilson_raw_data) #load a data frame of expression data. |
|
389 |
|
|
390 |
bmodel = initialise_model(krum_bmodel) |
|
391 |
istate = krum_istate |
Nov 29, 2015
Generate readme
|
|
|
483 |
colnames(tmp_istate) = add_gene |
|
484 |
grown_istate = cbind(istate, tmp_istate) |
|
485 |
grown_istate = initialise_data(grown_istate) |
|
486 |
``` |
|
487 |
|
|
488 |
### Run model training |
|
489 |
|
|
490 |
To reconstruct a Boolean model from an expression data, run `model_train`. |
|
491 |
|
|
492 |
In this example, `model_train` takes a few minutes to be completed on a single core. If this steps take a very long time to complete, do consider using the parallel processing option as described above. |
|
493 |
|
|
494 |
You will receive a BoolModel object at the end of the model training process. The BoolModel object can be visualise using `plotBM`, which is based on `igraph` package. For easier manipulation, output the Boolean model using `outgraph_model` and display it with Cytoscape or Gephi. |
|
495 |
|
|
496 |
*Note that this example takes a long time to run. The use of parallel processing is recommended.* |
|
497 |
|
|
498 |
``` r |