Commit Graph

78 Commits

Author SHA1 Message Date
Greg Landrum
2ee798ddca Add support for the rest of the v3000 atom properties (#3007)
* Add convenience functions for generating v3K mol blocks and mol files

* first pass at parsing/writing the remaining atom properties from the CTAB spec

* handle SUBST

* write out the bond props that were being read but not written

* add an additional test

* fix a couple of problems caught in review
2020-03-14 04:58:07 +01:00
Greg Landrum
1dc9ac3fbf adds a one-liner for getting a vector of random smiles for a molecule (#3002)
* first pass at random smiles vector; c++ version

* add python wrappers for that

* Remove accidental change

* switch to using a cross-platform reproducible RNG
2020-03-12 13:10:29 -04:00
Greg Landrum
d41752d558 run clang-tidy with readability-braces-around-statements (#2899)
* run clang-tidy with readability-braces-around-statements
clang-format the results
clean up all the parts that clang-tidy-8 broke

* fix problem on windows
2020-01-25 14:19:32 +01:00
Greg Landrum
0b670d24e4 Fixes #2878 (#2880)
* cleanup and documentation

* add option to ignore CXSMILES parse failures
2020-01-20 14:38:32 +01:00
Greg Landrum
a75018fe38 Cleanups and additional tests to improve test coverage (#2852)
* disable builds of the StructChecker code by default

* operator"" _smarts() doesn't need to catch sanitization errors

* remove unused function

* turn back on some tests that shouldn't have been disabled

* Remove unused code from SMARTS parser and simplify a bit

SmilesParseOps::AddFragToMol is now used only from the SMARTS parser, so we can simplify the API

* Removes obsolete special case code for SMARTS

This was relevant when organic atoms in SMARTS queries were stored as two-part queries.

* improve SMARTS testing

make sure we can generate SMARTS from all the examples and then parse that again.

* Fixes #2814

* Fixes #2815

* some additional smarts tests to improve coverage

* test copy ctor and getPos

* remove obsolete test_list files

* include tests for the morgan invariant generators

* more cleanups and coverage improvements

* remove files that were mistakenly added
2020-01-09 16:07:55 -05:00
Eisuke Kawashima
5cd27a242f Fix typo (#2862)
* Fix typo

* Reflect the comments

* Fix more typos
2019-12-31 06:43:27 +01:00
Ric
4b4085f60e Rework MaeMolSupplier, fix #2617 (#2620)
* merge older changes

* use back() in chirality parsing

* update comments
2019-12-03 15:04:23 +01:00
Brian Kelley
80f3390b0b Fix/github2611 (#2612)
* Fix CanonicalRankAtomsInFragment API, adds includeChirality, includeIsotopes

* Add testGithub2611

* Update python doc string

* Ensure isotopes are being ignored when requested

Co-Authored-By: Greg Landrum <greg.landrum@gmail.com>

* Need to use all atoms for test
2019-08-23 14:01:55 -07:00
Dan N
e0f6119589 Adds MolFragmentToSmarts to generate smarts for a subset of a Molecule (#2594)
We have MolFragmentToSmiles already. But I think that when talking
about a fragment or part of a molecule, maybe SMARTS makes more
sense. If I see a SMILES string, I'll definitely think that
it should be a valid molecule, but I have no such
presumption about SMARTS.

Additionally, Schrodinger software sometimes generates SMARTS
for selection using a set of atoms picked in a GUI. It will
be useful to generate these SMARTS using RDKit.
2019-08-15 05:09:56 +02:00
Eisuke Kawashima
b2f755e64b Support XYZ format for output (#2498) 2019-07-12 05:26:42 +02:00
Greg Landrum
060bc7c519 Fixes #2436
A bunch of other doc formatting tweaks are in there too
2019-05-13 11:01:59 +02:00
greg landrum
92ca0da5f9 Merge branch 'doc-update' of https://github.com/greglandrum/rdkit into greglandrum-doc-update 2019-03-07 21:15:00 +01:00
Greg Landrum
2aed95bcf4 Add definition of MolFragmentToCXSmiles (#2307)
* Add definition of MolFragmentToCXSmiles

* expose MolToCXSmiles and MolFragmentToCXSmiles to python

* improve a test
2019-03-05 08:16:06 -05:00
Greg Landrum
fb5e325705 update docstrings in the wrappers too 2019-03-05 11:40:28 +01:00
Greg Landrum
180c15fe0e support reading/writing atom props from SD files (#2297)
* first crude pass

* fix a deprecation

* change naming scheme, support bools

* add standalone function

* add a default value for missings

* support long lines

* stupid typo

* make operator[] work

* revisit missing value handling

* modify missing value handling

* switch to an alternate scheme for specifying missing values

* clang-format

* First pass at property list parser
still needs more tests

* add test for processMolPropertyLists

* get this working as part of the ForwardSDMolSupplier

* first pass at python wrappers and tests

* clang-format run

* add creation of property lists at the mol level

* wrap long lines on output

* remove PoC implementation

* fix python wrappers

* remove out-of-date reference to the Python PoC

* changes in response to review
2019-03-03 13:17:13 -05:00
guillaume godin
d58197f4a2 Fix #2042 allowing python/c++ randomizer smiles generator (#2059)
* Fix #2042 allowing python/c++ randomizer smiles generator

* adding rootAtAtoms randomness

* add the minor change to bypass rules if doRandom

* Add another point of randomness (the initial choice had been missed)
Make the tests cross-platform. Hopefully
2018-10-08 11:09:42 +02:00
Greg Landrum
abcecf7456 enable SVG parsing from Python (#2045)
* add SVG parsing to python
re-enable the moldraw2d tests

* A couple of fixes connected to #2029

* handle problems parsing atom/bond SMILES

* wrap the whole thing in the <metadata> tag

* patch a memory allocation problem in the maeparser v1.0.0 (#2044)
2018-09-17 20:20:21 +02:00
Greg Landrum
bccf5da2ed Add support for constructing atoms/bonds from SMILES/SMARTS (#1998)
* not done... nossir

* this works for molecules

* works

* update the .cmake files for the smiles parser

* do the same thing for smarts

* add to the python wrappers
2018-08-12 17:08:57 -04:00
Greg Landrum
833bf6335a fix some problems caused by #1874 (#1907) 2018-06-09 06:58:48 +02:00
Greg Landrum
e8e86a5f41 allow the cleanup step of Mol2 parsing to be disabled (#1898)
* allow the cleanup step of Mol2 parsing to be disabled

* reformatting

* add the file...
2018-06-09 05:44:10 +02:00
Pat Lorton
da873a6100 Add initial Maestro format Supplier using maeparser library (#1872)
* Add initial Maestro format Supplier using maeparser library

Right now it's carrying over very limited information, more to come.  Initially:
  * 3D Coordinates
  * Bonds with order
  * Atom charges
  * Structure title

* Greg's code review suggestions

Put MaeMolSupplier behind the coordgen flag.  Added Python wrapper.  Made other small
changes.

* Fix wrapping of MaeMolSupplier.cpp

* More code review feedback response

Also fixed an issue where exception during iteration locks up iterator

Remaining items:
  * Bug where for i in MaeMolSupplier() works, but suppl = MaeMolSupplier
    segfaults on OSX
  * Add Python Unit tests

* Get build working with Coordgen flag turned off

* Fix memory bug, add Python unit tests

* Get rid of dead code in test

* Ifdef forward definitions for Maestro file reader
2018-06-02 12:24:03 +02:00
Greg Landrum
f35e04403a replace the usage of rdk_auto_ptr with std::unique_ptr (#1752)
That is what was being used for modern c++ anyway
2018-02-14 19:49:47 -05:00
Greg Landrum
d15efc1ac9 Make the defaults for some functions less error prone. (#1690)
* auto generate coords in mol block writer if includeChirality = True

* default to include chirality when writing mol blocks/files

* make isomeric smiles the default; note that not all tests are passing at the moment

* update a reaction test

* update expected cartridge search results
at this point all python, c++, and cartridge tests pass

* docs

* update incompatibility docs

* update doctests

* these now build

* minor example update

* update expected c++

* typo

* make allowCXSMILES=true the default

* add auto perception of chirality when reading 3D structures from mol blocks

* explain changes in release notes

* further doc update
2017-12-22 08:09:36 -05:00
Maciej Wójcikowski
10fbd483bb [MRG] Fix PDB reader + add argument to toggle proximity bonding (#1629)
* Add parameter to skip proximity bonding during PDB reading

* Test proximityBonding flag

* Remove multivalent Hs and bonds to metals in PDB

* Add tests for multivalent Hs and metal unbinding

* Remove covalent bonds to waters

* Test unbinding of HOHs

* Refactor funxtions

* Rename flag for cosistency

* Include flavor in double bond perception

* Add metalorganic test (APW ligand)

* Validate input foe IsBlacklistedPair and minor changes.
2017-11-15 06:53:31 +01:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +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
Greg Landrum
ae774c4f24 add support the new sequence readers to wrappers (#1181) (#1221)
* Fixes #1181
needs more testing

* improved docs and a couple tests

* add the new sequence support to the java wrappers too
2016-12-21 04:42:17 +01:00
Greg Landrum
b9ba12f8f9 Remove extra calls to python::register_exception_translator 2016-03-01 06:36:54 +01:00
Brian Kelley
cb0515acc7 Fixes MolToSmarts python docs 2016-02-26 19:26:33 -05: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
d3b338f4de fix rdmolfiles
Fixes #769
2016-02-13 08:21:04 +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
44cb713c62 documentation 2015-09-09 18:11:30 +02:00
Greg Landrum
049c0d934d add initial pass at writers 2015-09-09 10:43:59 +02:00
Greg Landrum
e3575d2e7a add sequence parsers to python interface 2015-09-09 10:34:18 +02:00
Nadine Schneider
5d963846b8 merge 2015-04-10 09:44:18 +02:00
Riccardo Vianello
7c346d7c2e Code/RDBoost/Exceptions.h moved to Code/RDGeneral 2015-03-16 22:31:48 +01:00
Greg Landrum
d2befd1c61 fix a couple tests 2015-02-03 16:48:10 +01:00
Brian Kelley
ddbef6eee1 Fix crash bug in CanonicalRankAtomsInFragment, add better documentation. 2015-01-30 08:25:16 -05:00
Brian Kelley
617e651801 CanonicalRank is now -1 if atom was not used.
n.b. only affects python API
2015-01-29 20:03:05 -05:00
Brian Kelley
12ea8a5530 Expose RankAtoms to Python
Renamed to CanonicalRankAtoms, but perhaps
better as CanonicalOrderAtoms
2015-01-29 16:08:36 -05:00
Greg Landrum
76b3efb449 Fixes #389 2014-11-20 03:45:43 +01:00
Greg Landrum
9f4471f872 more on #204
A few other cleanups
2014-02-06 06:43:28 +01:00
Greg Landrum
deed4a9acf Merge branch 'Issue194_V3000MolWriter'
Conflicts:
	Code/GraphMol/Chirality.cpp
	Code/GraphMol/FileParsers/test1.cpp
2014-01-22 07:07:27 +01:00
Greg Landrum
6dbd804121 clean up the way the unicode strings are handled and broaden suport a bit 2013-12-30 16:11:09 +01:00
Greg Landrum
e7ad13929b Fixes #179
could be more elegant, but works for MolFromSmiles and MolFromSmarts
2013-12-30 09:02:43 +01:00
Greg Landrum
2ee9f1c02a add to python wrapper 2013-12-23 06:43:12 +01:00
Greg Landrum
1501af51a5 PDB reader/writer fixes;
add MolToMolFile() to python API
2013-10-25 05:02:09 +02:00
Greg Landrum
173c53c8e4 integrate Roger's bond-perception/assignment code 2013-09-30 05:11:31 +02:00