Atom selection numbers do not agree with SMILES location

User 2a3dba2aa7

28-10-2005 11:18:36

I'm using MarvinSketch 3.5.1, via javascript1.1, to get user input of a structure. I want the user to select atoms and the result - both structure and list of selected atoms - to be sent to a CGI. I wanted to use SMILES as the format for compactness and convenience with what I do in the CGI, but although I can get the list of atoms selected as a comma-separated string using isAtomSelected(), the numbers do not necessarily coincide with the positions of the atoms in the SMILES string obtained with getMol(smiles). What I want is a SMILES with the atom order the same as the atom selections, so if 7,8 and 9 are selected, these are also the 7th, 8th and 9th atoms in the SMILES. Can that be done?

ChemAxon 7c2d26e5cf

28-10-2005 12:37:49

With the current Marvin, you can not solve this problem.


We will implement a JMSketch.getSelectedMol(String) method to be able to do this.


I can not guaranty that this method will be available in the next patch release (4.0.2) because its date is very close. But I can send you a pre-release when we implemented the above method.

ChemAxon a3d59b832c

02-11-2005 11:00:07

The problem is that the smiles format contains atoms in different order from the original, and the selected atom indexes refer to the inner representation.





I suggest that you should use a format which preserves the original atom numbering. Any of mol, csmol or mrv is suitable for this. If size is a factor, I recommend csmol (compressed mol):





http://www.chemaxon.com/marvin/doc/user/mol-csmol-doc.html#csmol





Best regards,





Szabolcs