the \n dilemma: new line or aromatic N in trans config???

User 21b7e0228c

05-05-2008 13:22:29

Hi!





Have a look at the attached .html file (it's cgi-generated, but the standalone version will do as well). It doesn't want to load, and I guess it's because of the "\n" appearing in the SMILES, and which is misinterpreted by the javaScript (the same SMILES causes no trouble if loaded straight into msketch!). Definitely, \n stands for many things in these troubled days (note that the smiles under question is the standardized unique form) - so how can be this ambiguity lifted? I may of course check for this and let the .cgi substitute any \n to \\n prior to printing out the quoted smiles (if that would help, don't know!!) but maybe there'd be some more elegant solution to this?





Cheers!


Dragos

ChemAxon 7c2d26e5cf

16-05-2008 16:00:33

Hi Dragos,


I have investigated this question.


Depends on the number of backslash Marvin evaluates the SMILES different way:


1. By mview_param("mol","CC(C)(C)C(=O)C(=C\c1cccc(c1)[N+]([O-])=O)\n1cncn1"), Marvin reads the following string:


Code:
CC(C)(C)C(=O)C(=C\c1cccc(c1)[N+]([O-])=O)


1cncn1



2. By mview_param("mol","CC(C)(C)C(=O)C(=C\c1cccc(c1)[N+]([O-])=O)\\n1cncn1"), Marvin reads this:
Code:
CC(C)(C)C(=O)C(=C\c1cccc(c1)[N+]([O-])=O)\n1cncn1






In the first case, JavaScript evaluated "\n" as EOL (end of line) character and pass a multiline string to the applet. Since EOL is a delimiter character, Marvin handles this line broken SMILES as two separate records. In this case Marvin expects only one record by "mol" parameter, that's why the exception is dropped.


In the second case, JavaScript reads a "\" (backslash) and a "n" characters and send this string to the applet.





If you would like to display several SMILES in a view table, use cell0, cell1, etc. parameters. You have to specify the content for each cell. (Define only one SMILES by "mol", "cell0", "cell1", etc. parameters.)