From dcc740013101a6a99e6ff7d22b3f2466c9308e77 Mon Sep 17 00:00:00 2001 From: Rasmus Hammar Date: Tue, 17 Oct 2023 16:49:33 +0200 Subject: [PATCH] Fixed mass balance 10.2.5 --- R/Fic.R | 7 ++++--- R/Fic_workflow.R | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/R/Fic.R b/R/Fic.R index bce8682..5512cd2 100644 --- a/R/Fic.R +++ b/R/Fic.R @@ -737,10 +737,11 @@ ras.Fu_feces_mass_balance_10.2.5 <- function(df_calc, Homogenate = "Hom_Conc._avg", Dilution_factor = 4.8, Buffer = "Buffer_Con._avg", - Stab = "Stab_Conc._avg") { + Stab = "Stab_Conc._avg", + mass_factor = 1.75) { df_calc <- df_calc %>% dplyr::mutate(Mass_balance_10.2.5 = - (.data[[Homogenate]]*Dilution_factor +.data[[Buffer]]*1.75) - / .data[[Stab]] ) + (.data[[Homogenate]]*Dilution_factor +.data[[Buffer]]*mass_factor) + / .data[[Stab]] ) return(df_calc) } diff --git a/R/Fic_workflow.R b/R/Fic_workflow.R index 3d964be..9e07d3a 100644 --- a/R/Fic_workflow.R +++ b/R/Fic_workflow.R @@ -186,7 +186,7 @@ ras.Fic_workflow <- function( Dilution_factor = {{name_dilution}}, Buffer = {{name_buffer}}, Stab = {{name_stab}}, - mass_factor = MassBalance_2.5,) + mass_factor = MassBalance_2.5) df_calc <- df_calc %>% ras.Fic_A.cell(Cell = {{name_cell}}) df_calc <- df_calc %>% @@ -255,7 +255,7 @@ ras.Fu_feces_workflow <- function( stab = "Stab", czero = "Czero", D = 4.8, - MassBalance_2.5 = 1.75 + MassBalance_2.5 = 1.75, .compound = "Analyte Peak Name", .checkValues = TRUE, .summarize = TRUE,