nuskell.dsdcompiler.compiler

exception nuskell.dsdcompiler.compiler.InvalidSchemeError(ts_file)[source]
exception nuskell.dsdcompiler.compiler.NuskellInterpreterError[source]
nuskell.dsdcompiler.compiler.interpret(ts_parsed, crn_parsed, formals, modular=False, one=100)[source]

Translation of a CRN into a DSD system.

Initializes the compiler environment, interprets the instructions of the translation scheme and then translates the CRN.

Parameters:
  • ts_parsed (List[List[...]]) – Low-level instructions from the translation scheme, as returned from the nuskell.parser module.

  • crn_parsed (List[List[...]]) – List of list data structure for CRNs as returned from the nuskell.parser module.

  • (Dict[name (formals) – trip]) : A dictionary of formal species names and their concentrations. Trip = (mode, value, unit)

Returns:

Complexes and their concentrations. If you have a modular

representation, then the following dictionaries contain all the modules.

Return type:

[dict,…]

nuskell.dsdcompiler.compiler.translate(input_crn, ts_file, modular=False)[source]

CRN-to-DSD translation wrapper function.

A formal chemical reaction network (CRN) is translated into a domain-level strand displacement (DSD) system. The translation-scheme and the CRN are parsed into low-level instructions, passed on to the interpreter and returned in form of a list of complexes.

Parameters:
  • input_crn (str) – An input string representation of the formal CRN.

  • ts_file (str) – The input file name of a translation scheme.

  • modular (bool, optional) – Split CRN into modules.

Returns:

A list of TestTube objects. The first object contains signal and fuel species of the full DSD system, followed by the modular system specifications.

Return type:

[TestTube(),…]

nuskell.dsdcompiler.compiler.ts_code_snippet()[source]

Builtin funtions for the nuskell language.

Those functions are always automatically loaded upon initialization of the interpreter environment.