library_query: Spectral library query

View source: R/library_query.R

library_queryR Documentation

Spectral library query

Description

The function queries the input (reference) spectral library based on a query expression and/or (a) query MS/MS spectra or query library or LC-MS/MS file

Usage

library_query(
  input_library = NULL,
  query_ids = NULL,
  query_expression = "",
  query_spectrum = NULL,
  query_library = NULL,
  params.search = list(mz_search = 0.01, ppm_search = 10, rt_search = 15, rt_gap = 30),
  params.query.sp = list(prec_mz = 10000, use_prec = T, polarity = "Positive", method =
    "Cosine", min_frag_match = 6, min_score = 0, reaction_type = "Metabolic")
)

Arguments

input_library

Character or a list object. If character, file name with extension mgf, msp or RData. If list, must contain "complete", "consensus" and "network".

query_ids

Vector. Vectors of molecular ids that will be extracted from input library

query_expression

Vector of characters or "". Vector of conditions used for querying the library. e.g. c("IONMODE=Positive","PEPMASS=325.19"). The left-hand side must match with the metadata items of the searched library.

query_spectrum

Two-column data matrix. Two columns represent m/z and intensity of query tandem spectrum. At least 3 valid peaks should be provided.

query_library

Character or a list object. Used when query_spectrum = NULL. If character, file name with extension mgf, msp, Rdata, cdf, mz(x)ml. If list, must contain metadata and sp, or library_generator output ("complete", "consensus" and "network")

params.search

General parameters for searching spectral library

  • mz_search: Numeric. Absolute mass tolerance in Da for fragment match.

  • ppm_search: Numeric. Mass tolerance in ppm for precursor mass match.

  • rt_search: Numeric. Absolute retention time tolerance in second.

  • rt_gap: Numeric. Only used when querying a raw LC-MS/MS file. Retention time gap in second - when two scans both match with an input structure, they are both recorded as isomeric features of the same identifier if they are separated by a certain retention time gap. Please set it to 10000 if no isomeric feature is picked

params.query.sp

Parameters for matching an unknown spectra

  • prec_mz: Numeric. Precursor mass of query spectrum. Not used query_library is used.

  • use_prec: Boolean. If set to TRUE, precursor mass is used to "pre-query" the library.

  • polarity: Character. Ion mode of the query spectrum, either positive or negative.

  • method: Character. Similarity metrics.

    1. Precision: Percentage of fragment or neutral loss matched in query spectrum.

    2. Recall: Percentage of fragment or neutral loss matched in reference spectrum.

    3. F1: Harmonic mean of precision and recall.

    4. Cosine: Cosine similarity score based on intensity vectors of fragments.

    5. Spearman: Spearman similarity based on intensity ranks of fragments.

    6. MassBank:Similarity score used by MassBank using weighted pearson score

    7. NIST:Similarity score used by NIST using weighted pearson score

  • min_frag_match Minimum matched peaks (or corresponding neutral losses) to allow a match.

  • min_score Minimum similarity score to be considered as a successful query.

  • reaction_type: Character. Either "Metabolic" and "Chemical". Type of transformation list used to annotate mass difference between connected features in molecular network.

Value

  • complete: Complete spectra library filtered by both query experession and query spectrum

  • consensus: Consensus spectra library filtered by both query experession and query spectrum.

  • network: Molecular network filtered by both query experession and query spectrum. The query spectrum is also connected to the molecular network

Author(s)

Youzhong Liu, Youzhong.Liu@uantwerpen.be


daniellyz/MergeION2 documentation built on Jan. 26, 2024, 6:24 a.m.