PRELIMINARY-IMAGE This is a preliminary API until 2018.Feb and may be improved based on user feedback. It is currently available in C++ and Python.

OESystem::OEIterBase<const std::string>* OEMoleculeToCores(const OEChem::OEMolBase &mol,
                                                           const OEMCSFragDatabaseOptions &opts,
                                                           bool permuteFragments=true);

Given a molecule, return the fragmentation cores using the provided fragmentation options. If the permuteFragments argument is true, all unique combinations of the generated fragmentation cores are generated, otherwise a unique series of multi-fragment cores is returned representing all combinations of bond fragmentations between the min and max cut limits.

Shown below is a python version that uses the free function and custom options setup from command line arguments:

    # set the MCS fragment database options from the command-line arguments
    fragopts = OEMCSFragDatabaseOptions()
    if not OESetupMCSFragDatabaseOptions(fragopts,itf):
        OEThrow.Fatal("Error setting options")

    # use the custom options to fragment an arbitrary input molecule
    print('MoleculeToCores using command-line options:')
    sortedcores = sorted ( [ c for c in OEMoleculeToCores(mol,fragopts) ] )
    for corenum, core in enumerate(sortedcores):