Skip to content

VerifyModel.R

palmerito0 edited this page Apr 29, 2023 · 16 revisions

VerifyModel.R

VerifyModel.R is a script to automatically perform a simple round of validation on a set of modules with a rxncon "master" list.

Verification simulation flowchart

Running

Run VerifyModel.R by sourcing it directly (./VerifyModel.R) or with Rscript (Rscript ./VerifyModel.R).

Parameters should be set in a config file (VerifyModel.R /path/to/config.R, see below for config file format)

Parameters

  • file: Path to master rxncon file.
  • driveFile: Name or URL of master rxncon file on Google Drive (mutually exclusive with file)
  • modules: Comma-separated modules to be loaded from master rxncon file. Omit this argument or leave it blank to load all modules.
  • minQuality: Minimum quality for a rxncon rule to be loaded, default: 0. Rules without a quality tag are always loaded
  • out: Folder to which output files will be written, default: ./
  • rounds: Maximum number of rounds of simulation VerifyModel.R will perform before stopping (default = 20)
  • runs: Named list, where each entry represents a specific set of conditions under which the model will be simulated. Each entry in the list is itself a list with the following entries:
    • toggle: State(s) to be toggled on and off in the simulation, usually the unbound ligand
    • on and off: State(s) and/or reaction(s) to set permanently on or off, respectively.
    • initial: Initial state of the system in the csv format used by rxncon/BoolNet. If not provided, the neutral state generated by rxncon is used.

Config file

Config files should be .R files following this general format:

config <- list(
	arg1 = "string value",
	arg2 = FALSE,
	arg3 = 23
	...
)

An example of such a config:

config <- list(
    file = "model_file.xlsx",
    out = "./VerifyModel_out",
    runs = list(
      default = list(
        toggle = "Ligand"
      ),
      inhibited = list(
        toggle = "Ligand",
        off = "Ligand_i+_Receptor"
    )
)

See examples/.../VerifyModelConfig.R for examples.

Output

VerifyModel.R will output the following files:

  • Temporary modules* files: These files are generated by rxncon and can be used for manual simulation of the system using BoolNetSim.R
  • global_state_space.graphml: Graph of the full state space of the system traversed through all the runs. Can be visualized using Cytoscape loaded with the styles/stateGraph.xml style.
  • results.RData: RData file with the full simulation results. Organized into a nested list, with the top level representing separate runs, the next level representing round within a run, and the final level containing data frames labeled with whether they are with or without ligand.
  • For each run, the following files are also outputted:
    • run_<run name>.csv: Trajectory of the entire run is csv format. Rows represent states/reactions, columns represent timepoint within the simulation. Columns are labeled by whether or not they contain the ligand, as well as whether they represent a path or a attractor state.
    • run_<run name>.pdf: Same as the above in graphical form.
    • run_<run name>_state_space.graphml Graph of the state space traversed by the run. Can be visualized using Cytoscape loaded with the styles/stateGraph.xml style.