Commit Graph

88 Commits

Author SHA1 Message Date
Greg Landrum
5a79190261 rename SGroup -> SubstanceGroup (#2375)
We leave the names of the bit connected with Mol files as SGroups, since that is
appropriate there, but the more generic pieces are renamed
2019-03-30 14:53:24 -04:00
Greg Landrum
b52ad644b2 Robustify parsing of CTABs and SGROUPs (#2283)
* Fixes #2277

* changes in response to review
the big one is to move the PXA parser into the normal mol file parsing

* move the PXA changes to the writer as well

* SCN actually only needs 7 characters

* add test

* fixes in response to review

* handle blanks (instead of zeros) in the counts line.
The ctfile.pdf doc says we should do this

* Make the SGroup reader more robust w.r.t. bad data
The current behavior leads to uncaught exceptions when a line is too short.
This should clear that up so that we always throw the usual FileParseException

* make error messages a bit easier to read
2019-02-21 17:39:39 +01:00
Greg Landrum
ca54f64289 Fixes #2229 (#2235)
also some reformatting
2019-01-22 10:53:48 -05:00
Ric
d26d4b076e Support for parsing/writing SGroups in SD Mol files. (#2138)
* Implementation of SGroups

* remove sample files test

* update gitignore with test outputs

* fix RevisionModifier

* re-enable tests

* backup commit; things seem to work so far

* some refactoring; obvious s group tests pass now

* more refactoring

* everything now out of the public API

* not sure why this was still in there

* rename functions; all tests now pass

* remove getNextFreeSGroupId; readd comment in copy SGroups

* clang-format

* squash-merge current master

* squash merge master

* Address comments on PR

- Update to current master.
- Move SGroup parse time checks to SGroupChecks namespace.
- Store SGroups in ROMOl as vector<SGroups>.
- SGroup methods return referenes instead of pointers.
- Use atom/bond/sgroup indexes for properties instead of pointers.
- Have SGroups inherit from RDProps; move properties to RDProps.
- Remove trivial/unused methods.
- Add a link to the SD specification atop SGroup.h
2019-01-22 15:42:27 +01:00
Greg Landrum
8c9795f535 Fix #2225 (#2228)
* Fixes #2225

* A bit of extra cleanup

* forgotten file

* Make this thread safe and add support for v3K mol blocks

* add the file

* update expected results
2019-01-17 11:44:23 -05:00
Ric
91008ff11d Address compile warnings & trivial improvements (#2097)
* Address compile warnings & trivial improvements

* revert unwanted initializers; use RDUNUSED_PARAM for unused params

* revert fix in testRDFcustom; marked with 'TO DO' comment
2018-10-12 06:39:32 -04:00
Dan N
eaa44b40c2 Enhanced stereo read/write support in SDF files. (#2022)
* add a couple test files

* backup

* first pass at some theory documentatin

* it's a draft

* Update enhanced stereochemistry documentation

Adds initial target use case and caveats about the tentative
nature of the current implementation.

* Support read/write of molfile enhanced stereochemistry

This includes reading and writing of enhanced stereochemistry
from v3000 molfiles (sdf). Enhanced stereochemistry encodes
the relative configuration of stereocenters, allowing
representation of racemic mixtures and compounds with
unknown absolute stereochemistry.

It does not include:
* Python wrapping
* invalidation of the enhanced stereochemistry
* use of enhanced stereochemistry in search
* depiction of enhanced stereochemistry.

* Update to reflect changes from #1971

* change names of enum elements to allow compilation in VS2017

I think it's also clearer to do things this way

* Addressed most review comments.

* Run missed test "testEnhancedStereoChemistry"
* In tests, added size checks to group equality checks
* Updated copyright statements
* Deleted mol created for a test
* Use perfect forwarding in RWMol::setStereoGroups()
* use references for stereo groups that are checked in write and pickle
* Updated stereogroup.h in hopes of fixing compilation on Windows.
* clang-format

* try allowing a switch to boost regex and requiring it for g++-4.8

* do a better job of that

* typo

* Code review comments. Updated Copyright notice.

* When an atom is deleted, delete stereo groups containing it.

Also updates StereoGroup toUse accessors instead of
constant member attributes. This allows move of StereoGroups.

* RDKit style guide

* Add header required on Windows.

* get the SWIG wrappers to build
2018-09-26 15:44:23 +02:00
Greg Landrum
dfae8377dd Some optimization of the queries constructed from SMARTS (#1940)
* Fixes #1929

* add a tests to make sure bogus template directories work

* add a combined atomic number + aromaticity query operation to speed up SMARTS matches
Still needs to be recognized by the SMARTS writer, serialization, and no doubt a few other places.

* add a combined query for the single/aromatic bond query that shows up in SMARTS

* Stop using a dead pointer in the when parsing Marvin SMARTS in a CTAB

* At this point all tests pass on windows

* debugging info back in

* update the bison output
2018-06-30 20:22:06 -04:00
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
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
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
Jan Holst Jensen
5616dc2597 Add support for dative bonds. (#1190)
* Add support for dative bonds to molfile reader plus writer and to SMILES reader (SMILES writer already supports it).
Initial V3000 molfile reader and writer dative bond support by Esben Jannik Bjerrum.

* first pass at adding -> as dative bond in smiles/smarts
more testing required

* all tests pass

* update .cmake files for lex
2016-12-14 09:44:18 +01:00
Greg Landrum
7fa3cae4cd clear up a bunch of windows warnings (#1086) 2016-10-04 06:46:07 -04:00
Brian Kelley
2102582f86 Protect Locales in Mol and PDB writer 2016-01-20 17:09:58 -05:00
Greg Landrum
41f4e6c5b2 hack to build on windows 2015-12-21 17:35:16 +01:00
Greg Landrum
1f04eaed26 speed up molblock generation 2015-12-21 07:48:39 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
e37296d7c7 post review 2015-11-14 08:08:14 +01:00
Brian Kelley
5f59333a56 Silences unused parameters 2015-10-18 14:02:29 -04:00
Riccardo Vianello
78d7f6c1d9 Fix regressions occurring when building with msvc9 2015-10-14 09:43:16 +02:00
Brian Kelley
6ebbeb3bd3 Major conversion of std::string API to const std::string & 2015-09-25 15:15:59 -04:00
Nadine Schneider
0132cc72e9 Merge branch 'newCanon' into master3
Conflicts:
	Code/GraphMol/SmilesParse/test.cpp
2015-04-10 10:25:47 +02:00
Brian Kelley
85e2e94d20 Fix MolFile Atom Line List Writer
Only the first element in the atom one was being
written correctly, the remainder were not being
padded correctly and could not be round tripped.
2015-04-05 20:47:02 -04:00
Greg Landrum
a0a02b4a99 merge on master 2015-02-03 16:41:46 +01:00
Brian Kelley
ff0548a871 RDKit learns how to round grip MOLFile values.
This is CTAB form:
“V XXX YYYYYY”

where (XXX is atom index, Y is the value)
2015-01-29 15:44:32 -05:00
Greg Landrum
6d7b2b0914 merge with master 2015-01-22 06:30:51 -05: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
cad05ca184 get rid of RankAtoms.cpp and
move the remaining functionality from RankAtoms.h into the new file
RDGeneral/Ranking.h
2014-12-22 07:35:58 +00:00
Nadine Schneider
53cd0666eb Introduce UpdatePropertyCache to MolWriter 2014-12-19 13:59:56 +01:00
Greg Landrum
114ff2fe8d Fixes #357 2014-10-23 06:04:48 +02:00
Greg Landrum
cd03d877fb Fixes #337 2014-10-04 14:44:42 +02:00
Greg Landrum
f94ed4a1f5 get queries from SMARTS into CTABs more reasonably 2014-05-26 09:02:08 +02:00
Greg Landrum
665872cb39 Fixes #268 2014-05-25 06:55:30 +02:00
Greg Landrum
684f451352 Fixes #266 2014-05-22 17:34:06 +02:00
Greg Landrum
601c21f19d Fixes #189 2014-03-13 05:23:56 +01:00
Greg Landrum
75be63fd6b merge with trunk 2014-02-09 05:00:18 +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
5dca39e2f7 Fixes #187 2014-01-11 05:38:11 +01:00
Greg Landrum
0ce8f23c6e further R group handling 2014-01-10 04:24:22 +01:00
Greg Landrum
4b72d1b153 add (non-standard) handling of R groups to v3k mol parser 2014-01-08 05:22:15 +01:00
Greg Landrum
763543ef70 a couple more tweaks from Jan 2014-01-07 05:55:54 +01:00
Greg Landrum
11af614ebc more cleanups of this stuff 2014-01-01 17:35:35 +01:00
Greg Landrum
64366007e1 more C++ style cleanups 2014-01-01 17:16:25 +01:00
Greg Landrum
355556b7de get atom lists working 2013-12-29 07:05:25 +01:00
Greg Landrum
0b8bd3079d fix isotope handling in V3K 2013-12-28 07:37:52 +01:00
Greg Landrum
d280c90117 a few more tests and a fix to not print empty bond blocks 2013-12-26 07:40:16 +01:00
Greg Landrum
9e91538d64 get rgroups working 2013-12-25 08:18:44 +01:00
Greg Landrum
329841d9ba add some tests; add radicals to output 2013-12-24 06:56:12 +01:00
Greg Landrum
2ee9f1c02a add to python wrapper 2013-12-23 06:43:12 +01:00