orbi_calculate_summarized_ratio {isoorbi} | R Documentation |
Calculate isotopocule ratio
Description
This function calculates the ratio of two isotopocules (the numerator
and denominator
). This function averages multiple measurements of each using the ratio_method
and returns a single value. Normally this function is not called directly by the user, but via the function orbi_summarize_results()
, which calculates isotopocule ratios and other results for an entire dataset.
Usage
orbi_calculate_summarized_ratio(
numerator,
denominator,
ratio_method = c("direct", "mean", "sum", "median", "geometric_mean", "slope",
"weighted_sum")
)
Arguments
numerator |
Column(s) used as numerator; contains ion counts |
denominator |
Column used as denominator; contains ion counts |
ratio_method |
Method for computing the ratio. Please note well: the formula used to calculate ion ratios matters! Do not simply use arithmetic mean. The best option may depend on the type of data you are processing (e.g., MS1 versus M+1 fragmentation).
|
Value
Single value ratio between the isotopocules defined as numerator
and denominator
calculated using the ratio_method
.
Examples
df <-
system.file("extdata", "testfile_flow.isox", package = "isoorbi") |>
orbi_read_isox()
ions_18O <- dplyr::filter(df, isotopocule == "18O")$ions.incremental
ions_M0 <- dplyr::filter(df, isotopocule == "M0")$ions.incremental
orbi_calculate_summarized_ratio(
numerator = ions_18O, denominator = ions_M0, ratio_method = "sum"
)
orbi_calculate_summarized_ratio(
numerator = ions_18O, denominator = ions_M0, ratio_method = "slope"
)