diff --git a/tools/camera/CAMERA_findAdducts.R b/tools/camera/CAMERA_findAdducts.R index 5b1866c5a..ee6675150 100755 --- a/tools/camera/CAMERA_findAdducts.R +++ b/tools/camera/CAMERA_findAdducts.R @@ -125,16 +125,18 @@ ncols <- length(colnames(peakList)) sample_cols <- length(rownames(xdata@phenoData)) # Number of samples # Indices for the columns of interest -main_cols <- 1:(ncols - sample_cols) # Main columns before sample columns +main_cols <- 1:(ncols - sample_cols - 3) # Main columns before sample columns tail_cols <- (ncols - 2):ncols # The last 3 columns (adduct, isotope, pcgroup) # Combine the selected columns from matgrp with the group names variableMetadata <- cbind( name = names_default, name_custom = names_custom, - peakList[, c(main_cols, tail_cols)] + stringsAsFactors = FALSE ) +variableMetadata <- cbind(variableMetadata, peakList[, c(main_cols, tail_cols)]) + if (!exists("RTinMinute")) RTinMinute <- FALSE if (args$convertRTMinute && RTinMinute == FALSE) { diff --git a/tools/camera/CAMERA_findIsotopes.R b/tools/camera/CAMERA_findIsotopes.R index 351babe3d..44d4f2c2a 100755 --- a/tools/camera/CAMERA_findIsotopes.R +++ b/tools/camera/CAMERA_findIsotopes.R @@ -112,16 +112,18 @@ ncols <- length(colnames(peakList)) sample_cols <- length(rownames(xdata@phenoData)) # Number of samples # Indices for the columns of interest -main_cols <- 1:(ncols - sample_cols) # Main columns before sample columns +main_cols <- 1:(ncols - sample_cols - 3) # Main columns before sample columns tail_cols <- (ncols - 2):ncols # The last 3 columns (adduct, isotope, pcgroup) # Combine the selected columns from matgrp with the group names variableMetadata <- cbind( name = names_default, name_custom = names_custom, - peakList[, c(main_cols, tail_cols)] + stringsAsFactors = FALSE ) +variableMetadata <- cbind(variableMetadata, peakList[, c(main_cols, tail_cols)]) + if (!exists("RTinMinute")) RTinMinute <- FALSE if (args$convertRTMinute && RTinMinute == FALSE) { diff --git a/tools/camera/CAMERA_groupCorr.R b/tools/camera/CAMERA_groupCorr.R index 58e1a6d56..a5ab01ec7 100755 --- a/tools/camera/CAMERA_groupCorr.R +++ b/tools/camera/CAMERA_groupCorr.R @@ -84,16 +84,18 @@ ncols <- length(colnames(peakList)) sample_cols <- length(rownames(xdata@phenoData)) # Number of samples # Indices for the columns of interest -main_cols <- 1:(ncols - sample_cols) # Main columns before sample columns +main_cols <- 1:(ncols - sample_cols - 3) # Main columns before sample columns tail_cols <- (ncols - 2):ncols # The last 3 columns (adduct, isotope, pcgroup) # Combine the selected columns from matgrp with the group names variableMetadata <- cbind( name = names_default, name_custom = names_custom, - peakList[, c(main_cols, tail_cols)] + stringsAsFactors = FALSE ) +variableMetadata <- cbind(variableMetadata, peakList[, c(main_cols, tail_cols)]) + if (!exists("RTinMinute")) RTinMinute <- FALSE if (args$convertRTMinute == TRUE && RTinMinute == FALSE) { diff --git a/tools/camera/CAMERA_groupFWHM.R b/tools/camera/CAMERA_groupFWHM.R index 8103150a4..3957c12a2 100755 --- a/tools/camera/CAMERA_groupFWHM.R +++ b/tools/camera/CAMERA_groupFWHM.R @@ -87,16 +87,18 @@ ncols <- length(colnames(peakList)) sample_cols <- length(rownames(xdata@phenoData)) # Number of samples # Indices for the columns of interest -main_cols <- 1:(ncols - sample_cols) # Main columns before sample columns +main_cols <- 1:(ncols - sample_cols - 3) # Main columns before sample columns tail_cols <- (ncols - 2):ncols # The last 3 columns (adduct, isotope, pcgroup) # Combine the selected columns from matgrp with the group names variableMetadata <- cbind( name = names_default, name_custom = names_custom, - peakList[, c(main_cols, tail_cols)] + stringsAsFactors = FALSE ) +variableMetadata <- cbind(variableMetadata, peakList[, c(main_cols, tail_cols)]) + if (!exists("RTinMinute")) RTinMinute <- FALSE if (args$convertRTMinute && RTinMinute == FALSE) {