rformassspectrometry / Chromatograms

Low level infrastructure to handle chromatograms
https://rformassspectrometry.github.io/Chromatograms
1 stars 1 forks source link

`BackendInitialize()` : single data input vs chromdata and peaksdata specific input #19

Open philouail opened 3 months ago

philouail commented 3 months ago

The current method is BakcendInitialize(object, data, peaksVariable = ("rtime", "intensity")) With data being a data.frame or DataFrame combining both chromData and peaksData (the last one as lists)

Does it make sense to keep it that way ? Why don't we already require proper input of chromData as a data.frame and PeaksData as a list of data.frame ?

I think we need to see if we see any future problems related to this.

EDIT: Just want to precise this is in relation to a ChromBackendMemory implementation

jorainer commented 3 months ago

Conceptually, it would indeed make more sense to keep the chromData and peaksData separate - also as separate parameters. They are different types of data, with chromData always being one value per chromatogram and peaksData 0:n values.

I would suggest to use separate parameters, which would avoid a lot of re-formating/re-organizing of data. For now, I can not see any clear use case or reason to use a single data = DataFrame() parameter (apart from being consistent with the Spectra package).

jorainer commented 3 months ago

@lgatto @sgibb , maybe you also have some thoughts about this?

jorainer commented 3 months ago

I would go with using separate parameters for the two (rather different) types of data/information. It's a bit different than what we do in Spectra - but I was/am also not happy how I had/have to fiddle with the "common" parameter data there.