Want to share your content on Rbloggers? click here if you have a blog, or here if you don't.
This blog post was written by ME MartinezSanchez, S Muñoz, M Carrillo, E Azpeitia, D Rosenblueth and originally posted at the CDSB blog.^{1}
In this blog post we will describe the package rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018) that was one of the projects developed during the TIB2018BCDW. We hope to continue developing Griffin
and rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018). If you have ideas, suggestions or bugs, please contact us via rGriffin GitHub repo.
The problem
Boolean networks allow us to give a mechanistic explanation to how cell types emerge from regulatory networks. However, inferring the regulatory network and its functions is complex problem, as the available information is often incomplete. rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018) uses available biological information (regulatory interactions, cell types, mutants) codified as a set of restrictions and returns the Boolean Networks that satisfy that restrictions. This Boolean networks can then be used to study the biological system.
The rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018) package is an R connector to Griffin
(Gene Regulatory Interaction Formulator For Inquiring Networks), a java library for inference and analysis of Boolean Network models. Griffin
takes as inputs biologically meaningful constraints and turns them into a symbolic representation. Using a SAT engine, Griffin
explores the Boolean Network search space, finding all satisfying assignments that are compatible with the specified constraints. The rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018) package includes a number of functions to interact with the BoolNet package.
A small example
Let us suppose a cell, we know that this cell has three proteins called a, b and c. We know that a activates b and that b and c inhibit each other. We also suspect that b and c may have positive selfregulatory loops. We can add this interactions to the table as “OPU” (optional, positive, unambiguous). This dataframe is the topology of the network.
Source  Target  Interaction 

a  b  + 
b  c  – 
c  b  – 
b  b  OPU 
c  c  OPU 
Suppose we also have some information of what cell types have been observed. For example, there is a cell type that expresses b, but not a or c and an other cell type that expresses c, but not a or b. There might exist a third cell type that has not been fully characterized where we know that the cell expresses no a or c but we have NO information on b. This dataframe is the attractors of the network.
a  b  c 

