Title: | Analyze Isotope Ratios in a 'Shiny'-App |
---|---|
Description: | Analyzing Inductively Coupled Plasma - Mass Spectrometry (ICP-MS) measurement data to evaluate isotope ratios (IRs) is a complex process. The 'IsoCor' package facilitates this process and renders it reproducible by providing a function to run a 'Shiny'-App locally in any web browser. In this App the user can upload data files of various formats, select ion traces, apply peak detection and perform calculation of IRs and delta values. Results are provided as figures and tables and can be exported. The App, therefore, facilitates data processing of ICP-MS experiments to quickly obtain optimal processing parameters compared to traditional 'Excel' worksheet based approaches. A more detailed description can be found in the corresponding article <doi:10.1039/D2JA00208F>. The most recent version of 'IsoCor' can be tested online at <https://apps.bam.de/shn00/IsoCor/>. |
Authors: | Jan Lisec [aut, cre] |
Maintainer: | Jan Lisec <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.2.9 |
Built: | 2024-11-10 02:59:19 UTC |
Source: | https://github.com/janlisec/isocor |
find_peak_boundaries
will find the start and end point
of a peak based on curve derivative.
find_peak_boundaries( int = NULL, p = which.max(int), k = 3, min_scans = 3, noise = 0 )
find_peak_boundaries( int = NULL, p = which.max(int), k = 3, min_scans = 3, noise = 0 )
int |
Numeric vector (of intensity values). |
p |
Index of peak position (usually 'which.max(int)). |
k |
Number of scans at peak boarder to confirm peak valley. |
min_scans |
Minimum number of scans in front or tail. |
noise |
A threshold value. All Values below or equal to noise will be set to zero. |
This function provides a simple detection algorithm for peak boundaries. It will accept a numeric vector as input and determine relative to the global maximum (or a user provided local maximum) the left and right border where intensity decrease ends and intensity is increasing again.
A numeric vector of length 2 giving the indexes of peak start and peak end.
## Not run: x <- sin(seq(-pi,2*pi,0.01))+1 plot(x) abline(v=find_peak_boundaries(x)) ## End(Not run)
## Not run: x <- sin(seq(-pi,2*pi,0.01))+1 plot(x) abline(v=find_peak_boundaries(x)) ## End(Not run)
ic_app
will start a shiny app that allows to upload raw
data, process selectively and analyze different methods of ratio calculation
between two intensity traces.
ic_app(...)
ic_app(...)
... |
Options passed to golem::with_golem_options. |
The app is described in detail in doi:10.1039/D2JA00208F.
A shiny app object. This will effectively launch a browser and start the app on local port 7462.
iso_ratio
will calculate a robust estimate of an
isotopic ratio between intensity values of 2 mass traces.
iso_ratio(data, method = c("PBP", "PAI", "LRS"), thr = 1)
iso_ratio(data, method = c("PBP", "PAI", "LRS"), thr = 1)
data |
data.frame with two columns specifying data for isotope 1 and 2 respectively. |
method |
Method to calculate the isotope ratio. |
thr |
Threshold between 0..1 to limit the peaks scans used in the calculation (1=all scans, 0=apex only). |
Within ic_app
we compute estimates for isotope ratios
using raw data and several processing steps. iso_ratio
is internally
used to perform this calculation and could be used in an external data
processing pipeline without the app context.
However, users would need to extract intensity vectors of isotope peaks
from raw data independently.
Note! All non-finite values and x==0 will be removed before calculation.
A single numeric value. The robust ratio estimate calculated from data
.
peak1 <- 1 + cos(x = seq(-pi, pi, length.out = 100)) peak2 <- 0.05 * peak1 * runif(n = 100, min = 1, max = 1.01) iso_ratio(data = cbind(peak1, peak2))
peak1 <- 1 + cos(x = seq(-pi, pi, length.out = 100)) peak2 <- 0.05 * peak1 * runif(n = 100, min = 1, max = 1.01) iso_ratio(data = cbind(peak1, peak2))
isotopes.
data(isotopes)
data(isotopes)
A data.frame of chemical isotopes providing mass and natural abundance.
R-package enviPat
mass_bias
will calculate a correction factor K to
scale isotopic ratios and thereby account for machine variance.
mass_bias( mi_amu = 0, si_amu = 0, method = c("Linear", "Russel", "Exponential"), f_value = 0 )
mass_bias( mi_amu = 0, si_amu = 0, method = c("Linear", "Russel", "Exponential"), f_value = 0 )
mi_amu |
atomic mass of MI isotope. |
si_amu |
atomic mass of SI isotope |
method |
Method to calculate the mass bias. |
f_value |
f_value to be used within the method calculation. |
Currently, 3 methods are available to calculate the mass bias, Linear, Russel and Exponential. They all depend on the atomic mass of the two ion traces and a f-value which can be provided as parameters to the function.
A single numeric value K to be used for scaling.
IsoCor::mass_bias(32, 34, "Linear", 0.1)
IsoCor::mass_bias(32, 34, "Linear", 0.1)
read_raw_data
will import ICP MS data in various file formats.
read_raw_data(path, format = c("exp", "icp", "data", "generic"))
read_raw_data(path, format = c("exp", "icp", "data", "generic"))
path |
Valid file path. |
format |
Character specifying the import file format. |
Try to specify 'format' parameter to find a method suitable for your files or select 'generic' which will import a tab delimited file with 3 columns defining RT, MI and SI respectively. You may check why data import of your files fails in the app on this function and potentially extend it to handle your files.
A data.frame.
str(IsoCor::read_raw_data(path = ""))
str(IsoCor::read_raw_data(path = ""))
testdata.
data(testdata)
data(testdata)
A list of 3 exp spectra files converted by read_raw_data.
testdata_IDMS.
data(testdata_IDMS)
data(testdata_IDMS)
A list of 3 txt spectra files converted by read_raw_data.