cluster_spectra: Cluster Spectra Takes a grouped tibble of scan data, clusters...

View source: R/cluster_spectra.R

cluster_spectraR Documentation

Cluster Spectra Takes a grouped tibble of scan data, clusters scans based on a cosine threshold, returns the same tibble with a cluster index.

Description

Cluster Spectra Takes a grouped tibble of scan data, clusters scans based on a cosine threshold, returns the same tibble with a cluster index.

Usage

cluster_spectra(spectra, thres_cos, thres_pks = 2, x = "mz", bin, cores = 1)

Arguments

spectra

Grouped tibble mz/wl and intensity. Should be grouped by scan.

thres_cos

Min allowable cosine score for scans to cluster

thres_pks

Min allowable number of matched peaks

x

Name of x-axis variable (mz or wl, etc.)

Value

Input tibble with clust_id column added

Examples

spectra_clustered <- spectra %>%
  group_by(scan, file) %>%
  cluster_spectra(thres_cos = 0.95)


octopode/tidychrom documentation built on Nov. 2, 2022, 1:32 a.m.