Re: [Rdkit-discuss] fast hydrogen count in molecule

2019-03-13 Thread Greg Landrum
Hi Rafal,

Before I provide something of an answer, a really important remark:
There is almost no imaginable real-world situation where the time that
counting the number of Hs takes is actually important, so it's not really
worth worrying about.

The other method I could think of, and one that would limit the number of
times you have to go across the C++/Python border would be to get the
molecular formula and then use a regex to pull out the number of Hs:

In [12]: formu =
rdMolDescriptors.CalcMolFormula(Chem.MolFromSmiles('CCCNCCO.Cl'))


In [13]: formu

Out[13]: 'C9H22ClNO'

In [14]: re.findall(r'H([0-9]*)',formu)

Out[14]: ['22']


That is faster than your idea:

In [15]: matcher = re.compile(r'H([0-9]*)')


In [23]: armodafinil =
Chem.MolFromSmiles('NC(=O)C[S@@](=O)C(c1c1)c1c1')


In [24]: def h_count2(mol):
...: return sum(x.GetTotalNumHs() for x in mol.GetAtoms())
...:


In [25]: def h_count1(mol,matcher=matcher):
...: return sum(int(x) for x in
matcher.findall(rdMolDescriptors.CalcMolFormula(mol)))
...:


In [26]: %timeit h_count2(armodafinil)

31.8 µs ± 5.74 µs per loop (mean ± std. dev. of 7 runs, 1 loops each)

In [27]: %timeit h_count1(armodafinil)

6.22 µs ± 1.48 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)




But, in the end, I think this time difference is really unlikely to
actually be important and I think sum([atom.GetTotalNumHs() for atom in
mol.GetAtoms() ]) is the best way to do it since it makes your intent much
clearer.

-greg


On Wed, Mar 13, 2019 at 11:17 AM Rafal Roszak  wrote:

