Reading and Writing Boolean-Based Models

Cell Collective supports reading models in SBML qual file format and exporting them into SBML qual, Boolean Expressions, Truth Tables, Interaction Matrix and GML Expressions.

ccapi also ships with some test models.

Let’s try importing the Signal Transduction in Fibroblasts model.


Begin by importing the ccapi module into your workspace.

import ccapi

Now, let’s try creating a client object in order to interact with services provided by Cell Collective.

client = ccapi.Client()

Authenticate your client using a *password flow type authentication* scheme.

NOTE: Before you can authenticate using ccapi, you must first register an application of the appropriate type on `Cell Collective <>`__. If you do not require a user context, it is read only.

client.auth(email = "", password = "test")

You can also view user details of your authenticated client as follows:

user =
ID 10887
Name Achilles Test
Memory Address 0x07f08117ef588
First Name Achilles
Last Name Test
Email Address
Institution University of Nebraska-Lincoln


The Systems Biology Markup Language is an XML-based standard format for distributing models. Reading SBML files is as easy as using the read function provided by the client object.

ccapi comes shipped with test models for testing purposes.

model = ccapi.load_model("fibroblasts", client = client)
ID 90999
Name Unnamed Model
Memory Address 0x07f08117ef128
Number of Versions 1
Versions [<BooleanModel 90999 at 0x07f08101a8898>]

Cell Collective has a native support for reading and writing in SBML qual.

boolean = model.default_version
ID 90999
Version 1
Memory Address 0x07f08101a8898
Number of Components 139
Components ExtPump, alpha_1213L, alpha_iL, alpha_sL, alpha_qL, IL1_TNF, ECM, Stress, EGF, Palpha_iR, Cbp, EGFR, PIP2_45, TAK1, Ga_1213, Ras, alpha_qR, ARF, PTPPEST, Talin, p38, Raf, Akt, PLC_g, Mekk4, PLD, p115RhoGEF, Graf, AC, TAO_12, PKC_primed, ASK1, PAK, IP3, DAG, Raf_Loc, Erk, Tiam, PIP2_34, RhoK, Cas, PTPa, Crk, MKK3, Shc, SHP2, Mekk2, cAMP, Sos, Gbg_1213, Raf_Rest, PI4K, PKC, alpha_sR, Csk, Sek1, MLK1, PDE4, PLA2, Ral, RasGRF_GRP, AND_34, PTP1b, DOCK180, NIK, Pix_Cool, B_Parvin, RKIP, WASP, MKK6, Cdc42, MKK7, PIP3_345, GRK, MLK3, Actin, Fak, Ca, B_Arrestin, Gbg_q, alpha_1213R, CaM, Arp_23, Gas, Gbg_i, Palpha_qR, RGS, p120RasGAP, Mekk1, PDK1, PA, Trafs, PKA, RalGDS, SAPK, Gab1, IP3R1, AA, PI3K, p90RSK, PLC_B, p190RhoGAP, Grb2, MLCP, RalBP1, Mekk3, PTEN, PIP_4, Myosin, Gai, Palpha_sR, ILK, Integrins, Mek, CaMKK, Vinc, Nck, IL1_TNFR, RhoGDI, MKPs, MLK2, Rac, DGK, PI5K, alpha_iR, Src, Palpha_1213R, Tab_12, Tpl2, Gaq, Rho, MLCK, PP2A, CaMK, Rap1, Raf_DeP, GCK, Trx, Gbg_s

Visualize a Boolean Model using the draw function provided.

Writing Models

Boolean-Based Models can be exported into the following formats.

  1. SBML
  2. Boolean Expressions
  3. Truth Tables
  4. Interaction Matrix
  5. GML

Exporting Boolean-Based Models can be done using ccapi using the Boolean.write function with the file type as the parameter. By default, Boolean.write exports a model into SBML qual format. A list of other formats can be found from ccapi.constant.BOOLEAN_MODEL_EXPORT_TYPE. You can also pass the path to where it should be downloaded.

from ccapi._compat import iterkeys
['sbml', 'tt', 'expr', 'matrix', 'gml']


Use the sbml type to download a BooleanModel into an SBML qual file format.

boolean.write("_data/model/boolean/%s/%s.sbml" % (, boolean.version), type = "sbml")

Boolean Expressions

Use the type expr to export a BooleanModel containing Boolean Expressions for all components.

boolean.write("_data/model/boolean/%s/" % (, boolean.version), type = "expr")

Truth Tables

Use the type tt to export a BooleanModel containing Truth Tables.

boolean.write("_data/model/boolean/%s/" % (, boolean.version), type = "tt")

Interaction Matrix

Use the type matrix to export a BooleanModel containing Interaction Matrices.

boolean.write("_data/model/boolean/%s/" % (, boolean.version), type = "matrix")


Use the type gml to export a BooleanModel containing GML.

boolean.write("_data/model/boolean/%s/" % (, boolean.version), type = "gml")