sbol_utilities.expand_combinatorial_derivations

Module Contents

Classes

CombinatorialDerivationExpander

Class for expanding combinatorial derivations by walking their substructures

Functions

cd_assigment_to_display_id(cd: sbol3.CombinatorialDerivation, assignment: tuple) → str

Makes a unique display-id for any assignment of values

expand_derivations(targets: List[sbol3.CombinatorialDerivation]) → List[sbol3.Collection]

Given a list of CombinatorialDerivations, expand each to make all of the variants that instantiate the

is_library(cd: sbol3.CombinatorialDerivation) → bool

Check if the CombinatorialDerivation can be collapsed into a simple Collection of values

main()

Main wrapper: read from input file, invoke expand_derivations, then write to output file

root_combinatorial_derivations(doc: sbol3.Document) → Set[sbol3.CombinatorialDerivation]

Find all of the root CombinatorialDerivations in a document (i.e., those not referred to be another CD)

class CombinatorialDerivationExpander

Class for expanding combinatorial derivations by walking their substructures

cd_variable_values(self, v: sbol3.VariableFeature) List[sbol3.Component]

Flatten a variable to collect all of its values

Parameters

v – Variable to be flattened

Returns

list of Component values found

collection_values(self, c: sbol3.Collection) List[sbol3.Component]

Pull all SBOL Components out of a possibly recursive collection

Parameters

c – Collection for extraction

Returns

list of Component values found

derivation_to_collection(self, cd: sbol3.CombinatorialDerivation) sbol3.Collection

Takes a CombinatorialDerivation and list of all those previously expanded, return a Collection of all of the variants generated from the CD, which have been added to its containing document Method: recursively instantiate all variables of the document We’ll do this by a simple depth first search initially, since the numbers shouldn’t be too large

Parameters

cd – derivation to expand

Returns

collection of derivative Components

cd_assigment_to_display_id(cd: sbol3.CombinatorialDerivation, assignment: tuple) str

Makes a unique display-id for any assignment of values

Parameters
  • cd – CombinatorialDerivation being expanded

  • assignment – tuple of variables to expand

Returns

display ID for this combination

expand_derivations(targets: List[sbol3.CombinatorialDerivation]) List[sbol3.Collection]

Given a list of CombinatorialDerivations, expand each to make all of the variants that instantiate the specification for each CombinatorialDerivation. All of the expansions are stored in the document. Note: assumes exhaustive sampling strategy

Parameters

targets – list of CombinatorialDerivations to expand, all of which should be in the same SBOL document

Returns

list of SBOL Collections, one for each target (in same order as targets)

is_library(cd: sbol3.CombinatorialDerivation) bool

Check if the CombinatorialDerivation can be collapsed into a simple Collection of values

Parameters

cd – CombinatorialDerivation being checked

Returns

true if it can be reduced to a Collection

main()

Main wrapper: read from input file, invoke expand_derivations, then write to output file

Returns

None

root_combinatorial_derivations(doc: sbol3.Document) Set[sbol3.CombinatorialDerivation]

Find all of the root CombinatorialDerivations in a document (i.e., those not referred to be another CD)

Parameters

doc – Document to search

Returns

set of root CDs