Commit Graph

104 Commits

Author SHA1 Message Date
Greg Landrum
bc0b177ceb Fixes #2450 (#2457)
* Fixes #2450
adds `hasOwningMol()` to the public API for Bond and Atom

* add to other classes;
add to python wrappers

* get the smiles generation partially working

* changes in response to review
2019-05-22 09:23:44 -04: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
733167258e Fixes #2257 (#2276)
* very basics of writing as PoC: atom labels end up in output

* further progress, does not currently work

* stop writing coordinate bonds;
we represent these in SMILES already

* add coords

* fix typo in dealing with atom properties

* get atom props working

* changes in response to PR
2019-02-22 06:50:06 +01: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
b91daa8ab9 Allow dumping interchange information into SVG files (#2030)
* add atoms

* add bonds

* backup

* Fixes #2029

* Get metadata working for drawMolecules()

* add to python wrapper
const correctness

* also connected to #2029: make sure bond direction also ends up in the output

* initial version of an SVG->ROMol parser
this is in the wrong place, but I wanted to make sure it actually works

* move svg parser to a more reasonable location
there is still some work to be done here

* add conformer parsing
2018-09-17 06:49:43 +02:00
Greg Landrum
9277c1f578 Allow Atom.GetAtomSmarts() to return isomeric SMILES (#1902)
* Add more options to GetAtomSmiles() to control output.

The most important one here is that you can now directly control whether or not isomeric SMILES is generated.

Expand the python interface so that we have more control over Atom.GetSmarts()

* make the use of isomeric atomic smiles explicit (since we can)

* start release notes for 2018.09.1

* python formatting
2018-06-19 17:23:02 -04:00
Greg Landrum
3f136946e3 Start using "*" instead of "[*]" in SMILES (#1788) 2018-03-23 15:52:52 -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
Noel O'Boyle
c22e8eecb0 Add support for %(NNN) notation for ring closures (#1624)
* Add support for %(....) notation for ring closures

* add the .cmake files

* add the extended numbering to SMARTS as well

* and the .cmake file
2017-11-15 06:48:11 +01:00
Greg Landrum
87786c08b5 Merge branch 'master' into modern_cxx
# Conflicts:
#	.travis.yml
#	Code/GraphMol/FileParsers/MolFileParser.cpp
#	Code/GraphMol/FileParsers/MolFileStereochem.cpp
#	Code/GraphMol/ForceFieldHelpers/UFF/testUFFHelpers.cpp
#	Code/GraphMol/MolAlign/testMolAlign.cpp
#	Code/GraphMol/MolDraw2D/MolDraw2D.cpp
#	Code/GraphMol/MolDraw2D/Wrap/rdMolDraw2D.cpp
#	Code/GraphMol/QueryOps.cpp
#	Code/GraphMol/ROMol.cpp
#	Code/GraphMol/SmilesParse/test.cpp
#	Code/GraphMol/Trajectory/Trajectory.cpp
#	Code/GraphMol/Wrap/Atom.cpp
#	Code/GraphMol/Wrap/Bond.cpp
#	Code/GraphMol/new_canon.cpp
#	Code/RDGeneral/testDict.cpp
#	Code/SimDivPickers/Wrap/MaxMinPicker.cpp
2017-10-05 05:58:38 +02:00
Greg Landrum
4862c920a5 Fixes github1567 (#1576)
* Fixes #1567

* update expected results

* some cleanup and documentation
2017-09-19 08:04:18 -04: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
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
1ebe5ec39f Fixes #1219 (#1220) 2016-12-20 14:07:18 -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
cf7ceab383 remove wave of warnings 2016-03-30 13:09:59 +02: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
daa7e62258 Fixes signed conversion issues (use rdcast) 2015-10-18 15:16:38 -04:00
Brian Kelley
5f59333a56 Silences unused parameters 2015-10-18 14:02:29 -04:00
baoilleach
93b38024cd Avoid unnecessary copy of fragment smiles
This makes things a little less clear (which is why I left it out originally) but it's more efficient. Now, rather than updating vfragsmi with the sorted fragment smiles, the final result smiles is generated directly.
2015-07-07 09:58:13 +01:00
baoilleach
45983f5914 Fix #532 - smilesAtomOutputOrder incorrect
Handle disconnected components correctly when generating the _smilesAtomOutputOrder property. This requires:
(a) the mapping from the fragment molecules back to the original molecule
(b) the fragment maps to be sorted at the same time as the fragment smiles (if canonical)
2015-07-06 14:31:31 +01:00
Nadine Schneider
cd76a3e986 SmilesWriter: Allow providing a canonical order of the atoms 2015-06-15 15:42:47 +02:00
Nadine Schneider
0cf0dd37ce Bugfix in SmilesWrite and some additional tests for getMolFrags function 2015-04-16 10:53:20 +02: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
Nadine Schneider
267e4b9f0e Fix in SmilesWrite 2015-04-10 09:47:15 +02:00
Nadine Schneider
7ddff9c71c Some performance fixes 2015-03-20 18:19:08 +01:00
Nadine Schneider
7e59908121 SmilesWrite: introduce new function for fragments 2015-03-20 16:38:23 +01:00
Nadine Schneider
140dc2d938 Bugfix: consider doIsomericSmiles flag in canonicalizeFragment 2015-03-20 16:38:23 +01:00
Nadine Schneider
489d06cfca Constify atom ranks in smiles construction 2015-02-12 08:59:28 +01:00
Nadine Schneider
47dbaf2304 Fix: ring stereo chemistry was swapped incorrectly 2015-02-11 18:21:15 +01:00
Greg Landrum
a0a02b4a99 merge on master 2015-02-03 16:41:46 +01:00
Greg Landrum
e6cc6cc171 optimize GetBondSmiles() 2015-02-02 22:56:14 +01:00
Greg Landrum
117696847d optimize GetAtomSmiles() 2015-02-02 22:51:57 +01: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
6ea9029577 fragment smiles construction added. NOTE that bond symbols are no longer used in the canonicalization 2015-01-04 08:32:28 +01:00
Greg Landrum
746c07561e merge with origin 2015-01-04 05:01:47 +01:00
Greg Landrum
ab0f1dcf60 rename to new_canon (probably should come up with a better name, but this will do for now) 2014-12-22 07:56:26 +00:00
Greg Landrum
bc96ccdf1b Merge with master 2014-12-21 07:36:24 +01:00
Greg Landrum
3193f88709 merged with trunk; this builds but it has not been tested at all 2014-11-30 06:33:56 +01:00
Greg Landrum
76b3efb449 Fixes #389 2014-11-20 03:45:43 +01:00
Greg Landrum
7fb24da423 merge with master 2014-09-21 21:06:40 +02:00
Greg Landrum
a94ce46a43 smiles tests now pass as well 2014-08-27 22:32:49 +02:00
Greg Landrum
e170195421 backup commit; this does not completely work yet 2014-08-03 08:01:58 +02:00
Greg Landrum
23076b1cdb Fixes #298 2014-07-23 05:31:16 +02:00
Greg Landrum
f5cf3322fe code cleanup: removing compiler warnings 2014-05-08 06:06:07 +02:00
Greg Landrum
9e4ceef1bd Fixes #206 but more testing is definitely required 2014-01-28 06:44:43 +01:00