calculate_unweighted_entropy_similarity: Unweighted entropy similarity between two spectra

View source: R/RcppExports.R

calculate_unweighted_entropy_similarityR Documentation

Unweighted entropy similarity between two spectra

Description

Calculate the unweighted entropy similarity between two spectra

Usage

calculate_unweighted_entropy_similarity(
  peaks_a,
  peaks_b,
  ms2_tolerance_in_da,
  ms2_tolerance_in_ppm,
  clean_spectra,
  min_mz,
  max_mz,
  noise_threshold,
  max_peak_num
)

Arguments

peaks_a

A matrix of spectral peaks, with two columns: mz and intensity

peaks_b

A matrix of spectral peaks, with two columns: mz and intensity

ms2_tolerance_in_da

The MS2 tolerance in Da, set to -1 to disable

ms2_tolerance_in_ppm

The MS2 tolerance in ppm, set to -1 to disable

clean_spectra

Whether to clean the spectra before calculating the entropy similarity, see clean_spectrum

min_mz

The minimum mz value to keep, set to -1 to disable

max_mz

The maximum mz value to keep, set to -1 to disable

noise_threshold

The noise threshold, set to -1 to disable, all peaks have intensity < noise_threshold * max_intensity will be removed

max_peak_num

The maximum number of peaks to keep, set to -1 to disable

Value

The unweighted entropy similarity

Examples

mz_a <- c(169.071, 186.066, 186.0769)
intensity_a <- c(7.917962, 1.021589, 100.0)
mz_b <- c(120.212, 169.071, 186.066)
intensity_b <- c(37.16, 66.83, 999.0)
peaks_a <- matrix(c(mz_a, intensity_a), ncol = 2, byrow = FALSE)
peaks_b <- matrix(c(mz_b, intensity_b), ncol = 2, byrow = FALSE)
calculate_unweighted_entropy_similarity(peaks_a, peaks_b,
                                       ms2_tolerance_in_da = 0.02, ms2_tolerance_in_ppm = -1,
                                       clean_spectra = TRUE, min_mz = 0, max_mz = 1000,
                                       noise_threshold = 0.01,
                                       max_peak_num = 100)


msentropy documentation built on Aug. 8, 2023, 1:10 a.m.