cgsmiles.cgsmiles_utils module

cgsmiles.cgsmiles_utils.find_complementary_bonding_descriptor(bonding_descriptor, ellegible_descriptors=None)[source]

Given a bonding descriptor find the complementary match. In the case of ‘$’ prefixed descriptors this is just the same and ‘>’ or ‘<’ get flipped to the other symbol.

Parameters:
  • bonding_descriptor (str)

  • ellegible_descriptors (list[str]) – a list of allowed descriptors to match

Return type:

list[str]

cgsmiles.cgsmiles_utils.find_open_bonds(molecule, target_nodes=None)[source]

Collect all nodes which have an open bonding descriptor and store them as keys with a list of nodes as values.

Parameters:
Return type:

dict

cgsmiles.cgsmiles_utils.read_fragment_cgsmiles(cgsmiles_str, fragname, bonding_descrpt={}, attributes={})[source]

Read a smiles_str corresponding to a CGSmiles fragment and annotate bonding descriptors, isomers, as well as any other attributes.

Parameters:
  • smiles_str (str) – string in CGSmiles format

  • fragname (str) – the name of the fragment

  • attributes (dict)

Returns:

the graph of the molecular fragment

Return type:

networkx.Graph