stko.topology_functions.UnreactedTopologyGraph

class stko.topology_functions.UnreactedTopologyGraph(topology_graph)[source]

Bases: object

A class containing topology graphs and performing subset of reactions.

Use this to get partially reacted topology graphs.

import stk
import stko

bb1 = stk.BuildingBlock(
    smiles="NCCN", functional_groups=(stk.PrimaryAminoFactory(),)
)
bb2 = stk.BuildingBlock(
    smiles="O=CC(C=O)C=O", functional_groups=(stk.AldehydeFactory(),)
)
cage_graphs = stko.topology_functions.UnreactedTopologyGraph(
    stk.cage.TwoPlusThree((bb1, bb2))
)
# Get a pool of NamedIntermediates with only 1 reaction, which will
# contain the reacted + the building blocks (there are 2). You can
# iterate through that pool to get the named intermediate, containing
# an stk molecule and other information about the intermediate.
pool = cage_graphs.get_named_intermediates(n=1)

Methods

get_available_reactions

Get all the reaction classes possible.

get_named_intermediates

Yield constructed molecules with up to n reactions performed.

get_present_building_blocks

Get the building blocks present in a constructed molecule.

get_reacted_smiles

Yield constructed molecules with n reactions performed.

get_reaction_results

Get all the reaction results.

yield_constructed_molecules

Yield constructed molecules for possible reaction combos.

Parameters:

topology_graph (TopologyGraph)

get_available_reactions()[source]

Get all the reaction classes possible.

Return type:

Sequence[Reaction]

get_named_intermediates(n=None)[source]

Yield constructed molecules with up to n reactions performed.

Parameters:

n (int | None)

Return type:

IntermediatePool

get_present_building_blocks(const_mol, subset_ids)[source]

Get the building blocks present in a constructed molecule.

Parameters:
  • const_mol (ConstructedMolecule)

  • subset_ids (list[int])

Return type:

dict[BuildingBlock, list[int]]

get_reacted_smiles(n=None)[source]

Yield constructed molecules with n reactions performed.

Parameters:

n (int | None)

Return type:

set[str]

get_reaction_results()[source]

Get all the reaction results.

Return type:

Sequence[ReactionResult]

yield_constructed_molecules(n=None)[source]

Yield constructed molecules for possible reaction combos.

If n is None, this produces all reactions, which could be a combinatorial nightmare.

Parameters:

n (int | None)

Return type:

Iterator[ConstructedMolecule]