bionetgen.core package

Submodules

bionetgen.core.defaults module

class bionetgen.core.defaults.BNGDefaults[source]

Bases: object

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

bionetgen.core.exc module

exception bionetgen.core.exc.BioNetGenError[source]

Bases: Exception

Generic errors.

bionetgen.core.main module

class bionetgen.core.main.BNGCLI(inp_file, output, bngpath)[source]

Bases: object

Command Line Interface class to run BNG2.pl on a given model.

Usage: BNGCLI(inp_file, output, bngpath)

inp_filestr

path to the the BNGL file to run

outputstr

path to the output folder to run the model in

bngpathstr

path to BioNetGen folder where BNG2.pl lives

run()

runs the model in the given output folder

run()[source]
bionetgen.core.main.plotDAT(inp, out='.', kw={})[source]

Convenience function to plot dat/scan files from the CLI

Usage: plotDAT(inp, out, kw)

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.runCLI(config, args)[source]

Convenience function to run BNG2.pl from the CLI app

Usage: runCLI(config, args)

configdict

configuration dictionary from BioNetGen cement app

argsargparse.Namespace

arguments parsed from the command line with argparser.

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”

templatestr

the notebook template to use

odictdict

the dictionary built from keywords the class is initalized with

write(outfile)

writes the template file to outfile, replacing keywords

write(outfile)[source]

This method will overwrite the given arguments

bionetgen.core.plot module

class bionetgen.core.plot.BNGPlotter(inp, out, **kwargs)[source]

Bases: object

Class that does basic plotting for gdat/cdat files

Usage BNGPlotter(inp, out, kwargs)

inpstr

input file path, gdat/cdat/scan file

outstr

output file path

kwargsdict

keywords arguments for matplotlib. For details check bionetgen plot -h

plot()

plots the data from the input file and saves it to output file the class is initialized with

plot()[source]

bionetgen.core.result module

class bionetgen.core.result.BNGResult(path=None, direct_path=None)[source]

Bases: object

Class that loads in gdat/cdat/scan files

Usage: BNGResult(path=”/path/to/folder”) OR

BNGResult(direct_path=”/path/to/file.gdat”)

pathstr

path that points to a folder containing files to be loaded by the class

direct_pathstr

path that directly points to a file to load

load(fpath)

loads in the direct path to the file and returns numpy.recarray

find_gdat_files()[source]
load(fpath)[source]
load_results()[source]

bionetgen.core.version module

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

Module contents