score_fragmentation_similarity.Rd
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
)
a tibble of experimental fragmentation spectra data for a single ion/energy.
a tibble of standard fragmentation spectra data for a single ion/energy.
the instrument mass accuracy tolerance for the purpose of fragment grouping - format_mass_accuracy_input
, normally passed from a build_clamr_config
object.
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.
Should the precursor mass be removed before matching spectra?
A value between 0 and 1 indicating for a given peak the fraction of total signal for it to be used for matching.
Should a summary plot be printed?
a tibble containing frag_similarity_method and method_score for this match.