Skip to content

Commit

Permalink
Update MsExperiment.R
Browse files Browse the repository at this point in the history
  • Loading branch information
philouail committed Sep 23, 2024
1 parent 5b887ff commit e0c4a9d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/MsExperiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,17 @@ setMethod("readMsObject",

## sample to spectra link
fl <- object@spectra@backend@spectraData[1, "derived_spectral_data_file"]
nme <- colnames(merged_data)[which(merged_data[1, ] == fl)]
idx <- which(merged_data[1, ,drop = TRUE] == fl)
nme <- colnames(merged_data)[idx]
merged_data <- merged_data[grepl(param@filePattern,
merged_data[, nme]), ]
nme <- gsub(" ", "_", nme) #use concatenate instead ?
nme <- gsub(" ", "_", nme)
colnames(merged_data)[idx] <- nme
object@sampleData <- DataFrame(merged_data, check.names = FALSE)
object <- MsExperiment::linkSampleData(object,
with = paste0("sampleData.",
nme,
"= spectra.derived_spectral_data_file"))
"= spectra.derived_spectral_data_file"))
validObject(object)
object
})
Expand Down

0 comments on commit e0c4a9d

Please sign in to comment.