bionetgen 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 it’s 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

class Meta[source]

Bases: object

arguments = [(['-v', '--version'], {'action': 'version', 'version': 'BioNetGen simple command line interface 0.3.0\nBioNetGen version: BioNetGen-2.6.0\nCement Framework 3.0.4\nPython 3.7.9\nPlatform Linux-5.4.0-1035-aws-x86_64-with-debian-buster-sid\n        '})]
description = 'A simple CLI to bionetgen <https://bionetgen.org>. Note that you need Perl installed.'
help = 'bionetgen'
label = 'bionetgen'
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.

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.

class Meta[source]

Bases: object

label = 'bionetgen'
bionetgen.main.main()[source]

Module contents