diff --git a/tools/camera/CAMERA_findAdducts.R b/tools/camera/CAMERA_findAdducts.R index 8bc022b9d..8dc3999df 100755 --- a/tools/camera/CAMERA_findAdducts.R +++ b/tools/camera/CAMERA_findAdducts.R @@ -122,7 +122,7 @@ names_custom <- groupnames(xa@xcmsSet, mzdec = args$numDigitsMZ, rtdec = args$nu # Calculate indices of the columns to include from peakList # Select all columns except the last sample-specific columns ncols <- length(colnames(peakList)) -sample_cols <- length(rownames(xdata@phenoData)) # Number of samples +sample_cols <- length(rownames(phenoData)) # Number of samples # Indices for the columns of interest main_cols <- 1:(ncols - sample_cols - 3) # Main columns before sample columns @@ -150,7 +150,7 @@ write.table(variableMetadata, file = output_file_tsv, sep = "\t", row.names = FA # Save the updated xsAnnotate object output_file_RData <- "camera_findAdducts.RData" -objects2save <- c("xa", "variableMetadata", "listOFlistArguments", "zipfile", "singlefile", "RTinMinute", "xdata@phenoData") +objects2save <- c("xa", "variableMetadata", "listOFlistArguments", "zipfile", "singlefile", "RTinMinute", "phenoData") save(list = objects2save[objects2save %in% ls()], file = output_file_RData) cat("Output files generated:", output_file_tsv, "and", output_file_RData, "\n") diff --git a/tools/camera/CAMERA_findIsotopes.R b/tools/camera/CAMERA_findIsotopes.R index 19e9d0b9a..d0e719e0d 100755 --- a/tools/camera/CAMERA_findIsotopes.R +++ b/tools/camera/CAMERA_findIsotopes.R @@ -109,7 +109,7 @@ names_custom <- groupnames(xa@xcmsSet, mzdec = args$numDigitsMZ, rtdec = args$nu # Calculate indices of the columns to include from peakList # Select all columns except the last sample-specific columns ncols <- length(colnames(peakList)) -sample_cols <- length(rownames(xdata@phenoData)) # Number of samples +sample_cols <- length(rownames(phenoData)) # Number of samples # Indices for the columns of interest main_cols <- 1:(ncols - sample_cols - 3) # Main columns before sample columns @@ -138,7 +138,7 @@ write.table(variableMetadata, file = output_file_tsv, sep = "\t", row.names = FA # Save the updated xsAnnotate object output_file_RData <- "camera_findIsotopes.RData" -objects2save <- c("xa", "variableMetadata", "listOFlistArguments", "zipfile", "singlefile", "RTinMinute", "xdata@phenoData") +objects2save <- c("xa", "variableMetadata", "listOFlistArguments", "zipfile", "singlefile", "RTinMinute", "phenoData") save(list = objects2save[objects2save %in% ls()], file = output_file_RData) cat("Output files generated:", output_file_tsv, "and", output_file_RData, "\n") diff --git a/tools/camera/CAMERA_groupCorr.R b/tools/camera/CAMERA_groupCorr.R index b38f18026..bb3c41bbb 100755 --- a/tools/camera/CAMERA_groupCorr.R +++ b/tools/camera/CAMERA_groupCorr.R @@ -81,7 +81,7 @@ names_custom <- groupnames(xa@xcmsSet, mzdec = args$numDigitsMZ, rtdec = args$nu # Calculate indices of the columns to include from peakList # Select all columns except the last sample-specific columns ncols <- length(colnames(peakList)) -sample_cols <- length(rownames(xdata@phenoData)) # Number of samples +sample_cols <- length(rownames(phenoData)) # Number of samples # Indices for the columns of interest main_cols <- 1:(ncols - sample_cols - 3) # Main columns before sample columns @@ -109,7 +109,7 @@ write.table(variableMetadata, file = output_file_tsv, sep = "\t", row.names = FA # Save the updated xsAnnotate object output_file_RData <- "camera_groupCorr.RData" -objects2save <- c("xa", "variableMetadata", "listOFlistArguments", "zipfile", "singlefile", "RTinMinute", "xdata@phenoData") +objects2save <- c("xa", "variableMetadata", "listOFlistArguments", "zipfile", "singlefile", "RTinMinute", "phenoData") save(list = objects2save[objects2save %in% ls()], file = output_file_RData) cat("Output files generated:", output_file_tsv, "and", output_file_RData, "\n") diff --git a/tools/camera/CAMERA_groupFWHM.R b/tools/camera/CAMERA_groupFWHM.R index 791dd2674..4fecaa106 100755 --- a/tools/camera/CAMERA_groupFWHM.R +++ b/tools/camera/CAMERA_groupFWHM.R @@ -71,6 +71,7 @@ if (!is.null(singlefile)) { # If the xdata object exists, convert it to xcmsSet if (exists("xdata")) { + phenoData <- xdata@phenoData xset <- getxcmsSetObject(xdata) } @@ -125,7 +126,7 @@ write.table(variableMetadata, file = output_file_tsv, sep = "\t", row.names = FA # Save the xsAnnotate object output_file_RData <- "camera_fwhm.RData" -objects2save <- c("xa", "variableMetadata", "listOFlistArguments", "zipfile", "singlefile", "RTinMinute", "xdata@phenoData") +objects2save <- c("xa", "variableMetadata", "listOFlistArguments", "zipfile", "singlefile", "RTinMinute", "phenoData") save(list = objects2save[objects2save %in% ls()], file = output_file_RData) cat("Output files generated:", output_file_tsv, "and", output_file_RData, "\n")