From 7c9e7d390e181445d48a05f2c3aa80d9f94e978b Mon Sep 17 00:00:00 2001 From: Philippine Louail <127301965+philouail@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:32:54 +0100 Subject: [PATCH] fix: .rt_model only use 2 columns instead of all --- R/do_adjustRtime-functions.R | 2 +- vignettes/xcms.Rmd | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/R/do_adjustRtime-functions.R b/R/do_adjustRtime-functions.R index 1fe5282c..b432daf2 100644 --- a/R/do_adjustRtime-functions.R +++ b/R/do_adjustRtime-functions.R @@ -874,7 +874,7 @@ NULL resid_ratio = 3, zero_weight = 10, bs = "tp"){ - rt_map <- rt_map[order(rt_map$obs), ] + rt_map <- rt_map[order(rt_map$obs), c("ref", "obs")] # add first row of c(0,0) to set a fix timepoint. rt_map <- rbind(c(0,0), rt_map) weights <- rep(1, nrow(rt_map)) diff --git a/vignettes/xcms.Rmd b/vignettes/xcms.Rmd index 0382314b..02abbe13 100644 --- a/vignettes/xcms.Rmd +++ b/vignettes/xcms.Rmd @@ -1203,17 +1203,13 @@ f[f != "QC"] <- NA f <- sampleData(faahko)$sample_type f[f == "QC"] <- NA -missing_filter <- PercentMissingFilter(threshold = 30, - f = f) +missing_filter <- PercentMissingFilter(threshold = 30, f = f) # Apply the filter to faakho object -filtered_faahko <- filterFeatures(object = faahko, - filter = missing_filter) +filtered_faahko <- filterFeatures(object = faahko, filter = missing_filter) # Apply the filter to res object -missing_filter <- PercentMissingFilter(threshold = 30, - f = f) -filtered_res <- filterFeatures(object = res, - filter = missing_filter) +missing_filter <- PercentMissingFilter(threshold = 30, f = f) +filtered_res <- filterFeatures(object = res, filter = missing_filter) ``` Here, no feature was removed, meaning that all the features had less than 30%