Commit Graph

71 Commits

Author SHA1 Message Date
Greg Landrum
108d84ab1e Switch from boost::thread to std::thread (#1745)
* boost::thread mostly gone... still need to get rid of once
everything compiles

* replace boost::call_once

* remove link-time dependency on boost::thread

* first pass at using async

* switch to using async everywhere
2018-02-22 03:43:07 +01:00
Greg Landrum
ab8fc30081 Fixes github #1702 (#1706)
* Fixes #1702

* more on #1702
2018-01-04 18:32:19 +01:00
Greg Landrum
1efa8e696e another clang-format run 2017-10-12 06:42:15 +02:00
Greg Landrum
e76cfdf9eb Bring back USR and USRCAT descriptors (#1417)
* backup

* cleanup svn droppings

* update URL to Adrian's repo
2017-07-02 10:26:09 +02: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
Greg Landrum
452ed7156f Add support for a simplified aromaticity model. (#942)
* first pass

* Fixes #623

* fix a merge problem

* move the aromaticity perception to a helper fn

* python doc update

* replace setSimpleAromaticity() with a parameter to setAromaticity()

* add simple test for the custom aromaticity function
2016-06-17 17:48:20 -04:00
Brian Kelley
47b4e17604 Fixes NumRotatableBonds in c++ tests 2016-03-21 22:55:24 -04:00
Brian Kelley
fe82568a5e Updates C++ tests for NumRotatableBondsOptions 2016-03-17 10:14:00 -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
dee0215886 Fixes #694 2016-02-16 15:38:02 +01: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
209aa69e2a Fixes #623 2015-09-22 05:00:57 -04:00
Greg Landrum
6be8acdaf7 calculate numSpiro and numBridgehead in C++ 2015-09-21 13:48:33 +02:00
Greg Landrum
ea7f446369 and fix ChiNn too (#463) 2015-03-26 08:41:09 -04:00
Greg Landrum
61eba20423 add another test for #463 2015-03-26 08:38:02 -04:00
Greg Landrum
9208936bbb Fixes #463 2015-03-26 07:10:02 -04:00
Greg Landrum
b9a78bb607 Fixes #351 2014-10-14 01:20:42 +02:00
Greg Landrum
8dc00ad6e4 passes C++ and python tests 2014-02-23 07:49:46 +01:00
Greg Landrum
4ace62f019 remove more clang warnings 2013-12-02 05:10:23 +01:00
Greg Landrum
1acae67cba Merge branch 'master' into PDB_29September2013 2013-10-08 05:51:57 +02:00
Greg Landrum
52098ca91b remove USR and USRCAT implementation 2013-10-06 07:12:24 +02:00
Greg Landrum
c95d57aa54 add in-place form of addHs() 2013-10-04 07:58:53 +02:00
Greg Landrum
f23e646c40 Merge pull request #93 from sriniker/master
c++ Implementation of the USR and USRCAT descriptors
2013-08-28 01:10:01 -07:00
Greg Landrum
0ea2876467 Fixes #92 2013-08-27 05:34:30 +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
e535e97d06 c++ implementation of USR descriptor added 2013-08-20 17:33:28 +02:00
Greg Landrum
6c71f9e25f Fixes #56 2013-06-22 06:01:55 -04: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
225cc285fa add support for getting crippen atom type information more easily 2013-01-16 12:51:56 +00:00
Greg Landrum
e599ceca3c typo fix 2013-01-10 03:42:23 +00:00
Greg Landrum
e011d14fb1 add the kappa descriptors 2012-10-28 17:00:29 +00:00
Greg Landrum
fdccec7216 initial pass at c++ implementation of some connectivity descriptors 2012-10-27 15:24:35 +00:00
Greg Landrum
df7d6e7315 another improvement connected to sf.net issue 252 2012-09-23 16:03:23 +00:00
Greg Landrum
ceb35a7d34 fix and test sf.net issue 252 2012-09-21 08:56:31 +00:00
Greg Landrum
f228fc6fb3 further improvements to isotopes in molecular formulas 2012-08-21 13:33:12 +00:00
Greg Landrum
3a3b582d28 clean up + add support for D and T in molecular formula 2012-07-27 06:16:45 +00:00
Greg Landrum
028d6fd08e add some more isotopic mass testing 2012-06-21 02:46:26 +00:00
Greg Landrum
e7d25d7973 tests passing except reactions 2012-04-21 04:40:55 +00:00
Greg Landrum
ac579f50e2 cleanup and documentation 2012-02-26 05:57:24 +00:00
Greg Landrum
d00ee0825d another update 2012-02-25 16:27:54 +00:00
Greg Landrum
95edea7d09 fix and test issue 3433771 2011-11-05 05:51:27 +00:00
Greg Landrum
ed133927ec fix and test issue 3415534 2011-09-30 03:23:30 +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