SD tag data can be set to OEMolBases ,
OEMCMolBases , or
OEConfBases . Generally, OEChem will never
lose any data when reading or writing. However, there are constraints
placed on OEChem as to where the data must go based upon the file
format being used.
A problem occurs when setting SD tag data to an
OEMCMolBase and then writing it to
SDF. SDF files do not support multiple
conformers. However, OEChem can automatically read consecutive
conformers out of a SDF file into a
OEMCMolBase . To preserve the generic data
OEChem has no choice but to push the data onto the conformers.
OEB files do not have this restriction upon them because they
do support multi-conformer molecules. The following table shows how to
round trip SD tag data through the SDF and OEB formats.
| Attached To | Written To | Read Into | Attached To |
OEMCMolBase |
sdf | OEMCMolBase |
OEConfBase |
OEMCMolBase |
sdf | OEMolBase |
|
OEMCMolBase |
oeb | OEMCMolBase |
|
OEMCMolBase |
oeb | OEMolBase |
|
OEConfBase |
sdf | OEMCMolBase |
OEConfBase |
OEConfBase |
sdf | OEMolBase |
|
OEConfBase |
oeb | OEMCMolBase |
OEConfBase |
OEConfBase |
oeb | OEMolBase |
|
OEMolBase |
sdf | OEMCMolBase |
OEConfBase |
OEMolBase |
sdf | OEMolBase |
|
OEMolBase |
oeb | OEMCMolBase |
OEConfBase |
OEMolBase |
oeb | OEMolBase |
Practically speaking, it is best to never attach SD tag data to an
OEMCMolBase . This should only be done as a
space optimization when it is assured that the multi-conformer
molecule will only be written to OEB.
To this end, when an OEMol copy constructs from an
OEGraphMol the SD tag data (and any other generic data) is
attached to the first conformer.