User fa1369adab
22-02-2006 13:19:00
I sometimes store molecules in MOLFILE and sometimes in MRV format. I would like Exporter to extract molecules from the database in the same format in which I have entered them. But it seems that if I don't explicitly setFormat(), then MOLFILE format is returned. Am I mistaken?
ChemAxon 9c0afc9aaf
22-02-2006 18:01:45
Hi,
The basic concept of file export assumes that all of the exported structures are written into a single file.
If you want the exported file to be a legal structure file, you cannot mix different formats within a single file. Therefore the format must be provided.
Best regards,
Szilard
ChemAxon 587f88acea
23-02-2006 12:43:59
Exactly! Each individual time we export a structure, we want the original format of the structure to be preserved in the output file. But we don't know what was the original format of that structure, so we can't specify it. And if we don't specify it, it is always exported in MOL format.
It seems to me that the two principles here can be reconciled. Suppose a user wants to export n structures. If a format is specified, then all n structures are exported in that format. If no format is specified, then all n structures are exported in the original format of the first structure retrieved. That way, we can export a single structure in its original format, and multiple structures will always be exported in the same format.
ChemAxon 9c0afc9aaf
24-02-2006 16:29:40
Hi,
I can only see one possible problem with the solution you suggested.
If the structures are exported into a file, the file extension and the file format may differ, making it a "faulty" structure file (as you don't know what format you would get).
Could you tell some details how do you intend to use the exported structures ? Do you want to save them as a file or use them in an other way ?
Regards,
Szilard
ChemAxon 587f88acea
24-02-2006 16:57:33
I believe we export them into a string, not a file. Furthermore, we always retrieve structures from the database one at a time.
Our problem is as follows: We want to store in the database both MOL structures that contain information not preserved upon conversion into MRV, and MRV structures that contain information not preserved upon conversion into MOL. The only way to preserve all the information is to retrieve all the structures in their original format.
The possible problem you raise is easily solved by proper programming. The programmer can easily set the extension of the file to depend on the file format.
ChemAxon 587f88acea
24-02-2006 17:55:02
Or, you can allow the format of the exported structure to depend on the original format only when the structure is exported to a string.
ChemAxon 587f88acea
27-02-2006 13:53:17
Thanks, that did the trick for us.
Now we don't need to learn how to use <property> tags in MRV, either. Whew.