Hi Markus,
You can generate the RXN file output from the rxn object via
ReactionToRxnBlock, like this Python code:
>>> from rdkit import Chem
>>> from rdkit.Chem import AllChem
>>> rxn = AllChem.ReactionFromSmarts('CC(=O)O.OCC>>CC(=O)OCC')
>>> AllChem.ReactionToRxnBlock(rxn)
'$RXN\n\n RDKit\n\n 2 1\n$MOL\n\n RDKit \n\n 4 3 0 0
0 0 0 0 0 0999 V2000\n 0. 0. 0. C 0 0 0
0 0 0 0 0 0 0 0 0\n 0. 0. 0. C 0 0 0
0 0 0 0 0 0 0 0 0\n 0. 0. 0. O 0 0
0 0 0 0 0 0 0 0 0 0\n 0. 0. 0. O 0
0 0 0 0 0 0 0 0 0 0 0\n 1 2 6 0\n 2 3 2 0\n 2 4
6 0\nM END\n$MOL\n\n RDKit \n\n 3 2 0 0 0 0 0
0 0 0999 V2000\n 0. 0. 0. O 0 0 0 0 0
0 0 0 0 0 0 0\n 0. 0. 0. C 0 0 0 0
0 0 0 0 0 0 0 0\n 0. 0. 0. C 0 0 0 0
0 0 0 0 0 0 0 0\n 1 2 6 0\n 2 3 6 0\nM
END\n$MOL\n\n RDKit \n\n 6 5 0 0 0 0 0 0 0 0999
V2000\n 0. 0. 0. C 0 0 0 0 0 0 0 0 0 0
0 0\n 0. 0. 0. C 0 0 0 0 0 0 0 0 0 0
0 0\n 0. 0. 0. O 0 0 0 0 0 0 0 0 0
0 0 0\n 0. 0. 0. O 0 0 0 0 0 0 0 0
0 0 0 0\n 0. 0. 0. C 0 0 0 0 0 0 0
0 0 0 0 0\n 0. 0. 0. C 0 0 0 0 0 0 0
0 0 0 0 0\n 1 2 6 0\n 2 3 2 0\n 2 4 6 0\n 4 5 6
0\n 5 6 6 0\nM END\n'
>>>
Writing an RDF file is quite like writing an SD file, except that the
molfile entry is replaced with an RXN file entry. The syntax for data
fields is a bit different too. Data fields can be used to describe
agents, conditions, etc. but there is no fixed vocabulary (that I know
of) for e.g. specifying "this is an agent". Hence, exchanging and
parsing RDF files can be ... interesting.
Cheers
-- Jan Holst Jensen
On 2019-09-03 11:59, Markus Grimm via Rdkit-discuss wrote:
Dear all,
I'm trying to generate .rxn files or one single .rdf file from a csv
file where I have a bunch of reactions smiles stored.
I know how to instantiate a rxn object but I no idea how to safe this
to several .rxn files or a RDF file.
I already asked this question last Friday but unfortunately I did not
receive any answer. So I'm wondering is it even possible?
Thank you very much for your support.
Best regards,
Markus
smime.p7s
Description: S/MIME Cryptographic Signature
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss