src.basics package

Submodules

src.basics.check_rules module

src.basics.check_rules.check_binding(graph)[source]

check rule binding

Parameters

graph – a StrandGraph object

Returns

edges to be added

src.basics.check_rules.check_existence_4way(elist, edge)[source]

prevent double check in four-way migration

Parameters
  • elist – changeedge4

  • edge – edge to be examined

Returns

src.basics.check_rules.check_migration(graph)[source]

check rule migration

Parameters

graph – a StrandGraph object

Returns

changeedge3: edges to be changed in three-way migration changeedge4: edges to be changed in four-way migration

src.basics.check_rules.check_unbinding(graph)[source]

check rule unbinding

Parameters

graph – a StrandGraph object

Returns

edges to be deleted

src.basics.generate_pysbmodel module

src.basics.generate_pysbmodel.generate_concentrations(initlen, concentrations)[source]

generate concentrations of the initial species

Parameters
  • initlen – number of the initial species

  • concentrations – concentrations of the initial species

Returns

PySB parameters for concentrations

src.basics.generate_pysbmodel.generate_model(specieslist, reactionlist, initlen, initnames, concentrations, defobs=[])[source]

generate a PySB model for the DSD reaction network

Parameters
  • specieslist – list of species that can be synthesized in the DSD system

  • reactionlist – list of reactions that can happen in the DSD system

  • initlen – number of the initial species

  • initnames – names of the initial species

  • concentrations – concentrations of the initial species

  • defobs – a debug argument for defining observables

Returns

a PySB model

src.basics.generate_pysbmodel.generate_monomer(species, monomerdict, initlen, initnames, tbobs)[source]

generate a PySB monomer based on species

Parameters
  • species – a Species object

  • monomerdict – a dictionary with all monomers linked to their species id

  • initlen – number of the initial species

  • initnames – names of the initial species

Returns

monomer, observable, and updated monomerdict

src.basics.generate_pysbmodel.generate_rule(reaction, i, monomerdict, rate)[source]

generate a PySB rule based on reaction

Parameters
  • reaction – a Reaction object

  • i – ordered position of reaction in reactionlist

  • monomerdict – a dictionary with all monomers linked to their species id

  • rate – reaction rate, a Parameter object

Returns

PySB rule

src.basics.initialize_system module

src.basics.initialize_system.get_additional_info(fp, line)[source]

get additional info from input

Parameters
  • fp – opened file

  • line – current line

Returns

names of initial species, concentrations of initial species, a dictionary object of kinetics, output directory, simulation parameters

src.basics.initialize_system.get_kinetics(fp, line)[source]

get the kinetics info from input

Parameters
  • fp – opened file

  • line – current line

Returns

a dictionary object of kinetics, output directory, simulation parameters

src.basics.initialize_system.get_outdir_simupara(fp, line)[source]

get output directory and simulation parameters (in format: time steps)

Parameters
  • fp – opened file

  • line – current line

Returns

output directory and simulation parameters

Note: output directory is ‘’ if not specified and list of simulation parameters is empty if not specified

src.basics.initialize_system.initialize(filedir)[source]

initialize the DSD system

Parameters

filedir – file directory of the input

Returns

specieslist, speciesidmap, kinetics, names, concentrations, output directory, simulation parameters

src.basics.lexical_analyzer module

src.basics.lexical_analyzer.lexer_site(string)[source]
src.basics.lexical_analyzer.lexer_strand(str, cnt)[source]

a lexer for transforming strand in any canonical form to a Strand object

Parameters
  • str – string

  • cnt – count

Returns

a Strand object

src.basics.output module

Module contents