Commit Graph

76 Commits

Author SHA1 Message Date
Greg Landrum
9f103a9913 Allow components of the MolStandardize code to be initialized from streams (#2385)
* Fixes #2383 (tests coming in the next commit)
Minor typo fix
Fixes a "bug" in one of the default transforms

* Adds support for directly providing normalization parameter data
instead of requiring the use of a text file.

* allow fragment removers to be initialized with string data

* remove unicode

* allow the reionizer to be initialized from a stream
2019-04-03 04:48:05 +02:00
Dan N
10c3488441 #2329 wrap detect atom stereochemistry (#2351)
* Move DetectAtomStereoChemistry to Molops::assignChiralTypesFromBondDirs

DetectAtomStereoChemistry in MolFileStereochem is more broadly
useful. Additionally, it was not named very clearly for what
it was actually doing.

* Wraps assignChiralTypesFromBondDirs for use in Python

Makes assignChiralTypesFromBondDirs available in Python
and adds a test demonstrating that availability.
2019-03-19 10:54:28 +01:00
Brian Kelley
373a89021e Change boost int types to std types (#2233) 2019-01-22 17:45:03 +01:00
Greg Landrum
069e920645 Fixes #2224 (#2234)
* Fixes #2224

* test the basics
2019-01-21 11:31:02 -05:00
Greg Landrum
17323d11bf Modify removeHs so that it does not remove degree 0 atoms (#2089)
* Modify removeHs so that it does not remove degree 0 atoms
Update the docs at the same time.

* include a warning when not removing some Hs

* clear up a problem with the warning log
2018-10-05 13:43:09 -04:00
Greg Landrum
b917fd4159 Fixes #1850 (#2087)
* Fixes #1850

* docstring update in response to review

* return immediately if the conformer isn't 3D
also header update
2018-10-04 08:29:50 -04:00
Greg Landrum
2738c35178 Fixes #1903 (#1971)
* Fixes #1903

* update SWIG bindings too
2018-07-25 09:14:17 +02:00
Greg Landrum
879a40d9ee Fixes #1943 (#1954) 2018-07-16 10:27:08 -04:00
Greg Landrum
4a73e66829 Fixes #1924 (#1953) 2018-07-16 10:24:42 -04:00
Paolo Tosco
c08ea49bda - enable building DLLs on Windows (#1861)
* - enable building DLLs on Windows

* - export.h and test.h are now auto-generated by CMake
2018-05-16 08:42:41 +02:00
Greg Landrum
e8c46ca2a9 Fix/github1810 (#1811)
* Fixes #1810
There's still a problem with stereo atoms (see the commented out test),
but this takes care of the basics and that's up next.

* clean up that last problematic bit.
Still needs all tests to run

* this seems to be a necessary workaround for problems with VS2017.
It's a bit ugly, but shouldn't have any performance impact, so I'm not
going to get too worked up.

* This set of changes alters what we get for some of the InChI test cases.
Adjust for that.
2018-04-11 04:48:16 +02:00
Greg Landrum
3637cd4d75 Fixes Issue 1614 (#1781)
* This makes assignStereochemistry cleanIt=True not remove CIS/TRANS
bond stereo chemistry that was manually added as described in issue #1614.

Incorrect CIS/TRANS stereochemistry will still be removed by
'cleanIt=true' if symmetry is detected. However, this symmetry
detection doesn't work in more complex pseudo-stereo chemistry cases:
bond stereo that depends on other bond stereo to break symmetry; and
bond stereo that depends on other atom stereo centers to break
symmetry. Test cases for these cases have been added ifdef'd in based
on USE_NEW_STEREOCHEMISTRY.

However, getting USE_NEW_STEREOCHEMISTRY to work in a copacetic way is
not trivial, I tried a little bit here to no avail. I'm leaving the
test cases checked in as they should be useful when we decide to make
the plunge into using Canon::chiralRankMolAtoms for symmetry detection
instead of the CIP ranks.

So this fixes at least the glaring issue of STEREOCIS and STEREOTRANS
being incorrectly removed by 'cleanIt=true' when it is indeed valid
stereo. The checks made for symmetry are rudimentary, but don't feel
complete.

* add another test; make what's being tested explicit

* test smiles generation and function when Hs have been added

* add a test that fails

* I think that it's ok to remove this

* backup

* At this point all tests pass.
Bond wedging is now handled even if sanitization is turned off when mol files are read

* adjust to code changes

* fix a couple problems caused by rebase

* update docs
2018-04-01 17:48:36 +02:00
Maciej Wójcikowski
bfb3559e07 Improve AddHs for molecules read from PDB (#1647)
* Add AtomPDBResidueInfo during molops::addhs

* Test addhs and AtomPDBResidueInfo

* Little cleanup

* Fix serial

* Refactor code, add unique Hs labels

* Move code to separate function + bugfix.

* Make function optional (AddHs residueInfo param)

* Rename argument
2018-01-20 05:27:30 +01:00
Greg Landrum
a58f9bef8e Add an MDL aromaticity model (Fixes #1622) (#1693)
* backup

* Add a couple of more tests and an exclusion for triple bonds.

* expose the MDL aromaticity model to python and test it.

* exocyclic bonds should not “steal” electrons in the MDL model

* backup (partial) update for aromaticity model documentation

* add examples to testGithub1622 for aromatic and nonaromatic compounds

* updates to aromaticity model and docs based on additional information from @bannanc

* some additional examples from @bannanc

* add rule to allow exocyclic multiple bonds to disqualify an atom.

* minor doc update

* address some review comments
2017-12-21 08:39:49 -05:00
Greg Landrum
db89172bf8 handle the heavy-atom degree queries differently (#1560)
* handle the heavy-atom degree queries differently

* Fixes #1563

* add a test for the heavy atom degree option

* Support (and test) adjustHeavyDegree in the cartridge too.

* test results
2017-09-12 16:10:15 -04:00
Greg Landrum
64399a46f0 Fixes github1497 (#1555)
* move detectBondStereoChemistry() into MolOps

* switch more code over to using the new function

* add an addStereoChemistryFrom3D() function. Needs testing still.

* add some tests

* cleanups and rename
2017-09-11 08:37:32 -04:00
Greg Landrum
62150f7d80 Squashed commit of the following:
commit 7f7b5268a62eecd260027e0918abbdf62b100034
Merge: 90e9fd3 6dd173d
Author: Greg Landrum <greg.landrum@gmail.com>
Date:   Tue Aug 8 01:19:15 2017 +0200

    merge back to master

commit 6dd173dec6
Merge: 45a94bd e11ad49
Author: Brian Kelley <fustigator@gmail.com>
Date:   Thu Aug 3 07:54:26 2017 -0400

    Merge pull request #8 from greglandrum/dev/rgroup-decomposition

    support using generic iterators in ctor;

commit e11ad49068
Author: Greg Landrum <greg.landrum@gmail.com>
Date:   Tue Aug 1 06:29:52 2017 +0200

    move notebooks to docs

commit 606c03c28f
Author: Greg Landrum <greg.landrum@gmail.com>
Date:   Thu Jul 27 05:13:13 2017 +0200

    support using generic iterators in ctor;
    general comment: this is a useful pattern that we could use elsewhere

commit 45a94bd663
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Wed Jul 26 13:30:23 2017 -0400

    Updates notebooks

commit 8f78ba97d3
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Wed Jul 26 09:00:42 2017 -0400

    Updates notebooks

commit 44728803ae
Merge: d67409d 4d0b00d
Author: Brian Kelley <fustigator@gmail.com>
Date:   Wed Jul 26 08:53:11 2017 -0400

    Merge pull request #7 from greglandrum/dev/rgroup-decomposition

    clean up a couple leaks and some compiler warnings

commit 4d0b00dd2e
Author: Greg Landrum <greg.landrum@gmail.com>
Date:   Wed Jul 26 07:47:56 2017 +0200

    clean up a couple leaks and some compiler warnings

commit d67409da0c
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Tue Jul 25 11:43:14 2017 -0400

    Makes the scoring system more sane

commit 1b5181dc2f
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Tue Jul 25 10:55:33 2017 -0400

    Finalizes enums

commit 7e9ee61556
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Tue Jul 25 10:55:18 2017 -0400

    Fixes constructor botched in the last commit

commit aed2a201bf
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Mon Jul 24 18:22:42 2017 -0400

    Cleans up some code

commit 95e82a1398
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Mon Jul 24 18:14:31 2017 -0400

    Removes unused variable

commit 0b1ed09316
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Mon Jul 24 18:14:23 2017 -0400

    Slight optimization by combining two loops

commit ed3340a516
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Mon Jul 24 13:53:06 2017 -0400

    Fixes post increments in for loops

commit 25b1678a58
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Mon Jul 24 13:52:53 2017 -0400

    Fixes memory leak and doesn’t call SmartsToMol twice

commit 86c8c42688
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Mon Jul 24 13:52:32 2017 -0400

    Adds header guards

commit b043e38d3a
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Mon Jul 24 13:52:25 2017 -0400

    Removes unused variable

commit 631aa77153
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Tue Jul 11 08:10:39 2017 -0400

    Fixes typo in filename

commit d6e0dc753a
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Mon Jul 10 14:48:04 2017 -0400

    Fixes c++11 style enums

commit b9a31eae9a
Author: Brian Kelley <brian.kelley@novartis.com>
Date:   Mon Jul 10 14:00:04 2017 -0400

    Adds RGroupDecomposition attempt
2017-08-08 01:23:49 +02:00
Greg Landrum
270f7b76e5 Partial support for reading CXSMILES (#1237)
* add a SmilesParserParams object to prepare for this

* add a SmilesParserParams object to prepare for this

* add tests for the SmilesParseParmas

* support name parsing, should it be the default?

* rename CXNSmiles to CXSmiles;
add a spirit parser for CXSmiles coordinate that is at least syntax correct

* abandon boost::spirit for now; crude atom token parser

* support params in smiles parser (not tested, may not build)

* can read coords and atom labels along with mol names; crude, but works

* read coordinate bonds

* remove some compiler warnings with VS2015

* remove a bunch of compiler warnings on windows

* remove more warnings on windows

* remove more warnings on windows

* backup commit: first pass at parsing query features

* radical spec parsing

* handle attachment points using atom mapping

* switch to a named property for atom labels

* fix handling of the "A" atom query

* add functions to construct A and Q queries (needs more work)

* fix a problem created while cleaning up warnings earlier

* add some additional convenience functions for making generic atoms.
Still need M and to recognize these while writing CXSMILES

* add M queries; update some tests

* fix a linux compile problem

* get the cxsmiles stuff working in python; basic testing

* support "M" in CXSMILES
2017-01-31 13:50:36 -05:00
Brian Cole
9ed4250067 Find potential stereo bonds should return any (#1202)
* Wrap Chem.FindPotentialStereoBonds into Python.

* findPotentialStereoBonds now sets the Bond.GetStereo property of the double bond to Bond::STEREOANY.

Some of the doc strings indicated this as the desired behavior, but
some others also indicated otherwise. So I've cleaned up and
refactored those doc strings as well to be consistent. Pulled all the
doc string comments from the .cpp file up to the .h file and merged
all the necessary prose, including adding some about the fact rings
are ignored.

Previously, users would have to test the size of the GetStereoAtoms
vector to determine whether this function found potential double bond
stereo. Testing for Bond::STEREOANY instead is way more straight
forward.
2016-12-17 05:37:30 +01:00
Greg Landrum
1b946794f0 replaceBond and generic atoms and bonds in adjustQueryProperties() (#1141)
* first pass at RWMol::replaceBond()

* get ready for the changes

* rename some options
add bond options (not doing anything with them yet)
update tests to reflect new options

* backup

* re-enable the rest of the tests
2016-11-04 12:41:06 +01:00
Brian Kelley
659ac6cb27 Adds aromatization and reaction options to AdjustQuery (#965)
* Adds aromatization and reaction options to AdjustQuery

 aromatizeIfPossible - checks kekulized queries for
    aromatic compatibility
 adds IGNORE_MAPPED and IGNORE_ATTACHEDRGROUPS options
  to adjustDegree

* Missed return false.

* Removes IGNOREATTACHEDRGROUPS
2016-06-29 05:09:30 +02:00
Greg Landrum
d63f44cc0c Add cartridge support for adjustQueryProperties() (#949)
* backup commit

* Change the names and meanings of MolOps::AdjustQueryWhichFlags
What was there before was not flexible enough and was extremely confusing. This should clear that up.

NOTE: this does break backwards compatibility with code that uses this enum, but given that this is new and has not been
widely promoted, I suspect it should not affect that many people. The default behavior of MolOps::adjustQueryProperties()
remains the same.

* adjust to the new AdjustQueryWhichFlags

* add mol_adjust_query_properties tests to the cartridge
2016-06-21 14:38:32 -04: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
Greg Landrum
f762346ced make the perchlorate cleanup pattern more generic to cover all halogenates;
Fixes #115
2016-04-01 07:54:32 +02:00
Greg Landrum
a48774cfbe typo 2016-03-13 16:31:16 -07:00
Greg Landrum
0b18fcbe1d update docs 2016-03-13 16:13:09 -07:00
Greg Landrum
2938549c67 fix typo in comments 2016-02-12 05:02:26 +01:00
Greg Landrum
4f2aa0f51e Fixes #758 2016-02-08 16:11:22 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
4acca99689 fix typo in docs 2015-09-11 11:21:43 +02:00
Greg Landrum
8596c6f9ad add support for converting dummies to queries 2015-08-22 05:43:42 +02:00
Greg Landrum
a7383e7861 first pass at #567 2015-08-21 16:45:00 +02:00
Greg Landrum
c04e3fb885 Allow client code to skip storing the 3D distance matrix as a saved property
(NOTE: It's worth thinking about making this the default behavior)
2015-07-30 09:46:59 +02:00
Brian Kelley
020a9a8f36 Change merge_unmappped_only to more consistent mergeUnmappedOnly 2015-04-26 09:03:28 -04:00
Brian Kelley
61dd0b16a5 Add merge_unmapped_only option to MergeQueryHs
By default all atoms are merged, however when
this flag is true, any mapped atom will convert
explicit Hs to implicit.  This is due to not
wanting to convert mapped hydrogens taking
part in reactions.
2015-04-23 09:54:23 -04:00
Nadine Schneider
0b8b6a3690 Some performance fixes for the new canonicalization
- handling molecules/proteins with multiple fragments
- add criteria for using special symmetry invariant
2015-04-15 18:42:29 +02:00
Greg Landrum
a228e6126b SWIG java wrappers build and all tests pass 2015-01-03 07:01:21 +00:00
Schneider
5774337c89 MolOps: Add function to get the number of atoms with a distinct property 2014-08-19 13:01:10 +02:00
Greg Landrum
e4cfc340a4 support white and black lists for getMolFragsWithQuery 2014-03-25 08:18:30 -04:00
Greg Landrum
196c2278fb Fixes #234 2014-03-17 08:33:07 +01:00
Greg Landrum
d2504ddb0a Fixes #190 2014-03-01 06:37:33 +01:00
Greg Landrum
8503b49b75 add MolOps::get3DDistanceMat() 2013-12-01 07:57:20 +01:00
Greg Landrum
73657cd33f add to python wrapper 2013-10-27 14:42:57 +01:00
Greg Landrum
395608ffc6 add MolOps::renumberAtoms() 2013-10-27 14:19:28 +01:00
Greg Landrum
2e1bb83ea0 add in-place form of mergeQueryHs() 2013-10-04 08:56:38 +02:00
Greg Landrum
c95d57aa54 add in-place form of addHs() 2013-10-04 07:58:53 +02:00
Greg Landrum
937ee9f60a add in-place form of removeHs() 2013-10-04 07:19:01 +02:00
Greg Landrum
dccf20b8c7 Fixes #45 2013-06-08 06:01:54 +02:00
Greg Landrum
13307b38a7 minor mod to make life easier on the csharp wrapper 2012-10-28 17:00:19 +00:00
Greg Landrum
c45262a85d typo fix 2012-09-21 14:15:53 +00:00