> Hello group,
>
> Is there any fast way to count all hydrogen atoms in molecule?
> The only idea which I have is:
> sum([atom.GetTotalNumHs() for atom in mol.GetAtoms() ])
> which probably is not the most optimal because it require iteration
> over atom at python end.
> For all other atoms I found such solution:
> from rdkit.Chem import rdqueries
> q = rdqueries.AtomNumEqualsQueryAtom(6)
> len(mol.GetAtomsMatchingQuery(q))
>
> (in mailing-list archive:
> https://sourceforge.net/p/rdkit/mailman/message/34524687/)
> but this is valid only for atoms present in molecular graph, so is there
> any smart solution for H?
>
> Regards,
>
> Rafal
>
>
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Partial join of molecular fragments

2019-03-13 Thread Greg Landrum
On Thu, Mar 14, 2019 at 2:12 AM Marco Podda 
wrote:

> awesome! Just what I was trying to achieve!
>

Great.


>
> Just one additional question, although it's more curiosity than anything.
> I am supposing that if you "lose" the parent molecule, it is not
> possible to go back and retrieve it deterministically from the fragments
> alone. One should just apply BRICSBuild up to some depth and then "assume"
> (or rather, "hope") the original molecule is among the ones that the
> algorithm has recombined. Am I correct?
>

The process is definitely deterministic, so it's not "assume". If you know
the maximum dept that you fragment to, then you know how to ensure a
maximum depth for the rebuilding process. The group of molecules that comes
out of this will contain the input molecule.


> I was thinking about whether there is a particular fragment order that
> could foster the recovery of the original molecule, but that doesn't seem
> to be the case.
> Are you aware of any fragmentation algorithm that is able to go both ways
> (i.e. from the molecule to the fragments, and from the fragments to the
> same molecule)?
>

There is almost certainly a way to implement the BRICS decomposition/build
process such that this is possible, but I'm wondering why you would want
to. It's much easier to just keep the original molecule around with the
fragments.

-greg
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Are there Ubuntu packages for rdkit for python-3.6 somewhere?

2019-03-13 Thread Greg Landrum
Hi Francois,

It doesn't look like the debichem guys are doing python3 builds. It would
be worth asking them about though.

-greg

On Thu, Mar 14, 2019 at 4:57 AM Francois Berenger  wrote:

> Hello,
>
> I know where to find packages for python-2.7.
> No idea for python 3 though.
>
> Thanks,
> F.
>
>
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Are there Ubuntu packages for rdkit for python-3.6 somewhere?

2019-03-13 Thread Francois Berenger

Hello,

I know where to find packages for python-2.7.
No idea for python 3 though.

Thanks,
F.


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Partial join of molecular fragments

2019-03-13 Thread Marco Podda
Dear Greg,
awesome! Just what I was trying to achieve!
I mistakenly thought maxDepth would be > 0 without trying.

Just one additional question, although it's more curiosity than anything.
I am supposing that if you "lose" the parent molecule, it is not
possible to go back and retrieve it deterministically from the fragments
alone. One should just apply BRICSBuild up to some depth and then "assume"
(or rather, "hope") the original molecule is among the ones that the
algorithm has recombined. Am I correct? I was thinking about whether there
is a particular fragment order that could foster the recovery of the
original molecule, but that doesn't seem to be the case.
Are you aware of any fragmentation algorithm that is able to go both ways
(i.e. from the molecule to the fragments, and from the fragments to the
same molecule)?

Thank you again,
Marco

Il giorno lun 11 mar 2019 alle ore 17:37 Greg Landrum <
greg.land...@gmail.com> ha scritto:

> Hi Marco,
>
> Welcome to the mailing list!
>
> The trick in this particular case is that you want to do a maxDepth of 0
> (that means a single iteration) and to tell BRICSBuild that you're willing
> to see incomplete molecules (i.e. molecules that still contain a dummy
> atom):
>
> In [22]: from rdkit import Chem
> ...: from rdkit.Chem import BRICS
> ...: frags = ['[8*]C(C)(C)C',  '[16*]c1ccc2occ([16*])c2c1']
> ...: molfrags = [Chem.MolFromSmiles(f) for f in frags]
> ...: print(list(Chem.MolToSmiles(x) for x in
> BRICS.BRICSBuild(molfrags, onlyCompleteMols=False, maxDepth=0)))
>
> ['[16*]c1coc2ccc(-c3ccc4occ([16*])c4c3)cc12',
> '[16*]c1ccc2occ(-c3ccc4occ([16*])c4c3)c2c1',
> '[16*]c1ccc2occ(-c3coc4ccc([16*])cc34)c2c1',
> '[16*]c1coc2ccc(C(C)(C)C)cc12', '[16*]c1ccc2occ(C(C)(C)C)c2c1']
>
>
> The results with two [16*] attachment points happen because there's a rule
> that allows [16*] - [[16*] bonds to be formed. This wasn't in the original
> BRICS paper but it is consistent with the rest of the rules, so we added it.
>
> I hope this helps,
> -greg
>
>
>
>
>
> On Mon, Mar 11, 2019 at 3:37 PM Marco Podda 
> wrote:
>
>> Hello,
>> first of all, many thanks for this awesome library.
>>
>> I have little to none knowledge of chemistry, so I hope you'll excuse me
>> if I say some chemical nonsense below.
>>
>> I have a fragmented molecule (fragmentation being done with the BRICS
>> implementation in rdkit) which (for example) looks like this:
>>
>> frags = ['[8*]C(C)(C)C',  '[16*]c1ccc2occ([16*])c2c1']
>>
>> Say I want to join the two fragments in the list. Then, I would write:
>>
>> from rdkit import Chem
>> from rdkit.Chem import BRICS
>> frags = ['[8*]C(C)(C)C',  '[16*]c1ccc2occ([16*])c2c1']
>> molfrags = [Chem.MolFromSmiles(f) for f in frags]
>> combined = list(BRICS.BRICSBuild(molfrags, maxDepth=1))[0] # maxDepth=1
>> gives me 1 result in this case
>> print(Chem.MolToSmiles(combined, True))
>> # 'CC(C)(C)c1ccc2occ(C(C)(C)C)c2c1'
>>
>> If I understood this code correctly, BRICSBuild has reacted both dummy
>> spots in the second fragment with the dummy spot in the first fragment.
>> However, I would like to perform a partial join, meaning joining the first
>> fragment only with one of the two dummy spots in the second fragment. In
>> practice, I'm looking for a result like this:
>>
>> 'CC(C)(C)c1ccc2occ([16*])c2c1'
>> or
>> [16*]c1ccc2occ(C(C)(C)C)c2c1'
>>
>> Is there a way in rdkit to achieve this?
>> Again, sorry for the poor chemical jargon and if I make not much sense
>> from a chemical point of view.
>>
>> Thank you.
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] problem when doing Chem.MolFromSmiles()

2019-03-13 Thread Ivan Tubert-Brohman
The problem is this line:

>
core_smiles_2='C1=C/C2=C/c3ccc4n3[Zn]n3/c(cc/c3=C/C3=N/C(=C\4)C=C3)=C\C1=N2'

Python is interpreting the \4 as an escape sequence. You either need to
double the backslash or use an "r string" to protect the backslash from
being interpreted that way. That is, either of these should be fine:

>
core_smiles_2=r'C1=C/C2=C/c3ccc4n3[Zn]n3/c(cc/c3=C/C3=N/C(=C\4)C=C3)=C\C1=N2'
>
core_smiles_2='C1=C/C2=C/c3ccc4n3[Zn]n3/c(cc/c3=C/C3=N/C(=C\\4)C=C3)=C\C1=N2'

Ivan



On Wed, Mar 13, 2019 at 6:54 AM Chencheng Fan 
wrote:

> Hello everyone,
>
> I meet a problem that I don’t understand how it happens and how to solve
> it.
>
> First, I generate an rdkit_object from reading a mol file(Porphyrin
> molecule). Then generate Smiles from the rdkit_object and save the Smiles
> string in a parameter. Then use the parameter to generate rdkit_object. The
> code works well until now. However, if I directly try to generate
> rdkit_object from the Smiles string, it will return SMILES Parse
> Error:syntax error for input.
>
> I appreciate very much for your help!
>
> Have a good day!
>
> Best wishes
> Cheng
>
> The mol file is:
>
>
> Code is:
>
> from __future__ import print_function
> import rdkit
> from rdkit import Chem
> from rdkit.Chem import AllChem
>
>
> Corefile='Porphyrin.mol'
> core_rdkit_object=Chem.MolFromMolFile(Corefile)
> core_smiles=Chem.MolToSmiles(core_rdkit_object)
> print('core_smiles',core_smiles)
> core=Chem.MolFromSmiles(core_smiles)
> print('rdkit_object',core)
> coreh=Chem.AddHs(core)
> AllChem.EmbedMolecule(coreh)
> print(Chem.MolToMolBlock(coreh))
>
>
> core_smiles_2='C1=C/C2=C/c3ccc4n3[Zn]n3/c(cc/c3=C/C3=N/C(=C\4)C=C3)=C\C1=N2'
> core=Chem.MolFromSmiles(core_smiles_2)
> print(core)
> coreh=Chem.AddHs(core)
> AllChem.EmbedMolecule(coreh)
> print(Chem.MolToMolBlock(coreh))
>
>
> Error is:
>
> core_smiles
>  C1=C/C2=C/c3ccc4n3[Zn]n3/c(cc/c3=C/C3=N/C(=C\4)C=C3)=C\C1=N2
> rdkit_object.   
> [11:50:20] UFFTYPER: Unrecognized atom type: Zn1+2 (9)
> [11:50:20] SMILES Parse Error: syntax error for input:
> 'C1=C/C2=C/c3ccc4n3[Zn]n3/c(cc/c3=C/C3=N/C(=C)C=C3)=C\C1=N2'
> None
> Traceback (most recent call last):
>  File "test-generate_core.py", line 21, in 
>coreh=Chem.AddHs(core)
> Boost.Python.ArgumentError: Python argument types in
>rdkit.Chem.rdmolops.AddHs(NoneType)
> did not match C++ signature:
>AddHs(RDKit::ROMol mol, bool explicitOnly=False, bool addCoords=False,
> boost::python::api::object onlyOnAtoms=None, bool addResidueInfo=False)
>
>
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Is there an easy way of iterating over multiple RXN definitions in an RDFile

2019-03-13 Thread James Wallace
Ok, thanks. I figured as much, but wanted to avoid going the long way
around if I didn't have to.

On Wed, 13 Mar 2019 at 12:06, Greg Landrum  wrote:

> Hi James,
>
> There's not currently anything implemented for this aside from manually
> splitting the file using string operations.
>
> The reason the RDKit does not have a Supplier for working with RDFiles is
> the general lack of publicly available collections of RDFiles that could be
> used for testing.
> If anyone could help with this part, I'm sure we could come up with an
> RDReactionSupplier.
>
> -greg
>
>
>
>
>
> On Wed, Mar 13, 2019 at 12:17 PM James Wallace 
> wrote:
>
>> I know there are MolSuppliers and ForwardMolSuppliers for handling
>> multiple entries in a  stream-like way from SDFiles, but I don’t see a
>> reaction equivalent for RDFiles. My use case is one in which users have
>> submitted multiple sketched reactions as RXN, for each to be validated and
>> considered on its own merits, but I only see these as part of one file
>> object. I’m reluctant to do string operations to split the file up, because
>> it would forego the RDKit validity and make assumptions about the file
>> format.
>>
>>
>> I'm working with the Python build if that's not obvious.
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Is there an easy way of iterating over multiple RXN definitions in an RDFile

2019-03-13 Thread Greg Landrum
Hi James,

There's not currently anything implemented for this aside from manually
splitting the file using string operations.

The reason the RDKit does not have a Supplier for working with RDFiles is
the general lack of publicly available collections of RDFiles that could be
used for testing.
If anyone could help with this part, I'm sure we could come up with an
RDReactionSupplier.

-greg





On Wed, Mar 13, 2019 at 12:17 PM James Wallace  wrote:

> I know there are MolSuppliers and ForwardMolSuppliers for handling
> multiple entries in a  stream-like way from SDFiles, but I don’t see a
> reaction equivalent for RDFiles. My use case is one in which users have
> submitted multiple sketched reactions as RXN, for each to be validated and
> considered on its own merits, but I only see these as part of one file
> object. I’m reluctant to do string operations to split the file up, because
> it would forego the RDKit validity and make assumptions about the file
> format.
>
>
> I'm working with the Python build if that's not obvious.
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Is there an easy way of iterating over multiple RXN definitions in an RDFile

2019-03-13 Thread James Wallace
I know there are MolSuppliers and ForwardMolSuppliers for handling multiple
entries in a  stream-like way from SDFiles, but I don’t see a reaction
equivalent for RDFiles. My use case is one in which users have submitted
multiple sketched reactions as RXN, for each to be validated and considered
on its own merits, but I only see these as part of one file object. I’m
reluctant to do string operations to split the file up, because it would
forego the RDKit validity and make assumptions about the file format.


I'm working with the Python build if that's not obvious.
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] problem when doing Chem.MolFromSmiles()

