Commit Graph

29 Commits

Author SHA1 Message Date
Greg Landrum
ba12d98ad0 Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers (#1713)
* Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers

* Actually delete atoms and bonds...

* RWMol::clear now calls destroy to handle atom/bond deletion

* Changes broken Atom lookup for windows/gcc

* Adds tests for running with valgrind

* Adds test designed for valgrind and molecule deletions

* Removes RNG, actually tests bond deletions

* update swig wrappers

* deal with most recent changes on the main branch
2018-01-07 14:19:47 -05:00
Greg Landrum
915cf08faa run clang-format with c++-11 style over that 2017-04-22 17:19:10 +02:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +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
8f074d035f Fixes missing gcc update for enum class 2016-03-21 21:50:29 -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
ad0d40a33e Fixes more stupid gcc enum stuff. 2016-03-21 21:23:16 -04:00
Brian Kelley
e647af599d Updates NumRotatableBondsOptions to be an enum 2016-03-21 20:37:52 -04:00
Brian Kelley
b32ea3f1f4 Adds boolean overload to calcNumRotatableBonds 2016-03-17 10:13:08 -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
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Brian Kelley
403a3d6b7c Suppresses Boost warnings 2015-10-18 13:41:03 -04:00
Greg Landrum
6be8acdaf7 calculate numSpiro and numBridgehead in C++ 2015-09-21 13:48:33 +02:00
Greg Landrum
b9a78bb607 Fixes #351 2014-10-14 01:20:42 +02:00
Greg Landrum
f5cf3322fe code cleanup: removing compiler warnings 2014-05-08 06:06:07 +02: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
213e161b0c remove some warnings from clang.
At this point the only warnings are connected to the RNG parameterization in Fingerprints.cpp
2013-03-29 17:22:28 +00:00
Greg Landrum
a39400242d add some ring count descriptors 2013-02-15 06:21:08 +00:00
Greg Landrum
f59e7b52a3 fix a dumb typo 2012-03-12 07:07:55 +00:00
Greg Landrum
ac579f50e2 cleanup and documentation 2012-02-26 05:57:24 +00:00
Greg Landrum
a9e2447b28 another checkpoint; this seems to be working for the lipinksi and crippen descriptors 2012-02-25 05:38:09 +00:00
Greg Landrum
479bacecb3 initial pass here; note that this is really note done and that some files are temporary 2012-02-25 03:54:19 +00:00
Greg Landrum
71b058ddce add amide bond test 2011-12-04 05:29:35 +00:00
Greg Landrum
ed133927ec fix and test issue 3415534 2011-09-30 03:23:30 +00:00
Greg Landrum
498eb1ef63 back out some of the changes from rev1663.
we are no longer templating the descriptor functions and have moved the calculation
of the pattern matchers into statics inside the functions themselves.
This solves a crashing problem with the cartridge on the mac.
2011-03-16 04:39:07 +00:00
Greg Landrum
aca2fc18f8 move the lipinski defns into the header file 2011-03-15 07:51:35 +00:00
Greg Landrum
4325789d25 move lipinski descriptors to C++.
rename CalcCrippenDescriptors -> calcCrippenDescriptors
2011-03-14 10:24:42 +00:00