annotate_masses: Annotate masses

View source: R/annotate_masses.R

annotate_massesR Documentation

Annotate masses

Description

This function annotates a feature table based on exact mass match. It requires a structural library, its metadata, and lists of adducts, clusters, and neutral losses to be considered. The polarity has to be pos or neg and retention time and mass tolerances should be given. The feature table is expected to be pre-formatted.

Usage

annotate_masses(
  features = get_params(step = "annotate_masses")$files$features$prepared,
  output_annotations = get_params(step =
    "annotate_masses")$files$annotations$prepared$structural$ms1,
  output_edges = get_params(step = "annotate_masses")$files$networks$spectral$edges$raw,
  name_source = get_params(step = "annotate_masses")$names$source,
  name_target = get_params(step = "annotate_masses")$names$target,
  library = get_params(step = "annotate_masses")$files$libraries$sop$merged$keys,
  str_stereo = get_params(step =
    "annotate_masses")$files$libraries$sop$merged$structures$stereo,
  str_met = get_params(step =
    "annotate_masses")$files$libraries$sop$merged$structures$metadata,
  str_nam = get_params(step =
    "annotate_masses")$files$libraries$sop$merged$structures$names,
  str_tax_cla = get_params(step =
    "annotate_masses")$files$libraries$sop$merged$structures$taxonomies$cla,
  str_tax_npc = get_params(step =
    "annotate_masses")$files$libraries$sop$merged$structures$taxonomies$npc,
  adducts_list = get_params(step = "annotate_masses")$ms$adducts,
  clusters_list = get_params(step = "annotate_masses")$ms$clusters,
  neutral_losses_list = get_params(step = "annotate_masses")$ms$neutral_losses,
  ms_mode = get_params(step = "annotate_masses")$ms$polarity,
  tolerance_ppm = get_params(step = "annotate_masses")$ms$tolerances$mass$ppm$ms1,
  tolerance_rt = get_params(step = "annotate_masses")$ms$tolerances$rt$adducts
)

Arguments

features

Table containing your previous annotation to complement

output_annotations

Output for mass based structural annotations

output_edges

Output for mass based edges

name_source

Name of the source features column

name_target

Name of the target features column

library

Library containing the keys

str_stereo

File containing structures stereo

str_met

File containing structures metadata

str_nam

File containing structures names

str_tax_cla

File containing Classyfire taxonomy

str_tax_npc

File containing NPClassifier taxonomy

adducts_list

List of adducts to be used

clusters_list

List of clusters to be used

neutral_losses_list

List of neutral losses to be used

ms_mode

Ionization mode. Must be 'pos' or 'neg'

tolerance_ppm

Tolerance to perform annotation. Should be <= 20 ppm

tolerance_rt

Tolerance to group adducts. Should be <= 0.05 minutes

Value

The path to the files containing MS1 annotations and edges

Examples

## Not run: 
tima:::copy_backbone()
go_to_cache()
github <- "https://raw.githubusercontent.com/"
repo <- "taxonomicallyinformedannotation/tima-example-files/main/"
data_interim <- "data/interim/"
dir <- paste0(github, repo)
dir <- paste0(dir, data_interim)
annotate_masses(
  features = paste0(dir, "features/example_features.tsv"),
  library = paste0(dir, "libraries/sop/merged/keys.tsv"),
  str_stereo = paste0(dir, "libraries/sop/merged/structures/stereo.tsv"),
  str_met = paste0(dir, "libraries/sop/merged/structures/metadata.tsv"),
  str_nam = paste0(dir, "libraries/sop/merged/structures/names.tsv"),
  str_tax_cla = paste0(dir, "libraries/sop/merged/structures/taxonomies/classyfire.tsv"),
  str_tax_npc = paste0(dir, "libraries/sop/merged/structures/taxonomies/npc.tsv")
)
unlink("data", recursive = TRUE)

## End(Not run)

taxonomicallyinformedannotation/tima-r documentation built on Dec. 20, 2024, 9:32 a.m.