bionetgen package
Subpackages
- bionetgen.core package
- bionetgen.modelapi package
- Submodules
- bionetgen.modelapi.blocks module
- bionetgen.modelapi.bngfile module
- bionetgen.modelapi.bngparser module
- bionetgen.modelapi.model module
- bionetgen.modelapi.pattern module
- bionetgen.modelapi.runner module
- bionetgen.modelapi.structs module
- bionetgen.modelapi.utils module
- bionetgen.modelapi.xmlparsers module
- Module contents
- bionetgen.simulator package
Submodules
bionetgen.main module
- class bionetgen.main.BNGBase(*args, **kw)[source]
Bases:
cement.ext.ext_argparse.ArgparseController
Base cement controller for BioNetGen CLI
Used to set meta attributes like program name (label) as well as command line arguments. Each method is a subcommand in the command line with its own command line arguments.
- run
runs a model given by -i in folder given by -o
- notebook
generates and opens a notebook for a model given by -i, optional
- plot
plots a gdat/cdat/scan file given by -i into file supplied by -o
- info
provides version and path information about the BNG installation and dependencies
- visualize
provides various visualization options for BNG models
- class Meta[source]
Bases:
object
- arguments = [(['-v', '--version'], {'action': 'version', 'version': 'BioNetGen simple command line interface 0.6.0\nBioNetGen version: BioNetGen-2.7.0\nCement Framework 3.0.4\nPython 3.7.9\nPlatform Linux-5.11.0-1019-aws-x86_64-with-debian-buster-sid\n '}), (['-req', '--require'], {'action': <class 'bionetgen.main.requireAction'>, 'type': <class 'str'>, 'default': None})]
- description = 'A simple CLI to bionetgen <https://bionetgen.org>. Note that you need Perl installed.'
- help = 'bionetgen'
- label = 'bionetgen'
- info()[source]
Information subcommand to provide installation versions and paths.
Currently provides version information for BioNetGen, the BNG CLI, Perl, numpy, pandas, and libroadrunner. Also provides BNG2.pl and pyBNG paths.
- notebook()[source]
Notebook subcommand that boots up a Jupyter notebook using the nbopen library. It uses a BNGNotebook class defined in core/notebook.
The default template can be found under assets and in the future will likely be replaced by a standard templating tool (e.g. Jinja).
The default base template is agnostic to the model and if -i is given the template then will be adjusted to load in the model supplied.
- plot()[source]
Plotting subcommand for very basic plotting using a convenience function defined in core/main.
Currently we support gdat/cdat/scan file plotting, in a very basic manner. This command expects a space separated file where each column is a series. The first column is used for the x-axis and the rest is used as y-axis and every series is plotted.
See bionetgen plot -h for all the allowed options.
- run()[source]
This is the main run functionality of the CLI.
It uses a convenience function defined in core/main to run BNG2.pl using subprocess, given the set of arguments in the command line and the configuraions set by the defaults as well as the end-user.
- visualize()[source]
Subcommand to generate visualizations. Currently only supports visualize action from BioNetGen.
Types of visualizations and their options - Rule pattern visualization: Visualization of each rule as a bipartite graph - Rule operation visualization: Visualization of each rule showing explicit graph operations - Contact map: Visualize the contact map of the model - Regulatory graph: Visualize the regulatory graph of the model
- class bionetgen.main.BioNetGen(label=None, **kw)[source]
Bases:
cement.core.foundation.App
Cement app for BioNetGen CLI
Used to set configuration options like config default, exiting on close and setting log handler. Currently set attributes are below.
- labelstr
name of the application
- config_defaultsstr
the default set of configuration options, set in BNGDefaults object
- config_handler: str
the name of the config handler, determines the syntax of the config files
- config_file_suffix: str
the suffix to be used for config files
- config_files: list of str
additional list of config files to enable
- exit_on_closeboolean
determine if the app should exit when the key function is ran
- extensionslist of str
extensions to be used with cement framework
- log_handler: str
name of the log handler
- handlers: list of obj
list of objects derived from cement.Controller that handles the actual CLI
- class Meta[source]
Bases:
object
- config_defaults = {'bionetgen': {'bngpath': '/home/docs/checkouts/readthedocs.org/user_builds/pybionetgen/checkouts/latest/bionetgen/bng-linux', 'notebook': {'name': 'bng-notebook.ipynb', 'path': '/home/docs/checkouts/readthedocs.org/user_builds/pybionetgen/checkouts/latest/bionetgen/assets/bionetgen.ipynb', 'template': '/home/docs/checkouts/readthedocs.org/user_builds/pybionetgen/checkouts/latest/bionetgen/assets/bionetgen-temp.ipynb'}, 'stderr': 'STDOUT', 'stdout': 'PIPE'}}
- config_file_suffix = '.conf'
- config_files = ['./.bionetgen.conf']
- config_handler = 'configparser'
- exit_on_close = True
- extensions = ['yaml', 'colorlog']
- handlers = [<class 'bionetgen.main.BNGBase'>]
- label = 'bionetgen'
- log_handler = 'colorlog'
- class bionetgen.main.BioNetGenTest(label=None, **kw)[source]
Bases:
cement.core.foundation.TestApp
,bionetgen.main.BioNetGen
A sub-class of BioNetGen CLI application for testing purposes. See tests/test_bionetgen.py for examples.