This function applies a very simple background correction based on the cup 54 intensity and an input scaling factor.
correct_backgrounds(
.data,
factor,
...,
i47 = v47.mV,
i54 = v54.mV,
quiet = default(quiet)
)
The dataframe with raw iso files.
Factor by which to multiply the half-cup before subtraction.
These dots are for future extensions and must be empty.
Column with mass 47 intensities to correct. Defaults to v47.mV
.
Column with mass 47.5 intensities to use for correction. Defaults to v54.mV
.
If TRUE
, print info messages. If NULL
(default) listens to options(clumpedr.quiet)
Same as .data
but with altered i47 column.
# generate some fake data
dat <- tibble::tibble(v47.mV = seq(0, 1, length.out = 10), v54.mV = seq(.1, 0, length.out = 10))
# correct the mass 47 using the half-cup
dat <- dat |> correct_backgrounds(factor = 1)
#> Info: adding background based on half-mass with factor 1
# or use the example data included
isoreader::iso_get_raw_data(standards) |>
correct_backgrounds(1.1)
#> Info: adding background based on half-mass with factor 1.1
#> Info: aggregating raw data from 27 data file(s)
#> # A tibble: 2,187 × 10
#> file_id type cycle v44.mV v45.mV v46.mV v47.mV v48.mV v49.mV v54.mV
#> <chr> <chr> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 180814_75_IAM_1… stan… 0 16647. 19675. 23072. 25961. 2124. -268. -270.
#> 2 180814_75_IAM_1… stan… 1 16406. 19391. 22738. 25585. 2094. -264. -265.
#> 3 180814_75_IAM_1… stan… 2 16153. 19091. 22387. 25186. 2062. -259. -261.
#> 4 180814_75_IAM_1… stan… 3 15891. 18782. 22024. 24785. 2029. -255. -257.
#> 5 180814_75_IAM_1… stan… 4 15631. 18476. 21665. 24378. 1997. -250. -252.
#> 6 180814_75_IAM_1… stan… 5 15383. 18182. 21321. 23991. 1964. -246. -249.
#> 7 180814_75_IAM_1… stan… 6 15135. 17889. 20978. 23605. 1934. -241. -244.
#> 8 180814_75_IAM_1… stan… 7 14892. 17603. 20641. 23223. 1903. -237. -240.
#> 9 180814_75_IAM_1… stan… 8 14656. 17323. 20313. 22860. 1873. -234. -236.
#> 10 180814_75_IAM_1… stan… 9 14422. 17047. 19990. 22490. 1844. -229. -232.
#> # ℹ 2,177 more rows