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., 2019) 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., 2019). 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., 2019) 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., 2019) 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., 2019) 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., 2019) 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., 2019). 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., 2019) 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., 2019) began during the EOBM 2017 in CUIB. For the following year we continued developing rGriffin (MartinezSanchez, Muñoz, Carrillo, Azpeitia, et al., 2019) 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., 2019) 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.
2019.
[3]
H. Wickham, J. Hester, and W. Chang.
devtools: Tools to Make Developing R Packages Easier.
R package version 2.0.2.
2019.
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.2 Patched (20190217 r76113)
## os macOS Mojave 10.14.4
## system x86_64, darwin15.6.0
## ui X11
## language (EN)
## collate en_US.UTF8
## ctype en_US.UTF8
## tz America/New_York
## date 20190410
##
## ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
## package * version date lib source
## assertthat 0.2.1 20190321 [1] CRAN (R 3.5.2)
## backports 1.1.3 20181214 [1] CRAN (R 3.5.0)
## bibtex 0.4.2 20170630 [1] CRAN (R 3.5.0)
## BiocManager 1.30.4 20181113 [1] CRAN (R 3.5.0)
## BiocStyle * 2.10.0 20181030 [1] Bioconductor
## blogdown 0.11.1 20190405 [1] Github (rstudio/[email protected])
## bookdown 0.9 20181221 [1] CRAN (R 3.5.0)
## callr 3.2.0 20190315 [1] CRAN (R 3.5.2)
## cli 1.1.0 20190319 [1] CRAN (R 3.5.2)
## colorout * 1.20 20190218 [1] Github (jalvesaq/[email protected])
## crayon 1.3.4 20170916 [1] CRAN (R 3.5.0)
## desc 1.2.0 20180501 [1] CRAN (R 3.5.0)
## devtools * 2.0.2 20190408 [1] CRAN (R 3.5.2)
## digest 0.6.18 20181010 [1] CRAN (R 3.5.0)
## evaluate 0.13 20190212 [1] CRAN (R 3.5.2)
## fs 1.2.7 20190319 [1] CRAN (R 3.5.2)
## glue 1.3.1 20190312 [1] CRAN (R 3.5.2)
## htmltools 0.3.6 20170428 [1] CRAN (R 3.5.0)
## httr 1.4.0 20181211 [1] CRAN (R 3.5.0)
## jsonlite 1.6 20181207 [1] CRAN (R 3.5.0)
## knitcitations * 1.0.8 20170704 [1] CRAN (R 3.5.0)
## knitr 1.22 20190308 [1] CRAN (R 3.5.2)
## lubridate 1.7.4 20180411 [1] CRAN (R 3.5.0)
## magrittr 1.5 20141122 [1] CRAN (R 3.5.0)
## memoise 1.1.0 20170421 [1] CRAN (R 3.5.0)
## pkgbuild 1.0.3 20190320 [1] CRAN (R 3.5.2)
## pkgload 1.0.2 20181029 [1] CRAN (R 3.5.0)
## plyr 1.8.4 20160608 [1] CRAN (R 3.5.0)
## prettyunits 1.0.2 20150713 [1] CRAN (R 3.5.0)
## processx 3.3.0 20190310 [1] CRAN (R 3.5.2)
## ps 1.3.0 20181221 [1] CRAN (R 3.5.0)
## R6 2.4.0 20190214 [1] CRAN (R 3.5.2)
## Rcpp 1.0.1 20190317 [1] CRAN (R 3.5.2)
## RefManageR 1.2.12 20190403 [1] CRAN (R 3.5.2)
## remotes 2.0.3 20190409 [1] CRAN (R 3.5.2)
## rGriffin * 0.1 20190410 [1] local
## rJava * 0.911 20190329 [1] CRAN (R 3.5.2)
## rlang 0.3.4 20190407 [1] CRAN (R 3.5.2)
## rmarkdown 1.12 20190314 [1] CRAN (R 3.5.2)
## rprojroot 1.32 20180103 [1] CRAN (R 3.5.0)
## sessioninfo 1.1.1 20181105 [1] CRAN (R 3.5.0)
## stringi 1.4.3 20190312 [1] CRAN (R 3.5.2)
## stringr 1.4.0 20190210 [1] CRAN (R 3.5.2)
## testthat 2.0.1 20181013 [1] CRAN (R 3.5.0)
## usethis * 1.5.0 20190407 [1] CRAN (R 3.5.2)
## withr 2.1.2 20180315 [1] CRAN (R 3.5.0)
## xfun 0.6 20190402 [1] CRAN (R 3.5.2)
## xml2 1.2.0 20180124 [1] CRAN (R 3.5.0)
## yaml 2.2.0 20180725 [1] CRAN (R 3.5.0)
##
## [1] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

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.