From bae5821c76073983abbaef43278811128f5a94b3 Mon Sep 17 00:00:00 2001 From: Ethan Bass Date: Sat, 16 Nov 2024 22:21:10 -0500 Subject: [PATCH] feat: include wavelength and retention time information in long tables --- NEWS.md | 5 +++++ R/reshape_chroms.R | 4 +++- data/pk_tab.RData | Bin 3532 -> 4122 bytes tests/testthat/test-utility-functions.R | 4 ++-- vignettes/articles/fid_article.bib | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 40d4ff2a..87d1cca8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +#chromatographR 0.7.3 + +* Updated `reshape_peaktable` function to include wavelength and retention time data. +* Updated `pk_tab` data file to latest peak table format. + # chromatographR 0.7.2 * Export `get_times` and `get_lambdas` functions. diff --git a/R/reshape_chroms.R b/R/reshape_chroms.R index ab756207..792ee83d 100644 --- a/R/reshape_chroms.R +++ b/R/reshape_chroms.R @@ -99,7 +99,9 @@ reshape_peaktable <- function(x, peaks, metadata, fixed_levels = TRUE){ times = colnames(df), timevar = "peak", idvar = "sample", ids = rownames(df)) rownames(xx) <- NULL - xx <- xx[,c(3,1,2)] + xx <- merge(xx, data.frame(peak=colnames(x$pk_meta), t(x$pk_meta[c("lambda","rt"),])), + by="peak",all.x=TRUE) + xx <- xx[, c(1, 3, 4, 5, 2)] if (!is.null(dim(x$sample_meta))){ xx <- merge(xx, data.frame(sample = row.names(df), x$sample_meta), by = "sample", all.x = TRUE) diff --git a/data/pk_tab.RData b/data/pk_tab.RData index cab65079403aa1f0c95a58f887478f16dfb9a4c7..233b46cd34cacb463febd519e497edc8386ce25d 100644 GIT binary patch literal 4122 zcmZveXEYm%|Hjd(s$Dd-t5oe=d(^0+iry-vHn&oOnzctzY85qOR_s+`g z2-l355s~2E-~aV}&i8!Yea~~AbDkFuU)*hq|JRLuivTlYoo07RLl0C~4-a6wlqK7S zg}vIykUN6Y-s(1|OTDXMdU`K)5hnfq`nKRP%#Z~zps1WI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