Commit Graph

115 Commits

Author SHA1 Message Date
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
Eisuke Kawashima
185ec927ab Unset executable flag 2019-10-10 20:18:43 +09:00
Pat Lorton
dc1ccc3d9e Keep PDB info from Maestro files if available (#2619)
* Keep PDB info from Maestro files if available

* Add test and test_data for Maestro PDB data reading
2019-08-23 14:00:52 -07:00
Brian Kelley
fa61fa717d Add test for issue #2285, fix molbundle test (#2301) 2019-02-28 13:47:03 -05: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
Greg Landrum
c59d586431 Fixes #2040 (#2085)
* does not yet really work

* tests pass

* store the info about the attachment points in case we want to use it later.

* add a couple more tests; changes in response to review
2018-10-08 22:27:48 +02: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
b73fc3e317 fixes #2000 (#2001) 2018-08-12 17:10:09 -04: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
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
Brian Kelley
bc17df421f Adds case for testing invalid smarts in MRV SMA tags 2017-12-22 08:21:05 -05:00
Brian Kelley
5fe9bbb780 Adds ability to read and parse marvin smarts in mol blocks 2017-12-22 08:20:31 -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
adad6e55c2 Fix two problems with the PDB parsing (#1341)
* Fixes #1029

* Fixes #1340

* add test files
2017-03-04 12:34:27 -05:00
Greg Landrum
7ee348feb3 Fixes #1251 (#1252) 2017-01-09 16:29:06 -05: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
f4a02f5f13 Expanded sequence support (#1140)
* patch from Roger Sayle to support nucleic acids as well as amino acids

* add some tests which do not yet pass

* fix a bug I introduced in residue name parsing

* basic sequence testing

* add some more tests
2016-11-04 04:29:26 +01:00
Greg Landrum
9f9f2cd2d2 support additional trans-uranic elements (#1134)
* support additional trans-uranic elements
- update the atomic data and isotope lists
- update the SMILES and SMARTS parsers

* rebreak an input file
2016-11-03 11:48:31 -04:00
Greg Landrum
f0bb85dfdb Fixes #1049 (#1050)
* fixes #1049
That was almost too easy

* elaborate the test a bit
2016-09-01 09:22:17 +02:00
Greg Landrum
8009b867b5 Fixes #1034: squiggle bonds are now preserved if no sanitization is done (#1043)
* backup commit

* typo

* forgot the test file

* also test that atom chirality is handled properly
2016-08-30 16:02:31 +02:00
Greg Landrum
7a49dd3bb9 fixes #1023 (#1027) 2016-08-18 16:29:29 -04:00
Paolo Tosco
63b6bdef46 - RCSB SDF files which feature right-justified element names can now be parsed (#994)
- added a relevant test
2016-07-27 14:49:52 +02:00
Greg Landrum
d30bf4a6df the fix for #188 also
fixes #192
2016-03-29 13:19:10 +02:00
Greg Landrum
53b6e52765 ok, this time it is a proper fix 2016-03-29 13:09:22 +02:00
Greg Landrum
9a13afba24 Fixes #188 2016-03-29 10:58:56 +02:00
Greg Landrum
2ca85c775f Fixes #741 2016-02-13 05:38:03 +01:00
Greg Landrum
d3bf352940 add test for #611 2015-09-10 16:01:15 +02:00
Paolo Tosco
6551488dcd - changed SDMolSupplier to be tolerant of spurious lines after
a blank line in a property when strictParsing = false; properties
  are truncated after the first blank line. Also spurious lines
  before the first property are tolerated (and ignored)
- added the strictParsing parameter to the setData() method in C++
  and to the SetData method in Python. Previously, when the setData()
  method was invoked, the strictParsing flag could not be set.
  Moreover, df_strictParsing was not initialised , which might result
  in undefined behaviour
- added relevant C++ and Python tests
2015-05-10 22:30:11 +01:00
Greg Landrum
8846f4dbee Fixes #438 2015-02-21 14:20:47 +01:00
Greg Landrum
c6dd83a47c Fixes #360 2014-10-25 12:13:01 +02:00
Greg Landrum
cd03d877fb Fixes #337 2014-10-04 14:44:42 +02:00
Greg Landrum
6b26036f6a Fixes #269 2014-05-23 08:26:26 +02:00
Greg Landrum
684f451352 Fixes #266 2014-05-22 17:34:06 +02:00
Greg Landrum
196c2278fb Fixes #234 2014-03-17 08:33:07 +01: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
0839cf41ad Fixes #210 2014-02-03 05:25:27 +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
aab11535e8 Fixes #196 2014-01-16 02:07:03 -05:00
Greg Landrum
c13a643e06 Fixes #191 2014-01-12 05:42:50 +01:00
Greg Landrum
e38e60d283 Fixes #186 2014-01-11 06:01:30 +01:00
Greg Landrum
5dca39e2f7 Fixes #187 2014-01-11 05:38:11 +01:00
Greg Landrum
f653e9e961 more isotope fixing 2014-01-08 06:51:48 +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
3f90cecd9c Fixes #164 2013-12-31 08:27:09 +01:00
Greg Landrum
ae14fa3bd9 add support for the ZCH and HYD elements in mol files 2013-12-07 17:40:04 +01:00