Adds a method to MolMDP compute the parents of a given molecule.
mdp.parents(mol) returns a list of tuples (m, (blockidx, stemidx)) such that, when mdp.molecule == m calling mdp.add_block(blockidx, stemidx) yields that mdp.molecule == mol. In other words, mol is reconstructed by applying the action (blockidx, stemidx) on m.
Note that due to block attachment symmetry (there are many was to attach to a new block), some blockidxs translation is necessary. As such, mol is not exactly reconstructed in the block-space. The block indices of the BlockMoleculeData instance might differ between mol and the reconstructed molecule, but their atom-graph or RDkit Mol representation will be exactly equivalent.
Adds a method to MolMDP compute the
parents
of a given molecule.mdp.parents(mol)
returns a list of tuples(m, (blockidx, stemidx))
such that, whenmdp.molecule == m
callingmdp.add_block(blockidx, stemidx)
yields thatmdp.molecule == mol
. In other words,mol
is reconstructed by applying the action(blockidx, stemidx)
onm
.Note that due to block attachment symmetry (there are many was to attach to a new block), some
blockidxs
translation is necessary. As such,mol
is not exactly reconstructed in the block-space. The block indices of the BlockMoleculeData instance might differ betweenmol
and the reconstructed molecule, but their atom-graph or RDkit Mol representation will be exactly equivalent.