2019-03-13 Thread Chencheng Fan
Hello everyone,I meet a problem that I don’t understand how it happens and how to solve it.First, I generate an rdkit_object from reading a mol file(Porphyrin molecule). Then generate Smiles from the rdkit_object and save the Smiles string in a parameter. Then use the parameter to generate rdkit_object. The code works well until now. However, if I directly try to generate rdkit_object from the Smiles string, it will return SMILES Parse Error:syntax error for input.I appreciate very much for your help! Have a good day!Best wishesChengThe mol file is:

Porphyrin.mol
Description: chemical/molfile
Code is:from __future__ import print_functionimport rdkitfrom rdkit import Chemfrom rdkit.Chem import AllChemCorefile='Porphyrin.mol'core_rdkit_object=Chem.MolFromMolFile(Corefile)core_smiles=Chem.MolToSmiles(core_rdkit_object)print('core_smiles',core_smiles)core=Chem.MolFromSmiles(core_smiles)print('rdkit_object',core)coreh=Chem.AddHs(core)AllChem.EmbedMolecule(coreh)print(Chem.MolToMolBlock(coreh))core_smiles_2='C1=C/C2=C/c3ccc4n3[Zn]n3/c(cc/c3=C/C3=N/C(=C\4)C=C3)=C\C1=N2'core=Chem.MolFromSmiles(core_smiles_2)print(core)coreh=Chem.AddHs(core)AllChem.EmbedMolecule(coreh)print(Chem.MolToMolBlock(coreh))Error is:core_smiles        C1=C/C2=C/c3ccc4n3[Zn]n3/c(cc/c3=C/C3=N/C(=C\4)C=C3)=C\C1=N2rdkit_object.       [11:50:20] UFFTYPER: Unrecognized atom type: Zn1+2 (9)[11:50:20] SMILES Parse Error: syntax error for input: 'C1=C/C2=C/c3ccc4n3[Zn]n3/c(cc/c3=C/C3=N/C(=C)C=C3)=C\C1=N2'NoneTraceback (most recent call last): File "test-generate_core.py", line 21, in    coreh=Chem.AddHs(core)Boost.Python.ArgumentError: Python argument types in   rdkit.Chem.rdmolops.AddHs(NoneType)did not match C++ signature:   AddHs(RDKit::ROMol mol, bool explicitOnly=False, bool addCoords=False, boost::python::api::object _onlyOnAtoms_=None, bool addResidueInfo=False)___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] fast hydrogen count in molecule

