src.species package

Submodules

src.species.species module

class src.species.species.Species(nodes, colorset, colormap, strandgraph)[source]

Bases: object

Species (DNA Complexes) consists of one or more strands

canonicalform = ''

canonical form

static check_pendingbond(b, pending)[source]

check if b is in pending bonds

Parameters
  • b – domain

  • pending – pending bonds

Returns

the bond number if b is in pending bond, -1 otherwise

colormap = {}

map colors to nodes

colorset = {}

set of colors

construct_strands()[source]

reverse construction of strands: canonical form -> strands

derive_canonical_form(strandgraph)[source]

derive a canonical form for the species

Parameters

strandgraph – a StrandGraph object

static derive_rootmap(nodes)[source]
generate_output()[source]

supporting function for txt output

Returns

string of canonical form

get_starting_vertex(strandgraph)[source]

find the starting vertex to do derive canonical function

Parameters

strandgraph – a StrandGraph object

Returns

starting vertex id(strand id)

id = -1

species id

nodes = []

strand ids in the species

parsingseq = []

parsing sequence for deriving canonical form

prune(nodes, strandgraph)[source]

Pruning algorithm for selecting starting vertex :param nodes: candidate nodes :param strandgraph: :return:

prune_starting_vertices(rootv, prevnodes, nodes, bondgraph, notvisited)[source]

deprecated prune starting vertices (strands) when there are more than one instances of one strand type

Parameters
  • rootv – rootmap for nodes (map current nodes to their root nodes)

  • prevnodes – previous layer of nodes

  • nodes – current layer of nodes

  • bondgraph – a BondGraph object

  • notvisited – list of not visited nodes

Returns

starting vertex

static refresh_for_pruning(v, d, n2, c2, d2)[source]

deprecated :param v: :param d: :param n2: :param c2: :param d2: :return:

set_id(id)[source]
strands = []

strands

traverse(strandgraph, curv, q, bondnum, pendingbond, canonical, visited)[source]

traverse the strand and produce a canonical form

Parameters
  • strandgraph – a StrandGraph object

  • curv – current vertex in strandgraph

  • q – queue for determining if all nodes in species has been encountered

  • bondnum – number of bonds

  • pendingbond – list of bonds (in domain level) that are pending to add

  • canonical – canonical form

  • visited – boolean list for visiting vertices in species

Returns

canonical form for one strand

src.species.species_explore module

src.species.species_explore.bi(speciescomb, specieslist, speciesidmap, reactionlist, kinetics)[source]

bi-molecule reaction

Parameters
  • reactionlist

  • speciescomb – combinations of species ids

  • specieslist

  • speciesidmap

Returns

specieslist, speciesidmap

src.species.species_explore.check_existence(species, specieslist, speciesidmap)[source]

check if the produced species is new in the DSD system

Parameters
  • species – produced species

  • specieslist – list of species in the system

  • speciesidmap – bi-directional map of species id and species canonical form

Returns

specieslist, speciesidmap

src.species.species_explore.check_hidden_prevbond(E, strandgraph)[source]
src.species.species_explore.generate_colorinfo(color)[source]

generate color information based on strand graph’s color

Parameters

color – strand graph’s color

Returns

colorset: a set of color colormap: a map of color to id of the strand

src.species.species_explore.generate_multiple_species(strandgraph, specieslist, speciesidmap, reaction)[source]

generate multiple species (applies when unbinding and migrating)

Parameters
  • reaction

  • strandgraph

  • specieslist

  • speciesidmap

Returns

src.species.species_explore.generate_species(strandgraph, specieslist, speciesidmap, reaction)[source]

generate a species

Parameters
  • reaction

  • strandgraph

  • specieslist

  • speciesidmap

Returns

specieslist, speciesidmap

src.species.species_explore.mono(species, specieslist, speciesidmap, reactionlist, kinetics)[source]

mono-molecule reaction

Parameters
  • reactionlist

  • species

  • specieslist

  • speciesidmap

Returns

specieslist, speciesidmap

Module contents