Open tsufz opened 5 years ago
Can you please clarify … do you mean that you want to exclude empty record fields during record creation? I.e. the PUBLICATION: field is taken from the settings but if empty, is currently included in the final MassBank records anyway? Is that what you mean? https://github.com/MassBank/RMassBank/blob/master/inst/RMB_options.ini#L41
We do not yet have a project tag implemented, as far as I know. Are there any other fields that are empty? As far as I am aware, it’s only (possibly) the publication one – unless people have not filled out their settings correctly. What happens if you just remove that publication field from your settings file? (if it works that’s the easiest solution!)
I work on the implemenation and also of implemantion of the project tag #194
I believe that the better solution is to modularize the annotations
tag in the settings. Cf.
Here, we should instead just do
ac_ms <- getOption("RMassBank")$annotations$MASS_SPECTROMETRY
ac_lc <- getOption("RMassBank")$annotations$CHROMATOGRAPHY
plus fill in the retention time and mode. Note that we could move anything compound-specific to .buildRecord.RmbSpectrum2
and pull only settings data here. I think this would be cleaner.
We should then convert legacy settings files on loading them:
This would need to copy $annotations$lc_column
to $annotations$CHROMATOGRAPHY$COLUMN_NAME
, etc etc
We can also discuss whether we should allow completely arbitrary tags from the settings file, not only AC$MASS_SPECTROMETRY and AC$CHROMATOGRAPHY. This would remove the need for some Treutler fixes. We only need to substitute the dollar, inconveniently.
We only need to substitute the dollar, inconveniently.
We don't really need to. Hendrik already used dollars in the settings file and it's fine.
Then in .buildRecord.RmbSpectrum2
:
annotations
passed, not ac_lc, ac_ms
annotations
, fill in compound-specific datatoMassbank
: Make sure the order of tags is correct as specified in the record format. I would prefer to do the ordering only in toMassbank
because then we can be sure everything is in there. (Right now we just add the entries in the correct order)
Add a structure to the record parser to parse only filled tags. Some tags such as publication and project may be not filled and thus doen't need to be parsed into the final record in order avoid post-processing.