ClavelLab / maldipickr

Dereplicate And Cherry-pick Mass Spectrometry Spectra
https://clavellab.github.io/maldipickr/
GNU General Public License v3.0
2 stars 0 forks source link

error non-unique values when setting 'row.names' in `process_spectra()` #37

Closed cpauvert closed 9 months ago

cpauvert commented 9 months ago

this error can happen when multiple spectra have the same name, which should not happen with proper research data input but can arise during data analyses.

At the moment, the function stops. An improvement would be to exit gracefully at least, or provide a solution (would make.unique() be possible or too intrusive?)

cpauvert commented 9 months ago

I see two possibilities:

  1. allow a list of names to be passed to process_spectra() instead of using the fullName metadata as the fullName might not be always the most relevant name
  2. have an extra function that create a tibble of putative names (based on fullName), check for uniqueness, and can be passed on to the process_spectra()

Option 1

Option 2

process_spectra(spectra_list, names = get_spectra_names(spectra_list))