0  1  0 
0  0  1 
0  *  0 
We can then use this information to create a query. rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018) can include other types of information like transition between cell type, cycles, transitions between cell types or mutant cell types.
## Install using:
# devtools::install_github('maresther23/rgriffin')
## Note that the package depends on rJava
library('rGriffin')
## Loading required package: rJava
genes = c('a','b','c')
inter = data.frame(source=c('a','b','c', 'b','c'),
target=c('b', 'c', 'b', 'b', 'c'),
type=c('+','','','OPU','OPU'),
stringsAsFactors = F )
q = create.gquery.graph(inter, genes)
attr = data.frame(a=c(0,'*',0),
b=c(0,1,0),
c=c(0,0,1),
stringsAsFactors = F )
q = add.gquery.attractors(q, attr)
Then we can use Griffin
to find the networks that behave according with our biological information.
nets = run.gquery(q)
nets
## [1] "targets,factors\na,false\nb,((((!a&b)&!c)((a&!b)&!c))((a&b)&!c))\nc,(!b&c)\n"
## [2] "targets,factors\na,false\nb,(((((!a&b)&!c)((a&!b)&!c))((a&b)&!c))((a&b)&c))\nc,(!b&c)\n"
## [3] "targets,factors\na,false\nb,((((((!a&b)&!c)((!a&b)&c))((a&!b)&!c))((a&b)&!c))((a&b)&c))\nc,(!b&c)\n"
## [4] "targets,factors\na,false\nb,((((!a&b)&!c)((a&b)&!c))((a&b)&c))\nc,(!b&c)\n"
## [5] "targets,factors\na,false\nb,((((((!a&b)&!c)((a&!b)&!c))((a&!b)&c))((a&b)&!c))((a&b)&c))\nc,(!b&c)\n"
There are multiple options to integrate BoolNet
and rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018). The function get.net.topology()
can obtain the topology with interaction signs of a BoolNet network. The function attractor2dataframe()
can be used to export a BoolNet attractor as a dataframe that rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018) can use. The function run.gquery()
includes the option return=’BoolNet’
, that return the inferred networks as BoolNet
networks.
History
The development of Griffin
began in 2013 as a PAPIIT (Programa de Apoyo a Proyectos de Investigación e Innovación Tecnológica) project to solve the inference of Boolean Network models for the Arabidopsis thaliana root stem cell niche. It continued in 2015 with support of Conacyt grant 221341.
In January, 2017 we organized a course in C3UNAM to teach biologist how to use Griffin
. We received two main comments: the input format was too complicated and it was uncomfortable to use the output with other packages. After some consideration we decided to create an R
wrapper that could export and import BoolNet
networks. We selected BoolNet
as it has an good documentation and the package BoolFilter
had been designed to work with it.
The development of rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018) began during the EOBM 2017 in CUIB. For the following year we continued developing rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018) as our schedules allowed. There were multiple challenges during the development: defining userfriendly inputs, using Rjava
, and structuring the package. In August 2018, we attended the TIB2018BCDW where we received valuable guidance from Martin Morgan and Benilton S Carvalho. It was during this workshop that the first version of rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2018) was finished.
Acknowledgements
Here you can find the tweet about the original blog post:
Check our first contributed blog post: R Gene Regulatory Interaction Formulator For Inquiring Networkshttps://t.co/9azbElGZGH
ME MartinezSanchez, S Muñoz, M Carrillo, E Azpeitia, D Rosenblueth
Thx @mt_morgan @benilton!#CDSBMexico #TIB2018 #LatAmBioc18 #rstats #TIB #blog pic.twitter.com/TbJv37fkWQ
— ComunidadBioInfo (@CDSBMexico) August 21, 2018
This blog post was made possible thanks to:
References
[1] C. Boettiger. knitcitations: Citations for ‘Knitr’ Markdown Files. R package version 1.0.8. 2017. URL: https://CRAN.Rproject.org/package=knitcitations.
[2] M. MartinezSanchez, S. Muñoz, M. Carrillo, E. Azpeitia, et al. rGriffin: Gene Regulatory Interaction Formulator For Inquiring Networks. R package version 0.1. 2018.
[3] H. Wickham, J. Hester and W. Chang. devtools: Tools to Make Developing R Packages Easier. R package version 1.13.6. 2018. URL: https://CRAN.Rproject.org/package=devtools.
[4] Y. Xie, A. P. Hill and A. Thomas. blogdown: Creating Websites with R Markdown. ISBN 9780815363729. Boca Raton, Florida: Chapman and Hall/CRC, 2017. URL: https://github.com/rstudio/blogdown.
Reproducibility
## Session info 
## setting value
## version R version 3.5.1 (20180702)
## system x86_64, darwin15.6.0
## ui X11
## language (EN)
## collate en_US.UTF8
## tz America/New_York
## date 20180913
## Packages 
## package * version date source
## backports 1.1.2 20171213 cran (@1.1.2)
## base * 3.5.1 20180709 local
## bibtex 0.4.2 20170630 CRAN (R 3.5.0)
## BiocManager 1.30.2 20180824 CRAN (R 3.5.0)
## BiocStyle * 2.9.6 20180819 Bioconductor
## blogdown 0.8 20180715 CRAN (R 3.5.0)
## bookdown 0.7 20180218 CRAN (R 3.5.0)
## colorout * 1.20 20180503 Github (jalvesaq/[email protected])
## compiler 3.5.1 20180709 local
## datasets * 3.5.1 20180709 local
## devtools * 1.13.6 20180627 CRAN (R 3.5.0)
## digest 0.6.16 20180822 CRAN (R 3.5.0)
## evaluate 0.11 20180717 CRAN (R 3.5.0)
## graphics * 3.5.1 20180709 local
## grDevices * 3.5.1 20180709 local
## htmltools 0.3.6 20170428 cran (@0.3.6)
## httr 1.3.1 20170820 CRAN (R 3.5.0)
## jsonlite 1.5 20170601 CRAN (R 3.5.0)
## knitcitations * 1.0.8 20170704 CRAN (R 3.5.0)
## knitr 1.20 20180220 cran (@1.20)
## lubridate 1.7.4 20180411 CRAN (R 3.5.0)
## magrittr 1.5 20141122 cran (@1.5)
## memoise 1.1.0 20170421 CRAN (R 3.5.0)
## methods * 3.5.1 20180709 local
## plyr 1.8.4 20160608 cran (@1.8.4)
## R6 2.2.2 20170617 CRAN (R 3.5.0)
## Rcpp 0.12.18 20180723 CRAN (R 3.5.1)
## RefManageR 1.2.0 20180425 CRAN (R 3.5.0)
## rGriffin * 0.1 20180913 Github (maresther23/[email protected])
## rJava * 0.910 20180529 CRAN (R 3.5.0)
## rmarkdown 1.10 20180611 CRAN (R 3.5.0)
## rprojroot 1.32 20180103 cran (@1.32)
## stats * 3.5.1 20180709 local
## stringi 1.2.4 20180720 CRAN (R 3.5.0)
## stringr 1.3.1 20180510 CRAN (R 3.5.0)
## tools 3.5.1 20180709 local
## utils * 3.5.1 20180709 local
## withr 2.1.2 20180315 CRAN (R 3.5.0)
## xfun 0.3 20180706 CRAN (R 3.5.0)
## xml2 1.2.0 20180124 CRAN (R 3.5.0)
## yaml 2.2.0 20180725 CRAN (R 3.5.0)

I’m reposting their blog post here with their permission so that their post will be shared more widely via RBloggers and R Weekly among other sites since the CDSB blog is currently not linked to those aggregators. The original blog post has been edited so that it evaluates the R code and includes all the information needed for reproducibility.↩
Rbloggers.com offers daily email updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/datascience job.
Want to share your content on Rbloggers? click here if you have a blog, or here if you don't.