Put the molecule's label in the title line
The first line of molfiles is here to put the name/label of the molecule. Why aren't we using it?
OCL supports it by default in the molfile parser and serializers and we can easily set it with molecule.setName(label) and read it with molecule.getName()
@lpatiny
It seems unsupported by ChemDraw (but this is not the only software). When exporting as SDF, ChemDraw would even place on the first line always the filename. Not very useful.
Nevertheless, using OCL, it is trivial to read and write the name that is loaded / save in the molfile:
- https://cheminfo.github.io/openchemlib-js/classes/Molecule.html#getname
- https://cheminfo.github.io/openchemlib-js/classes/Molecule.html#setname
And by placing the label in the molfile, it would not only allow copying / pasting the molfile while keeping the label inside NMRium but also prevent the first line from being empty, which causes some issues (people removing this first line).
Should we remove from the state the label and rely only on this property molecule.getName() ? This would avoid duplication of the information. @targos WDYT ?
I think we should keep the duplication. I don't like very much the idea that we need to parse something to get/display information from the state.