Score a single possible ion match based on the agreement of an experimental and standard spectra.

score_fragmentation_similarity(
  an_expFrag,
  a_stdFrag,
  MS2tol,
  frag_similarity_methods = "cosine",
  remove_precursor = FALSE,
  minimum_ic_fraction = 0,
  print_plot = FALSE
)

Arguments

an_expFrag

a tibble of experimental fragmentation spectra data for a single ion/energy.

a_stdFrag

a tibble of standard fragmentation spectra data for a single ion/energy.

MS2tol

the instrument mass accuracy tolerance for the purpose of fragment grouping - format_mass_accuracy_input, normally passed from a build_clamr_config object.

frag_similarity_methods

a character vector of methods to use for fragmentation scoring:

  • tic: fraction of experimental signal explained by standard fragments.

  • fisher: fisher exact test to look at overlap between experimental and standard fragments.

  • spearman: spearman correlation between experimental and standard fragments.

  • cosine: the cosine similarity between mz-matched ions of the standard and experimental spectra.

  • robust cosine: calculate the cosine similarity when separately dropping out each fragment - then take the worst cosine similarity among them. Identifies cases where a match score is driven by a single fragment.

remove_precursor

Should the precursor mass be removed before matching spectra?

minimum_ic_fraction

A value between 0 and 1 indicating for a given peak the fraction of total signal for it to be used for matching.

print_plot

Should a summary plot be printed?

Value

a tibble containing frag_similarity_method and method_score for this match.