rformassspectrometry / Spectra

Low level infrastructure to handle MS spectra
https://rformassspectrometry.github.io/Spectra/
34 stars 24 forks source link

Ms backend cached #231

Closed jorainer closed 2 years ago

jorainer commented 2 years ago

This PR adds a MsBackend that provides a caching mechanism allowing to add or modify spectra variables of a read-only MsBackend. Spectra variable setter methods add values to a local slot with a data.frame, accessor methods first evaluate if a variable is available in the local cache and in case returns that.

Database-backed MsBackends can extend this MsBackendCached instead of the MsBackend to have the caching mechanism available. Prime examples that can immediately use this backend are the MsBackendMassbankSql and the MsBackendCompDb.