2019-03-13 Thread Rafal Roszak
Hello group,

Is there any fast way to count all hydrogen atoms in molecule?
The only idea which I have is:
sum([atom.GetTotalNumHs() for atom in mol.GetAtoms() ])
which probably is not the most optimal because it require iteration
over atom at python end.
For all other atoms I found such solution:
from rdkit.Chem import rdqueries 
q = rdqueries.AtomNumEqualsQueryAtom(6) 
len(mol.GetAtomsMatchingQuery(q))

(in mailing-list archive: 
https://sourceforge.net/p/rdkit/mailman/message/34524687/) 
but this is valid only for atoms present in molecular graph, so is there any 
smart solution for H?

Regards,

Rafal


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Bond tags in SVGs

2019-03-13 Thread Greg Landrum
Hi Lukas,

I did a Mac build for python 3.6 this morning and put it in my channel with
a beta label.
You can install it like this:
conda install -c greglandrum/label/beta rdkit

Please let me know if you hit any problems
-greg


On Tue, Mar 12, 2019 at 11:40 AM Greg Landrum 
wrote:

> HI Lukas,
>
> I haven't done the build yet. I will see if I can manage to do one
> tomorrow.
>
> These changes have been merged onto the trunk and will definitely be in
> the release.
>
> -greg
>
>
> On Tue, Mar 12, 2019 at 10:42 AM Lukas Pravda  wrote:
>
>> Hi Greg,
>>
>>
>>
>> I was wondering If you managed to create the Mac build you were talking
>> about some time ago. Also I wonder If this functionality is going to be
>> part of the next RDKit release?
>>
>>
>>
>> Best,
>>
>> Lukas
>>
>>
>>
>> *From: *Greg Landrum 
>> *Date: *Tuesday, 5 February 2019 at 14:45
>> *To: *Lukas Pravda 
>> *Cc: *RDKIT mailing list 
>> *Subject: *Re: [Rdkit-discuss] Bond tags in SVGs
>>
>>
>>
>> Sure. I don't have my Mac with me, so that'll need to wait until I'm back
>> in Basel on the weekend.
>>
>>
>>
>> -greg
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Feb 5, 2019 at 2:39 PM Lukas Pravda  wrote:
>>
>> If it is not too much trouble to ask, please build it for mac os
>> (10.14.3) python 3.6.x.
>>
>>
>>
>> Thanks!
>>
>> Lukas
>>
>>
>>
>> *From: *Greg Landrum 
>> *Date: *Tuesday, 5 February 2019 at 13:40
>> *To: *Lukas Pravda 
>> *Cc: *RDKIT mailing list 
>> *Subject: *Re: [Rdkit-discuss] Bond tags in SVGs
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Feb 5, 2019 at 12:23 PM Lukas Pravda  wrote:
>>
>>
>>
>> Thanks for this. It looks excellent!! Is there a way how I can test this?
>> Other than cloning and compiling the repository? So far I have been using
>> rdkit solely from python and its conda builds, so don’t really know how to
>> test it.
>>
>>
>>
>> At the moment you would need to get a copy of the repo and build it. I
>> can do a build so that it's conda-installable though. Which OS are you
>> using?
>>
>>
>>
>> If I understand this correctly, the atom and bond class ids are added
>> only after TagAtoms() is called, or are they added at the ‘DrawMolecule()’
>> stage?
>>
>>
>>
>> Bond classes are added as the bonds are written. Atom classes can only be
>> added at the TagAtoms() stage - there's not an object in the SVG for many
>> atoms without TagAtoms() being called.
>>
>>
>>
>> I can imagine a lot of possible scenarios and use cases with this new
>> functionality. However, in order to make the function TagAtoms()
>> sufficiently general, a bit more control over the javascript used in the
>> events would be needed. As a possible suggestions, I can imagine to pass as
>> the third parameter a lambda selector, which would in turn feed the JS
>> function with parameters to display names/charges/whatever. Also it would
>> be nice to have a mean how to pass dict of key-val properties for both
>> atoms and bonds so that you can incorporate related data into the svg.
>>
>>
>>
>> Having said that, in my opinion if svgs end up as a part of
>> html/javascript application, it is the best to expose this interactivity
>> directly from the client, rather than ‘pre-generating’ the behaviour on the
>> server. So I’m not sure If it is worth investing time into mimicking this
>> functionality in C++/python code, Whoever is in a need of generating
>> interactive svgs, can directly consume the svg string and modify it
>> according to their needs.
>>
>>
>>
>> Yeah, that's more or less what I was thinking. We want to write something
>> that can be reasonably easily modified after the fact to produce something
>> useful.
>>
>>
>>
>>
>>
>> To sum up, I think it should enough just to tag positions and identifiers
>> of atoms/bonds exactly as you do and possibly further extend them with a
>> mean how to pass some extra data to all of it. Then users can modify svgs
>> whichever way they want, but others might think differently.
>>
>>
>>
>> Excellent!
>>
>>
>>
>> -greg
>>
>>
>>
>>
>>
>> Best,
>>
>> Lukas
>>
>> *From: *Greg Landrum 
>> *Date: *Sunday, 3 February 2019 at 17:49
>> *To: *Lukas Pravda 
>> *Cc: *RDKIT mailing list 
>> *Subject: *Re: [Rdkit-discuss] Bond tags in SVGs
>>
>>
>>
>> Hi Lukas,
>>
>>
>>
>> I had a chance to do a bit of work on this recently and I'd be interested
>> to hear your feedback.
>>
>>
>>
>> Bonds are now tagged with their bond IDs (using classes) and the
>> "TagAtoms()" function now adds clickable transparent circles above each
>> atom. These are also tagged with atom IDs using classes. TagAtoms() also
>> lets you add callback functions for events associated with the atom
>> circles. At the moment these are simply called with the atom id, but
>> there's almost certainly a better way to do that. Suggestions are very
>> welcome.
>>
>>
>>
>> Here's a gist showing what's currently on the branch:
>> https://gist.github.com/greglandrum/d23517cb449003252cf09b5bd14d8637
>>
>>
>>
>>
>>
>> On Tue, Dec 4, 2018 at 6:46 PM Lukas Pravda  wrote:
>>
>> Hi Greg,
>>
>>
>>
>>