Commit Graph

194 Commits

Author SHA1 Message Date
gedeck
e9af48ffd7 Issue1071/yapf (#1078)
* Issue #1071: add yapf configuration file

* yapf formatting of Code directory

* yapf formatting of Contrib directory

* yapf formatting of Data directory

* yapf formatting of Docs directory

* yapf formatting of External directory

* yapf formatting of Projects directory

* yapf formatting of Regress directory

* yapf formatting of Scripts directory

* yapf formatting of Web directory

* yapf formatting of rdkit directory
2016-09-23 04:58:46 +02:00
Greg Landrum
91eb4fd6bd Get this building with RDK_THREADSAFE_SSS OFF
@NadineSchneider actually found this, but she delegated committing the fix to me. ;-)
2016-06-22 16:50:22 +02:00
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
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
ecf03f79b5 Removes debugging code and unneeded enum checking 2016-04-20 08:04:06 -04:00
Brian Kelley
73d5f394b9 Fixes regression in python api CalcNumRotatableBonds 2016-04-19 21:52:08 -04:00
Brian Kelley
47b4e17604 Fixes NumRotatableBonds in c++ tests 2016-03-21 22:55:24 -04:00
Brian Kelley
ab6f4d863b Fixes one last gcc enum issue. Stupid clang. 2016-03-21 22:28:57 -04: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
5a0015c9f7 Fixes gcc namespace/enum issue 2016-03-21 21:00:16 -04:00
Brian Kelley
e647af599d Updates NumRotatableBondsOptions to be an enum 2016-03-21 20:37:52 -04:00
Brian Kelley
fe82568a5e Updates C++ tests for NumRotatableBondsOptions 2016-03-17 10:14:00 -04:00
Brian Kelley
49a3befec8 Wraps python NumRotatableBondsOptions to python (with tests) 2016-03-17 10:13:33 -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
b9ba12f8f9 Remove extra calls to python::register_exception_translator 2016-03-01 06:36:54 +01:00
Greg Landrum
dee0215886 Fixes #694 2016-02-16 15:38:02 +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
Brian Kelley
5f59333a56 Silences unused parameters 2015-10-18 14:02:29 -04: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
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
5264919ccc update version of the Chi descriptors 2015-03-26 08:42:54 -04: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
1bd352f2a1 Fixes #453 2015-03-14 10:13:28 +01:00
Brian Kelley
95a92282d1 Dictionary access is saniztized and optimized.
o rdkit gains a RDKit::common_properties namespace that contains common string value properties

 o Dict.h and below gain getPropIfPresent that attempts to retrieve a property and returns
  true/false on success or failure.  This is used to optimize access.

 o rdkit learns how to pass property keys by reference, not value.

A new namespace has been added to RDKit, common_properties
that contains the std::string values for commonly used
properties.  This helps to avoid typos in string values
but also avoids a creation of std::strings from character
values.  All accessors (has/get/clear and getPropIfPresent) now pass
the key by reference.

Additionally, getPropIfPresent removes the double lookup
of hasProp/getProp which can be a significant speedup
in the smiles and smarts parsers (10-20%)
2015-01-15 12:23:29 -05:00
Greg Landrum
b9a78bb607 Fixes #351 2014-10-14 01:20:42 +02:00
Riccardo Vianello
3358ec5925 initial set of changes introducing python3 support 2014-06-17 18:26:41 +02:00
Greg Landrum
f5cf3322fe code cleanup: removing compiler warnings 2014-05-08 06:06:07 +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
4b9c26af5b python test added for useCounts with Morgan fingerprints 2014-03-27 17:45:01 +01:00
Sereina Riniker
cc75d0d20d new option useCounts for Morgan fingerprints 2014-03-27 17:36:39 +01:00
Greg Landrum
8dc00ad6e4 passes C++ and python tests 2014-02-23 07:49:46 +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
2c7c272216 Merge pull request #202 from ptosco/master
Fixed data race condition in Code/GraphMol/MolAlign/testMolAlign.cpp
2014-01-24 22:58:39 -08:00
Greg Landrum
81de25cb43 add thread libs to a couple of tests 2014-01-25 05:58:51 +00:00
ptosco
bc88b4393d - Fixed a bug in Code/GraphMol/MolAlign/testMolAlign.cpp which caused
data races in the multithreaded test
- Removed a spurious #include in Code/ForceField/Wrap/ForceField.cpp
- Restored caching in Code/GraphMol/Descriptors/Crippen.cpp
2014-01-24 14:20:34 +01:00