library_merger: Extracting or generating representative scans for each...

View source: R/library_merger.R

library_mergerR Documentation

Extracting or generating representative scans for each compound and create a new library

Description

The function picks or generates a single MS1 and MS2 scan for each compound ID in the spectral library.

Usage

library_merger(library, method = c("consensus", "common_peaks",
  "max_tic", "max_nb_peaks", "most_recent"), consensus_window = 10,
  output_library = "")

Arguments

library

A list generated by the function library_generator() or the name of mgf spectral library file

method

A character of method for grouping library by compound IDs.

  • consensus: Consensus spectra were generated by merging spectra (MS1 and MS2) of the same compound ID. All peaks were kept, similar peaks were aligned.

  • common_peaks: Consensus spectra were generated by merging spectra (MS1 and MS2) of the same compound ID. Peaks detected in all spectra were kept and averaged.

  • max_tic: For the same compound ID, the spectrum with higher TIC was extracted and kept.

  • max_nb_peaks: For the same compound ID, the spectrum with more peaks was kept.

  • most_recent: For the same compound ID, the most recent record was kept.

consensus_window

m/z window (in ppm) for spectra alignment, only used when method = "consensus" or "common_peaks". To generate consensus spectra, mass peaks in different spectra within the mass window were aligned by averaging their mass values and intensities. The metadata was kept for the spectrum with higher TIC.

output_library

Name of the output library, the file extension must be mgf

Value

The same as library_generator()

Author(s)

Youzhong Liu, Youzhong.Liu@uantwerpen.be

Examples


data(DRUG_THERMO_LIBRARY)

# Withholding the scan (MS1 and MS) with highest TIC for each ID:

library2_1=library_merger(library2, method="max_tic", output_library="library_V2_filtered.mgf")

# Generating consensus spectra for all scans (MS1 and MS) of the same ID. The scan with highest TIC is used for metadata:

library2_2=library_merger(library2, method="consensus", consensus_window = 20, output_library="library_V2_consensus.mgf")


daniellyz/MergeION documentation built on Oct. 19, 2022, 1:56 p.m.