Closed jmorim closed 1 week ago
The hacky way i worked around it was for xcmsSet objects:
test.xcmsSet@xcmsSet@filepaths = paste0('./_mzML/', list.files('_mzML/'))[6:20]
and for XcmsExperiment objects
attr(test.XcmsExperiment, 'sampleData')$spectraOrigin = paste0('./_mzML/', list.files('_mzML')[6:20])
oh yes, that's indeed something needed... am just pinging also @philouail because she's also working on something related.
With Spectra version 1.15.2 we have now a dataStorageBasePath()
function that allows to get or set the path of the base directory containing the data files.
so, you could first load your MsExperiment/XcmsExperiment
object.
## List the *common* base path of the data storage files
dataStorageBasePath(spectra(xmse))
## You can update/change the path with
dataStorageBasePath(xmse@spectra) <- "new path"
You would need to install Spectra from the current devel branch (BiocManager::install("RforMassSpectrometry/Spectra")
), also, it needs the most recent MsCoreUtils version (from Bioconductor release 3.19).
let me know if something is not working.
Is there a way to set the file paths in an XcmsExperiment object? I do peak picking and grouping on an HPC and the stats locally, but sometimes I get an error because the data filepath gets saved as the path on the cluster. Something like
fileNames(xcms.experiment) <- rep('/path', n.samples)