Skip to content

Commit

Permalink
fix: get_peaktable new bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbass committed Dec 11, 2023
1 parent 357fdf5 commit 25d7d14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/get_peaktable.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@ get_peaktable <- function(peak_list, chrom_list, response = c("area", "height"),
sing <- which(pkcenters.cl == 0)
pkcenters.cl[sing] <- max(pkcenters.cl) + seq_along(sing)
}
vars <- c(rt, "start", "end", "sd", "tau", "FWHM", "r.squared", "purity")
vars <- c(rt, "start", "end", "sd", "width", "tau", "FWHM", "r.squared", "purity")
vars <- vars[vars %in% colnames(xx)]
vars.idx <- match(vars, colnames(xx))
cl.centers <- aggregate(xx[, vars.idx], by = list(pkcenters.cl), FUN = "mean",
na.action = "na.pass")[, -1]
na.action = "na.pass")[, -1, drop = FALSE]
ncl <- length(cl.centers[, rt])

## re-order clusters from small to large rt
Expand All @@ -179,10 +180,11 @@ get_peaktable <- function(peak_list, chrom_list, response = c("area", "height"),
panel.abline(v = cl.centers[,rt], col = mycols)
}))
}
if (verbose & max(clusCount <- table(file.idx, pkcenters.cl)) > 1)
if (verbose & max(clusCount <- table(file.idx, pkcenters.cl)) > 1){
warning(paste("More than one peak of one injection in the same cluster",
paste("for component ", comp, ".", sep = ""),
"Keeping only the most intense one.", "", sep = "\n"))
}
allIs <- unlist(lapply(pkLst, function(samp) samp[[comp]][, response]))
Iinfo <- matrix(0, ncl, length(pkLst), dimnames = list(NULL, names(pkLst)))
for (i in seq(along = allIs)){
Expand Down

0 comments on commit 25d7d14

Please sign in to comment.