bionetgen.core package

Subpackages

Submodules

bionetgen.core.defaults module

class bionetgen.core.defaults.BNGDefaults[source]

Bases: object

A class to define the default configuration for cement apps

Attributes

systemstr

the name of the OS that’s running the app

bng_namestr

OS appropriate name of the BNG folder

bng_pathstr

full absolute path to the BNG folder

lib_pathstr

path to CLI library

stdoutstr

the name of the subprocess attribute to pass stdout to

stderrstr

the name of the subprocess attribute to pass stderr to

configdict

dictionary containing the application defaults

bannerstr

app banner that gets printed when ran with -v

bionetgen.core.defaults.get_latest_bng_version()[source]

Pulls the currently used BNG version from assets/BNGVERSION file

bionetgen.core.exc module

exception bionetgen.core.exc.BNGCompileError(model, message='There was an issue compiling your BNG model, please make sure your bionetgen.conf file points to a compiled CVODE 2.6.0')[source]

Bases: BNGError

Error related to compiling C/Py file of BNG model.

exception bionetgen.core.exc.BNGError[source]

Bases: Exception

Base class for all PyBNG exceptions.

exception bionetgen.core.exc.BNGFileError(bngl_path, message='There was an issue with your BNGL file')[source]

Bases: BNGError

Error related to the BNGL file.

exception bionetgen.core.exc.BNGModelError(model, message='There was an issue with your BNG model')[source]

Bases: BNGError

Error related to the BNG model object.

exception bionetgen.core.exc.BNGParseError(bngl_path=None, message='There was an issue with parsing your BNGL file')[source]

Bases: BNGError

Error related to parsing a BNGL file.

exception bionetgen.core.exc.BNGPerlError[source]

Bases: BNGError

Error related to BNG2.pl/existence of perl.

exception bionetgen.core.exc.BNGRunError(command, message='There was an issue with running BNG2.pl. There might be an issue with your model.', stdout=None, stderr=None)[source]

Bases: BNGError

Error related to running BNG2.pl.

exception bionetgen.core.exc.BNGVersionError(cur_version, req_version)[source]

Bases: BNGError

Error related to mismatching required PyBNG.

bionetgen.core.main module

bionetgen.core.main.generate_notebook(app)[source]

Uses BNGNotebook class to write a Jupyter notebook from a given set of command line arguments

bionetgen.core.main.graphDiff(app)[source]

Uses BNGGdiff object to calculate differences between two graphs (only works with graphml files generated by BioNetGen)

bionetgen.core.main.plotDAT(app)[source]

Convenience function to plot dat/scan files from the CLI

Usage: plotDAT(inp, out, kw)

Arguments

inpstr

input gdat/cdat/scan file to plot

outstr

(optional) output file path, can be used to define the output format as well. Default is the current folder, filename is the same as the input file and default format is PNG.

kwdict

(optional) this is a set of keyword arguments you want to pass for certain matplotlib options. Check -h for details

bionetgen.core.main.printInfo(app)[source]

Uses BNGInfo class to print BioNetGen information using arguments and config from Cement framework.

bionetgen.core.main.runAtomizeTool(app)[source]

Uses AtomizeTool class to run atomizer from a set of arguments

bionetgen.core.main.runCLI(app)[source]

Convenience function to run BNG2.pl from the CLI app

Usage: runCLI(config, args)

Arguments

configdict

configuration dictionary from BioNetGen cement app

argsargparse.Namespace

arguments parsed from the command line with argparser.

bionetgen.core.main.visualizeModel(app)[source]

Uses BNGVisualize class to visualize BNGL models using arguments and configuration from Cement framework.

bionetgen.core.notebook module

class bionetgen.core.notebook.BNGNotebook(nb_template, **kwargs)[source]

Bases: object

This is a class for writing BNG notebook from a template and given arguments.

Initalize with keywords to replace values in the template. E.g. BNGNotebook(template_file, TEST=”CHANGE”).write(outfile) will write the template file to outfile while changing every instance of “TEST” to “CHANGE”

Attributes

templatestr

the notebook template to use

odictdict

the dictionary built from keywords the class is initalized with

Methods

write(outfile)

writes the template file to outfile, replacing keywords

write(outfile)[source]

This method will overwrite the given arguments

bionetgen.core.version module

bionetgen.core.version.get_version(version=(0, 8, 1, 'alpha', 0))[source]

Module contents