knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  warning = FALSE
)

Reading Raw Ion Count Data

The read functions are currently only supported for data generated by a Cameca NanoSIMS 50L. Raw ion count data and accompanying metadata is extracted and collated into a single tibble from text files with the extensions .is_txt, .chk_is and .stat, respectively. These files can usually be found in a single directory, which often constitute the analysis on a series of spots.

Nomenclature

library(point) # load package

The following packages are used in the examples that follow.

library(dplyr) # manipulating data
library(ggplot2) # plot
library(polyaAeppli) # Polya-Aeppli distribution
library(purrr) # functional programming
library(tidyr) # tidyr data

Example dataset

One example dataset is bundled with this package: 2018-01-19-GLENDON.

The dataset is generated with the Cameca NanoSIMS 50L at the Department of Earth Sciences at Utrecht University. The suffix GLENDON stands for glendonite an authigenic calcium carbonate seafloor precipitate. The excerpt included here contains an in-house reference (a belemnite rostra) which was used to check repeatability/external reproducibility. Ion detection for 7 individual species was performed solely with electron multipliers (EM) with the main purpose of producing stable carbon isotope ratios (^13^C/^12^C).

The example directories can be accessed with the function point_example().

# Use point_example() to access the examples bundled with this package 
# If path is 'NULL', the example directories will be listed
point_example()
# Accessing the example directory 2018-01-19-GLENDON
point_example("2018-01-19-GLENDON")

Extracting raw ion count data and associated metadata

The function read_IC() takes a character string indicating the directory file name. It further enables selecting the extraction of associated metadata by setting the argument meta = TRUE (default), and this metadata can be include as an attribute with argument hide = TRUE (default) or as additional columns hide = FALSE. This has the added bonus that it provides consistency checks between metadata that generate easily interpretable warnings.

(tb_rw <- read_IC(point_example("2018-01-19-GLENDON"), meta = TRUE))

This generates a tibble which includes;

Warnings signals are used to inform to inform that e.g. some metadata files have no associated data files with ion counts. These files are omitted with this argument combination call to read_IC().

The data is complemented with metadata of the associated analysis.

attr(tb_rw, "metadata")

In the case of EM usage for ion counting the metadate is complemented with;

In the case of FC usage for ion counting the metadate is complemented with;

Extracting metadata for machine performance assessment

Alternatively, one can also only extract the metadata of an analysis to, e.g., assess machine performance over a sequence of analyses. For example, one can assess the Peak Height Distribution (PHD) over a series of analyses.

tb_mt <- read_meta(point_example("2018-01-19-GLENDON"))

# The polya density distribution model to approximate PHD distributions
# install.packages("polyaAeppli")
tb_mt <- drop_na(tb_mt[[2]], M_PHD.mt, SD_PHD.mt) %>% 
  distinct(file.nm, .keep_all = TRUE) %>% 
  filter(num.mt == 1) %>%  # most high intensity counts
  mutate(PHD = map(M_PHD.mt,  ~as.integer(seq(0, 700, length = 100)))) %>%
  unnest(cols = c(PHD)) %>% 
  mutate(
    lambda = (2 * M_PHD.mt^2) / (SD_PHD.mt^2 + M_PHD.mt),
    prob = (SD_PHD.mt^2 - M_PHD.mt) / (SD_PHD.mt^2 + M_PHD.mt),
    prob = if_else(prob < 0 | prob >= 1 , NA_real_, prob),
  ) %>% 
  drop_na(lambda, prob) %>% 
  mutate(
    density = dPolyaAeppli(PHD, lambda = lambda, prob = prob),
    Y = pPolyaAeppli(50, lambda = lambda, prob = prob, lower.tail = FALSE)
  ) 

# Plot of PHD over analysis sequence
ggplot(tb_mt, aes(x = PHD, y = density)) +
  geom_line() +
  geom_text(
    aes(
      x = 500, 
      y = max(density) * 0.8, 
      label = paste("Y = ", sprintf("%0.1f", Y))
      ),
    check_overlap = TRUE
    ) +
  facet_wrap(vars(file.nm), scales = "free") +
  theme_classic()

The compounded Polya-Aeppli density probability function can approximate the peak height distribution [@Dietz1970; @Dietz1978]. The package pPolyaAeppli [@Burden2014] together with the discriminator threshold value (usually 50 V) enables calculating the EM Yield ($Y$) (Fig. \@ref(fig:PHDexample)). More on this topic can be found in the vignette IC-process.

References



MartinSchobben/point documentation built on May 22, 2022, 7:15 a.m.