Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atom Mapping and Colour Map at the same time? #3

Open
schymane opened this issue Oct 22, 2017 · 9 comments
Open

Atom Mapping and Colour Map at the same time? #3

schymane opened this issue Oct 22, 2017 · 9 comments

Comments

@johnmay
Copy link
Member

johnmay commented Oct 28, 2017

Possible in code but via the web-service at the moment. I can make the annotate parameter take a list e.g. annotate=colmap,atommap etc. Things get crowded very quickly though.

What's the use-case?

@schymane
Copy link
Author

I bet it will get crowded, we'd like to us this to simplify metabolic reactions where we have atom maps, by reducing the chains and other "substructures" down to R groups - we can display e.g. numbered Rs in the CDK but not e.g. in ChemAxon, where they become *s. We're playing around with the possibilities of how we can index parts of "uncertain structures" that aren't reacting, the colour helps visually track what is going where in the reaction but we need the atom maps too - hence the combination would be cool. It's early days, we're playing around with how we could implement this in code and the ability to edit the SMILES live in the web interface and see what happens is incredibly useful .. pre-coding once we have the concept sorted... because I don't actually have the SMILES, I'm making them "live" and we're trying to figure out what will work so we can create them systematically ... if you see what I mean ...

I have a couple of examples but the URLs are going crazy with copy paste and I can't rescue the SMILES out of them (I have the originals on a different device ... can send if needed) ... here's at least one of the pictures...

image

@johnmay
Copy link
Member

johnmay commented Oct 28, 2017

we can display e.g. numbered Rs in the CDK but not e.g. in ChemAxon, where they become *s

Erm.. that doesn't sound right? How are you putting the R groups in...

c1ccccc1* |$;;;;;;R1$|

Is how it should be done the same in both ChemAxon and CDK (they did it first). I do have a debug function that dumps unrecognized text from bracket atoms in to pseudo-atoms but this is non-standard and should not be used e.g. c1ccccc1[R1] BAD.

Also you can put the substituents in there... I don't support this fully mainly because CDK likes to have separate objects (e.g. there is an RGroupQuery instance) whereas I would just represent everything in a single mol type.

c1ccccc1 |$R1;;;;;;$,RG:_R1={CC |$;;_AP1$|},{CCC* |$;;;_AP1$|}|

Have some prototype code to display that

@schymane
Copy link
Author

schymane commented Oct 29, 2017 via email

@johnmay
Copy link
Member

johnmay commented Oct 29, 2017

Yes you can use it in reactions too. It's CXSMILES export option from ChemAxon.

@schymane
Copy link
Author

I don't have ChemAxon so can't try the export directly and I also have a lot of structures from literature that I'm trying to represent correctly where I don't necessarily even have mol files to start as, in the end, I need the SMILES that works properly for the CDK, not a mol. I tried a few CxSMILES that display well individually and couldn't get any of them to work with a reaction.
If I start with one of your examples:
CCO.[CH3:1]C:2[OH:4]>[H+]>CC[O:4]C:2[CH3:1].O Ethyl esterification [1.7.3]
image

Then I modify the CCO and reactant to contain an R group:
*CO |$R1;;$| test
*C[O:4]C:2[CH3:1] |$R1;;;;;$| test2

These display fine by themselves
image

but the reaction doesn't - everything after the first reactant ends up in the title (or nothing displays) no matter what combination of spacing I try. What am I missing?

*CO |$R1;;$|.[CH3:1]C:2[OH:4]>[H+]>*C[O:4]C:2[CH3:1] |$R1;;;;;$|.O Ethyl esterification with R group
image

@johnmay
Copy link
Member

johnmay commented Oct 29, 2017

No you put it all in the title, this ensure backwards compatability:

OC[*].[CH3:1][C:2]([OH:4])=[O:3]>[H+]>[CH3:1][C:2](=[O:3])[O:4]C[*].O |$;;_R1;;;;;;;;;;;_R1;$| Ethyl esterification [1.7.3]

https://www.chemaxon.com/marvin-archive/latest/help/formats/cxsmiles-doc.html

@schymane
Copy link
Author

schymane commented Oct 29, 2017

ahha, without _ it looks better ... so you have to count atoms over the whole reaction ... I see ...
OC[*].[CH3:1][C:2]([OH:4])=[O:3]>[H+]>[CH3:1][C:2](=[O:3])[O:4]C[*].O |$;;R1;;;;;;;;;;;R1;$| Ethyl esterification [1.7.3]
or even
OC*.[CH3:1][C:2]([OH:4])=[O:3]>[H+]>[CH3:1][C:2](=[O:3])[O:4]C*.O |$;;R1;;;;;;;;;;;R1;$| Ethyl esterification [1.7.3]
(because the original SMILES don't have the * in square brackets?)

@schymane
Copy link
Author

But to return to the original issue ... if I want to combine atom mapping AND colour mapping in R:

m2 <- parse.smiles("[CH3:1]C:2[OH:4]")[[1]]
dep2 <- get.depictor(annotate="mapidx")
img <- view.image.2d(m2,dep2)
plot(1:10, 1:10, pch=19)
rasterImage(img, 2,2,8,10)

Looks good:
image

But I can't get the colmap - presumably because I need the reaction (a single SMILES also doesn't display colmap in depict):

dep3 <- get.depictor(annotate="colmap")
img <- view.image.2d(m2,dep3)
plot(1:10, 1:10, pch=19)
rasterImage(img, 2,2,8,10)

image

But if I try to parse reaction SMILES that display in Depict I get null ... what option am I missing here?
@rajarshi ?

m3 <- parse.smiles("CCO.[CH3:1]C:2[OH:4]>[H+]>CC[O:4]C:2[CH3:1].O Ethyl esterification [1.7.3]")[[1]]
m3

NULL

Without title the same:

m3 <- parse.smiles("CCO.[CH3:1]C:2[OH:4]>[H+]>CC[O:4]C:2[CH3:1].O")[[1]]
m3

NULL

Would adjusting "annotate" to take a list be the right way, or rather a new option that just combines colmap and mapidx? I guess a list would let users pick and choose...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants