Skip to content

Commit

Permalink
fix: phenoData
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienCode404 committed Nov 5, 2024
1 parent 96d4228 commit b16ecf1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tools/camera/CAMERA_findAdducts.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
4 changes: 2 additions & 2 deletions tools/camera/CAMERA_findIsotopes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
4 changes: 2 additions & 2 deletions tools/camera/CAMERA_groupCorr.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
3 changes: 2 additions & 1 deletion tools/camera/CAMERA_groupFWHM.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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")

0 comments on commit b16ecf1

Please sign in to comment.