On Tue, Sep 25, 2012 at 4:30 AM, Andrew Dalke <da...@dalkescientific.com> wrote:
> The next quarter release is coming soon, which was good incentive for me to
> work on the new MCS code for RDKit.

This is great news. Andrew's MCS code fills an important gap in the
current RDKit functionality.


> Here's the API and documentation.
>
>
> def FindMCS(mols, min_num_atoms=2,
>             maximize = Default.maximize,
>             atom_compare = Default.atom_compare,
>             bond_compare = Default.bond_compare,
>             match_valences = Default.match_valences,
>             ring_matches_ring_only = False,
>             complete_rings_only = False,
>             timeout=Default.timeout,
>             ):
>     """Find the maximum common substructure of a set of molecules
>
>     @type  mols: molecule iterator
>     @param mols: find the MCS of these molecules
>     @type min_num_atoms: integer
>     @param min_num_atoms: The minimum number of atoms which must be in the 
> MCS.
>               The minimim value is 2.
>     @type maximize: "atoms" or "bonds"
>     @param maximize: The default "atoms" maximizes the number of atoms in
>               the MCS. Use "bonds" to maximize the number of bonds instead.
>     @type atom_compare: "any", "elements", or "isotopes"
>     @param atom_compare: Specify the atom comparison function. The default 
> "elements"
>               says that two atoms are the same if and only if they have the 
> same
>               element number. Use "isotopes" if you are using isotope labels 
> to
>               define your own atom classs. With "any", all atoms match each 
> other.
>     @type bond_compare: "any" or "bondtypes"
>     @param bond_compare: Specify the bond comparison function. The default
>               "bondtypes" says that two bonds are the same if and only if they
>               have the same bond type. With "any", all bonds match each other.
>     @type match_valences: boolean
>     @param match_valences: If True, atoms must also have matching valences
>               to match. By default this is False.
>     @type ring_matches_ring_only: boolean
>     @param ring_matches_ring_only: If True, then both bonds must either be in
>               a ring or not in a ring in order to match. By default this is 
> False.
>     @type ring_matches_ring_only: boolean
>     @param ring_matches_ring_only: If True, then both bonds must either be in
>               a ring or not in a ring in order to match. By default this is 
> False.
>     @type complete_rings_only: boolean
>     @param complete_rings_only: If True, then if a ring bond of a molecule
>               is in the MCS then the corresponding MCS bond is also in a ring.
>     @type timeout: float
>     @param timeout: stop search after 'timeout' seconds and report the current
>               best MCS.
>
>     @rtype: MCSResult
>     @return: Information about the MCS search results. Attributes are 
> 'completed'
>         (0 if timeout reached, otherwise 1), 'num_atoms', 'num_bonds', and 
> 'smarts'.
>
>
> Is that too unreadable? I can rewrite that to be more prose than
> this sort of auto-documentation format.

Is there a python documentation generator that can process that and do
something sensible with it? If so, I'm fine with it. If not, then
maybe the @type bits can be combined into the @param somehow (yes, it
would just be text then).


> I wasn't sure of how/where to update the documentation. Greg? Do you have
> an idea of where it might go? Or perhaps want to do it yourself?

The API docs are automatically generated. It would be nice to have a
brief section for the GettingStarted document
($RDBASE/Docs/Book/GettingStartedInPython.rst), but I am willing to
write that if you don't have time.

> In other news, I'll be presenting the MCS work at the Goslar conference
> this fall, and I've got some funding to work on finding a threshold MCS,
> that is, the maximum common substructure which is in at least some percentage
> threshold of the entire system.

Congrats! That would definitely be useful.

> Can anyone suggest a good name for that? Threshold MCS? Something else?

"Threshold MCS" sounds ok to me, but I'm not great at naming things.

-greg

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rdkit-devel mailing list
Rdkit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-devel

Reply via email to