Skip to content

Commit b77af27

Browse files
author
Oliver Scott
committed
include hash_func option in get_scaffold_frags
1 parent d913dcd commit b77af27

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scaffoldgraph/core/fragment.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def collect(origin_atom):
343343
return ring_attachments
344344

345345

346-
def get_scaffold_frags(frag):
346+
def get_scaffold_frags(frag, hash_func=None):
347347
"""Get fragments from a disconnected structure.
348348
349349
This function is used primarily used during molecular fragmentation.
@@ -352,6 +352,8 @@ def get_scaffold_frags(frag):
352352
----------
353353
frag : rdkit.Chem.rdchem.Mol
354354
An rdkit Mol containing disconeccted structures.
355+
hash_func : callable, optional
356+
Scaffold hash function, the default is the canonical smiles.
355357
356358
Returns
357359
-------
@@ -383,7 +385,7 @@ def get_scaffold_frags(frag):
383385
# equivalent to the behavior of SNG (I believe...)
384386
logger.debug(e)
385387
return set()
386-
frags = {Scaffold(f) for f in GetMolFrags(frag, True, False)}
388+
frags = {Scaffold(f, hash_func) for f in GetMolFrags(frag, True, False)}
387389
return frags
388390

389391

0 commit comments

Comments
 (0)