Re: [Rdkit-devel] symbol(s) not found on Mac OS X 10.7.3

2012-08-23 Thread Andrew Dalke
On Aug 24, 2012, at 1:24 AM, James Swetnam wrote:
 Ironically, I just ran into this same issue with our internal gcc build 
 today.  I've attached a patch that removes the platform-specific -O0 flag for 
 Dict.cpp and replaces the force_types() method with the following, which is 
 somewhat more C++ standard-compliant and portable:  

It works - w00t!

Thanks James; I have a 100% build now.

 You can read up on what's going on here (it's not pretty, nothing with c++ 
 template programming is) here:
 http://www.parashift.com/c++-faq-lite/separate-template-fn-defn-from-decl.html

 I will do it anyway even though it's confusing.
 I will do it anyway even though it's confusing.
 I will do it anyway even though it's confusing.

  :)




Andrew
da...@dalkescientific.com



--
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


Re: [Rdkit-devel] fmcs in RDKit

2012-09-24 Thread Andrew Dalke
The next quarter release is coming soon, which was good incentive for me to
work on the new MCS code for RDKit.

I checked in the actual MCS code a few weeks ago, and Greg's reviewed it at
least lightly. This evening I checked in the test cases. They are at:

http://sourceforge.net/p/rdkit/code/2197/tree/trunk/rdkit/Chem/MCS.py
http://sourceforge.net/p/rdkit/code/2197/tree/trunk/rdkit/Chem/UnitTestMCS.py

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.



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?



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.

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

Cheers,


Andrew
da...@dalkescientific.com



--
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


Re: [Rdkit-devel] Rethinking the RDKit's implicit hydrogen handling

2012-12-10 Thread Andrew Dalke
On Dec 8, 2012, at 7:01 AM, Greg Landrum wrote:
 It's a pretty small API change, but there's a huge amount of code that needs 
 to be changed in the back and lots and lots of testing that has to be done, 
 so this is going to take a while.

Speaking of hydrogens, I came across a strange query (part of the
BindingDB_structure set from my Structure Query Collection).

 C1N[H]OC[H]1

Because of RDKit's sanitization, the '[H]' gets absorbed into the atoms.
This breaks a bond, so what started as a ring with poor chemistry ends
up as two linear pieces with sane chemistry.

 mol = Chem.MolFromSmiles(C1N[H]OC[H]1)
 Chem.MolToSmiles(mol)
'CN.OC'
 

The above query is nonsensical, but I don't think sanitization should
modify the topology of the input.

Divalent hydrogen does exist in a very small number of real records.
I once came across a couple of structure with a 4-membered boron/hydrogen
ring, like this:

 mol = Chem.MolFromSmiles([B]1[H][B][H]1)
 Chem.MolToSmiles(mol)
'[BH].[BH]'
 

I am unable to find a public record with that core, to act as a
more realistic test case.



Andrew
da...@dalkescientific.com



--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Rdkit-devel mailing list
Rdkit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-devel