saxeyCor: Create a Corrected 2D correlation histogram

View source: R/rapt_multi.R

saxeyCorR Documentation

Create a Corrected 2D correlation histogram

Description

saxeyCor creates a 2D correlation histogram, similar to that of saxeyPlot However, saxeyCor differs in that it offers various normalization options. This is the "correlation table" referred to in section 2.1 of Saxey, D. W. (2011).

Usage

saxeyCor(
  ind,
  ato,
  begin,
  end,
  res = 0.5,
  plot.it = TRUE,
  expected = "DOUBLE",
  log = FALSE,
  remove_diagonal = FALSE,
  remove_double = FALSE,
  remove_diagonal_width = 0,
  remove_double_width = 0,
  expected_remove_threshold = NA,
  ...
)

Arguments

ind

A vector of first hit indices for double hits. The list generated by indexMultiples has this vector as its second entry.

ato

An ATO data frame. This data frame is generated by readATO.

begin

A numeric. The starting mass value of the correlation histogram

end

A numeric. The ending mass value of the correlation histogram

plot.it

A logical scalar. Should the result be plotted?

expected

either "DOUBLE", "TOTAL", or FALSE. Determines which method of normalization to use. If "DOUBLE" then e_ij and N are calculated using double hits. If "TOTAL" then e_ij and N are calculated using all hits. If FALSE, no normalization is done and simply pair hits, p_ij, are returned

log

a logical. Should the log of the results be plotted?

remove_diagonal

a logical. Should the diagonal (y = x) be removed? This effectively removes values of p_ii/d_ii

remove_double

a logical. Should the "double diagonal" lines (y = 2x and y = 1/2x) be removed?

remove_double_width

an integer. If remove_double_width is true, this will remove remove_double_width additional pixels from each side of the double (y = 2x, y = 1/2x) lines

expected_remove_threshold

A numeric. Will remove all pixels whose expectation values e_ij are less than this threshold

...

extra input to be added to image.plot function

res.

A numeric. The bin width of the correlation histogram

remove_diagona_width

an integer. If remove_diagonal is true, this will remove remove_diagonal_width additional pixels from each side of the diagonal line, to account for lower resolution in the mass spectrum

Details

This is used to reproduce plots made in of Saxey, D. W. (2011). If expected = FALSE, then the uncorrected correlation histograms shown in Figure 3 of Saxey, D. W. (2011), are produced. If expected = "DOUBLE", then the calculations will follow equations 2.1-2.3 and d_ij will be plotted. #' If expected = "TOTAL", then the calculations will follow equations 2.1-2.3, except expectation values e_ij are calculated using all hits, not just double hits

References

Saxey, D. W. (2011). Correlated ion analysis and the interpretation of atom probe mass spectra. Ultramicroscopy, 111(6), 473-479. https://doi.org/10.1016/j.ultramic.2010.11.021.

See Also

indexMultiples, ash2


aproudian2/rapt documentation built on Dec. 15, 2022, 4:24 a.m.