Submodules module

class, output, bngpath, suppress=False, log_file=None, timeout=None)[source]

Bases: object

Command Line Interface class to run on a given model.

Usage: BNGCLI(inp_file, output, bngpath)


path to the the BNGL file to run


path to the output folder to run the model in


path to BioNetGen folder where lives


runs the model in the given output folder

run()[source] module

class, inp2, out=None, out2=None, mode='matrix')[source]

Bases: object

Class to compare two contact maps generated by

Usage: BNGGdiff(inp1, inp2).run()

BNGGdiff(inp1, inp2, out1).run() BNGGdiff(inp1, inp2, out1, out2).run() BNGGdiff(inp1, inp2, out, mode=”matrix”).run()


path to the first contact map graphml file


path to the second contact map graphml file


(optional) path to the output file for inp1 - inp2 graph


(optional) path to the second output file for inp2 - inp1 graph


diff mode, currently available modes are “matrix” and “union”

diff_graphs(g1, g2, colors={'g1': ['#dadbfd', '#e6e7fe', '#f3f3ff'], 'g2': ['#c4ed9e', '#d9f4be', '#ecf9df'], 'intersect': ['#c4ed9e', '#d9f4be', '#ecf9df']})[source]

Given two XML dictionaries (using xmltodict) of two graphml graphs, do the diff and return the difference graphml xml in dictionary format

The result is g1-g2. By default g1 only stuff are colored green g2 only nodes are colored red and common elements are colored blue. These can be changed by the colors kwarg which is a dictionary with keys g1, g2 and intersect and colors are given as hexcode strings.

Usage: diff_graphs(g1_dict, g2_dict)
diff_graphs(g1_dict, g2_dict,
colors={“g1”: “#hexstr1”,

“g2”: “#hexstr2”, “intersect”: “#hexstr3”})


input dictionary of the input XML file for the first contact map


second input dictionary of the second input XML file.

colors (opt): dict

(optional) A dictionary with keys “g1”, “g2” and “intersect”. The values are color hex strings for the colors you want for graph 1, graph 2 and the color for common elements between the two graphs.


A dictionary of graphs each of which is a dictionary for the XML file of the difference graph. Can be converted back to an XML file using xmltodict function unparse. Each key in the dictionary returned by this function is the intended file name for that graph.

run() dict[source] module

class, args=None)[source]

Bases: object

Used by the Cement app to execute the info subcommand, which involves gathering, preparing, and printing relevant version and path information.

The gatherInfo() method finds and stores all necessary information. The messageGeneration() method prepares this information in a text string. The run() method simply outputs all the information.

Requires a configuration file. An additional set of arguments are optional.


Gathers information about relevant versions and paths into a dictionary.


Takes the dictionary created by gatherInfo() and converts it to a string of text for printing.


Simply prints out the created information message. module

class, out, **kwargs)[source]

Bases: object

Class that does basic plotting for gdat/cdat files

Usage BNGPlotter(inp, out, kwargs)


input file path, gdat/cdat/scan file


output file path


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


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

plot()[source] module

class, direct_path=None)[source]

Bases: object

Class that loads in gdat/cdat/scan files

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



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


path that directly points to a file to load


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

load_results()[source] module

class, output=None, vtype=None, bngpath=None, suppress=None)[source]

Bases: object

class, name=None, vtype=None)[source]

Bases: object

Module contents