Closed lpatiny closed 9 years ago
do you want to read from molfile / molblock ?
this is an example of Mol2BlockToMol string is it correct:
"@
@
2 3 2 1
3 4 3 1
4 5 4 1
5 6 5 un
6 6 7 ar
7 7 8 ar
8 8 9 ar
9 10 11 1
10 12 10 ar
11 13 12 ar
12 13 14 1
13 15 13 ar
14 16 15 ar
15 2 19 1
16 6 16 ar
17 9 10 ar
18 9 16 ar
19 14 27 1
20 1 17 1
21 2 18 1
22 14 26 1
23 12 25 un
24 7 24 1
25 5 23 1
26 5 22 1
27 3 21 1
28 3 20 1
@
3 UNK21 27 RESIDUE 1 A ** 1
@
Class function added & compiling without issue but return a illegal error message need to investigate
this is a javascript issue :
C=" RDKit
3 2 0 0 0 0 0 0 0 0999 V2000 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 2 3 1 0 M END $$$$ " VM6930:2 Uncaught SyntaxError: Unexpected token ILLEGALInjectedScript._evaluateOn @ VM6576:883InjectedScript._evaluateAndWrap @ VM6576:816InjectedScript.evaluate @ VM6576:682
How to convert the mol object to string ?
Illegal token error removed if we format the file to a line but RDKitjs does not support this format... need to find a solution in c++ to reformate ?
R.Molecule.MolBlockToMol('ACYCLOVIR\r\nNational University of Singapore, Department of Computational Science\r\n \r\n 27 28 0 0 0 0 0 0 0 0999 V2000\r\n -0.5390 -3.6170 -1.0950 O 0 0 0 0 0 0 0 0 0 1\r\n 0.6810 -3.4040 -0.3040 C 0 0 0 0 0 0 0 0 0 2\r\n 0.7340 -1.9900 0.2940 C 0 0 0 0 0 0 0 0 0 3\r\n 1.9580 -1.8430 1.0940 O 0 0 0 0 0 0 0 0 0 4\r\n 1.9870 -0.5060 1.7050 C 0 0 0 0 0 0 0 0 0 5\r\n 1.9210 0.4940 0.6710 N 0 0 0 0 0 0 0 0 0 6\r\n 2.9830 0.9620 -0.0400 C 0 0 0 0 0 0 0 0 0 7\r\n 2.3890 1.8500 -0.8470 N 0 0 0 0 0 0 0 0 0 8\r\n 0.9800 2.0200 -0.7330 C 0 0 0 0 0 0 0 0 0 9\r\n -0.0350 2.7100 -1.2460 C 0 0 0 0 0 0 0 0 0 10\r\n 0.2000 3.5890 -2.2160 O 0 0 0 0 0 0 0 0 0 11\r\n -1.3000 2.5180 -0.7830 N 0 0 0 0 0 0 0 0 0 12\r\n -1.5230 1.6210 0.2030 C 0 0 0 0 0 0 0 0 0 13\r\n -2.8760 1.3380 0.7800 N 0 0 0 0 0 0 0 0 0 14\r\n -0.4970 0.9190 0.7260 N 0 0 0 0 0 0 0 0 0 15\r\n 0.7560 1.0680 0.3100 C 0 0 0 0 0 0 0 0 0 16\r\n -0.5410 -3.0250 -1.8390 H 0 0 0 0 0 0 0 0 0 17\r\n 1.5760 -3.5690 -0.9510 H 0 0 0 0 0 0 0 0 0 18\r\n -0.1570 -1.8270 0.9460 H 0 0 0 0 0 0 0 0 0 20\r\n 0.7120 -1.2360 -0.5290 H 0 0 0 0 0 0 0 0 0 21\r\n 2.9190 -0.3840 2.2750 H 0 0 0 0 0 0 0 0 0 22\r\n 1.1260 -0.3930 2.3810 H 0 0 0 0 0 0 0 0 0 23\r\n 4.0290 0.6710 0.0480 H 0 0 0 0 0 0 0 0 0 24\r\n -2.0510 3.0460 -1.1810 H 0 0 0 0 0 0 0 0 0 25\r\n -2.8790 1.5450 1.7990 H 0 0 0 0 0 0 0 0 0 26\r\n 0.7120 -4.1420 0.5340 H 0 0 0 0 0 0 0 0 0 19\r\n -3.1160 0.3340 0.6490 H 0 0 0 0 0 0 0 0 0 27\r\n 2 1 1 0 0 0\r\n 3 2 1 0 0 0\r\n 4 3 1 0 0 0\r\n 5 4 1 0 0 0\r\n 6 5 1 0 0 0\r\n 6 7 4 0 0 0\r\n 7 8 4 0 0 0\r\n 8 9 4 0 0 0\r\n 10 11 1 0 0 0\r\n 12 10 4 0 0 0\r\n 13 12 4 0 0 0\r\n 13 14 1 0 0 0\r\n 15 13 4 0 0 0\r\n 16 15 4 0 0 0\r\n 6 16 4 0 0 0\r\n 9 10 4 0 0 0\r\n 9 16 4 0 0 0\r\n 1 17 1 0 0 0\r\n 2 18 1 0 0 0\r\n 14 25 1 0 0 0\r\n 12 24 1 0 0 0\r\n 7 23 1 0 0 0\r\n 5 22 1 0 0 0\r\n 5 21 1 0 0 0\r\n 3 20 1 0 0 0\r\n 3 19 1 0 0 0\r\n 2 26 1 0 0 0\r\n 14 27 1 0 0 0\r\nM END\r\n') rdkit.js:4 Uncaught 6766944___resumeException @ rdkit.js:4Eh @ rdkit.js:21vea @ rdkit.js:31dynCall_iii_99 @ VM7074:2Molecule$MolBlockToMol @ VM7252:6(anonymous function) @ VM7295:2InjectedScript._evaluateOn @ VM7002:883InjectedScript._evaluateAndWrap @ VM7002:816InjectedScript.evaluate @ VM7002:682
Indeed we would like molfile and not molblock ... sorry !
Could there be an issue with CR + LF, maybe the library only accept LF (\n) as delimiter: Also in your method you give a molfile. There is no confusion between molblock / molfile ?
it works with \n or \r\n only
T= R.Molecule.MolBlockToMol('CCCO\nJME 2015-05-03 Sat May 16 17:16:55 GMT+200 2015\n \n 4 3 0 0 0 0 0 0 0 0999 V2000\n 3.6373 0.7000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 2.4249 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1.2124 0.7000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0000 0.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 2 1 1 0 0 0 0\n 3 2 1 0 0 0 0\n 4 3 1 0 0 0 0\nM END\n')
Mol2BlockToMol