Commit Graph

82 Commits

Author SHA1 Message Date
Greg Landrum
c0687831a3 rename the python method "annotateProperties" to "AnnotateProperties" 2016-06-22 08:28:53 +02:00
Brian Kelley
552a78ed3a Dev/moldescriptors callables (#944)
* Adds a generic Property Calculation API

     Property mw(Property::MW);
     Property logp(Property::ALOGP);

     // User based function
     struct MyPropertyFunction : public PropertyFxn {
       double compute(const ROMol &mol) const {
         return rdcast<double>(mol.getNumAtoms());
       }
       bool isAdditive() const { return true; }
     }

     // Make the a num atom property
     boost::shared_ptr<PropertyFxn> atomfxn(new MyPropertyFxn);
     Property numAtoms("NumAtoms", atomfxn);

     double alogp = logp.computeProperty(mol);
     double nAtoms = numAtoms.computeProperty(mol);

And a ProperFilter API

     // Molecular weight filter 0 ... 500.
     PropertyFilter mw(PropertyFilter::MW, 0., 500.);
     
     // log p Filter -5 ... 5
     PropertyFilter logp(PropertyFilter::ALOGP, -5.0, 5.0);

     // User based function
     struct MyPropertyFunction : public PropertyFxn {
       double compute(const ROMol &mol) const {
         return rdcast<double>(mol.getNumAtoms());
       }
     }

     // add num atom property 0. ... 50.
     boost::shared_ptr<PropertyFxn> atomfxn(new MyPropertyFxn);
     PropertyFilter natoms("NumAtoms", 0., 50., atomfxn);

     if (natoms.accepts(mol)) {
      // molecule is ok
     } else {
      // molecules is bad
     }

* Adds missing includes

* Fixes g++ access to class based enums

* Updates to new API, adds better property registry

* Adds a generic Property Calculation API

     Property mw(Property::MW);
     Property logp(Property::ALOGP);

     // User based function
     struct MyPropertyFunction : public PropertyFxn {
       double compute(const ROMol &mol) const {
         return rdcast<double>(mol.getNumAtoms());
       }
       bool isAdditive() const { return true; }
     }

     // Make the a num atom property
     boost::shared_ptr<PropertyFxn> atomfxn(new MyPropertyFxn);
     Property numAtoms("NumAtoms", atomfxn);

     double alogp = logp.computeProperty(mol);
     double nAtoms = numAtoms.computeProperty(mol);

And a ProperFilter API

     // Molecular weight filter 0 ... 500.
     PropertyFilter mw(PropertyFilter::MW, 0., 500.);
     
     // log p Filter -5 ... 5
     PropertyFilter logp(PropertyFilter::ALOGP, -5.0, 5.0);

     // User based function
     struct MyPropertyFunction : public PropertyFxn {
       double compute(const ROMol &mol) const {
         return rdcast<double>(mol.getNumAtoms());
       }
     }

     // add num atom property 0. ... 50.
     boost::shared_ptr<PropertyFxn> atomfxn(new MyPropertyFxn);
     PropertyFilter natoms("NumAtoms", 0., 50., atomfxn);

     if (natoms.accepts(mol)) {
      // molecule is ok
     } else {
      // molecules is bad
     }

* Adds missing includes

* Fixes g++ access to class based enums

* Updates to new API, adds better property registry

* Fixes merge error

* Removes unused unordered_map include

* Adds calcClogP calcMR as functions.

* PropertyFxn ->PropertyFunctor, adds Queries::Query based queries.

* Adds Python PropertyFunctors (can’t be used as queries yet)

* Exposes PropertyRangeQueries

* Adds doc strings

* Throws error if stereo is not assigned.

* Adds molecule annotation.
2016-06-22 08:07:56 +02:00
Brian Kelley
73d5f394b9 Fixes regression in python api CalcNumRotatableBonds 2016-04-19 21:52:08 -04:00
Brian Kelley
ab6f4d863b Fixes one last gcc enum issue. Stupid clang. 2016-03-21 22:28:57 -04:00
Brian Kelley
c932defbdb Fixes my botching of the default ROTOR definition for the open source version (STRICT) 2016-03-21 21:43:43 -04:00
Brian Kelley
e647af599d Updates NumRotatableBondsOptions to be an enum 2016-03-21 20:37:52 -04:00
Brian Kelley
49a3befec8 Wraps python NumRotatableBondsOptions to python (with tests) 2016-03-17 10:13:33 -04:00
Brian Kelley
10f9c51056 Consolidate calcNumRotatableBonds into one function, fix tests 2016-03-13 23:49:28 -04:00
Brian Kelley
c09086437d Adds option RDK_USE_COMPLEX_ROTOR_DEFINITION
Major changes in definition relative to the original GPS calculator:
  Bonds linking ring systems:
    - Single bonds between aliphatic ring Cs are always rotatable. This    
      means that the central bond in CC1CCCC(C)C1-C1C(C)CCCC1C is now 
      considered rotatable; it was not before
    - Heteroatoms in the linked rings no longer affect whether or not
      the linking bond is rotatable
    - the linking bond in systems like Cc1cccc(C)c1-c1c(C)cccc1 is now
       considered non-rotatable
2016-03-13 16:34:24 -04:00
Greg Landrum
b9ba12f8f9 Remove extra calls to python::register_exception_translator 2016-03-01 06:36:54 +01:00
Greg Landrum
f595f891f6 rename rdk_unique_ptr to rdk_auto_ptr
add C++11 compatibility
2016-02-13 14:58:35 +01:00
Greg Landrum
f285cfd52e get rdMolDescriptors building 2016-02-13 08:08:10 +01:00
Greg Landrum
79e1f8b1fa compiles without numpy warnings, all tests pass on ubuntu 15.04 with numpy 1.10 2015-11-28 06:49:34 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Brian Kelley
ef45bf51e4 Silences more boost/numpy warnings 2015-10-18 16:39:04 -04:00
Greg Landrum
46fbc78027 doc update 2015-09-21 16:40:23 +02:00
Greg Landrum
6be8acdaf7 calculate numSpiro and numBridgehead in C++ 2015-09-21 13:48:33 +02:00
Greg Landrum
1bd352f2a1 Fixes #453 2015-03-14 10:13:28 +01:00
Greg Landrum
b9a78bb607 Fixes #351 2014-10-14 01:20:42 +02:00
Greg Landrum
40d19aad14 Fixes #251 2014-04-21 06:28:39 +02:00
Sereina Riniker
a0aece7204 option useCounts for Morgan fingerprints updated 2014-03-28 08:58:21 +01:00
Sereina Riniker
cc75d0d20d new option useCounts for Morgan fingerprints 2014-03-27 17:36:39 +01:00
Greg Landrum
708662852a backup commit 2014-02-12 11:32:09 +01:00
Toby Wright
40d4295a38 Added a stricter definition of rotatable bonds as a new function in the CPP, Python, Java and DB cartridges 2014-01-29 11:43:33 +00:00
Greg Landrum
52098ca91b remove USR and USRCAT implementation 2013-10-06 07:12:24 +02:00
Sereina Riniker
c89c624774 USR and USRCAT updated 2013-08-28 09:18:54 +02:00
Sereina Riniker
f7d03bfa01 implementation of USRCAT descriptor added 2013-08-22 14:56:00 +02:00
Sereina Riniker
c7160688c4 c++ implementation of USR descriptor updated 2013-08-21 17:57:15 +02:00
Sereina Riniker
cfeab84e14 c++ implementation of USR descriptor added 2013-08-21 16:06:40 +02:00
Greg Landrum
32d2fc0494 Fixes #43 2013-06-03 21:04:49 +02:00
Greg Landrum
1bda01294c support getting atom contributions to hkAlpha; support chiral flags for torsions and atom pair fingerprints 2013-04-07 23:40:17 +00:00
Greg Landrum
43de26bc12 basic test for the MQN descriptors 2013-02-23 17:17:56 +00:00
Greg Landrum
a39400242d add some ring count descriptors 2013-02-15 06:21:08 +00:00
Greg Landrum
f482bf63b3 add MACCS fingerprints to python wrapper 2013-02-09 16:12:04 +00:00
Greg Landrum
d24cb67f54 remove usage of list.is_none(), which is not supported in older boost versions 2013-01-17 10:26:44 +00:00
Greg Landrum
225cc285fa add support for getting crippen atom type information more easily 2013-01-16 12:51:56 +00:00
Greg Landrum
e011d14fb1 add the kappa descriptors 2012-10-28 17:00:29 +00:00
Greg Landrum
b3268d197f versions for the new connectivity descriptors; replace the python version of chi descriptors with the C++ version 2012-10-27 16:10:17 +00:00
Greg Landrum
fdccec7216 initial pass at c++ implementation of some connectivity descriptors 2012-10-27 15:24:35 +00:00
Greg Landrum
f228fc6fb3 further improvements to isotopes in molecular formulas 2012-08-21 13:33:12 +00:00
Greg Landrum
0a14825c5b fix a typo 2012-07-27 06:36:01 +00:00
Greg Landrum
11c42cf1b2 fix an oversight: add getHashedMorganFingerprint 2012-07-02 07:03:55 +00:00
Greg Landrum
f3d06ac331 refactor a bit to make this more logical 2012-03-26 03:08:02 +00:00
Greg Landrum
2bb34056dd first pass at adding support for atom invariants in the rdkit, atom-pairs, and topological torsions fingerprints 2012-03-25 12:58:42 +00:00
Greg Landrum
c0f07b6f10 change the semantics of the count-simulation in atom pair and topological torsion fps 2011-12-18 14:19:15 +00:00
Greg Landrum
6b78d8484a add an amide bond count calculator; add molecular formula calculator; add alternate method for converting torsion and atom-pair fps to bit vects 2011-12-16 04:17:28 +00:00
Greg Landrum
60c03f3725 fix and test sf.net issue 3441641 2011-11-24 03:37:22 +00:00
Greg Landrum
dac565e485 add the ability to ignore atoms in the TT and AP fingerprints 2011-06-15 03:20:10 +00:00
Greg Landrum
37c342046a add isotopic mass information; add molecular formula calculation; add isotopic mass calculator; expose additional descriptors to java 2011-04-18 10:11:09 +00:00
Greg Landrum
6fa65fbc68 move the _VSA descriptors into C++ 2011-03-21 05:02:12 +00:00