summarize_monospectra {MGMS2}R Documentation

summarize_monospectra

Description

This function summarizes monomicrobial spectra and writes summary in the specified directory.

Usage

summarize_monospectra(
  processed.obj,
  species,
  directory = NULL,
  minFrequency = 0.5,
  align.tolerance = 5e-04,
  snr = 3,
  halfWindowSize = 20,
  top.N = 50
)

Arguments

processed.obj

A list from process_monospectra which contains peaks information for each strain.

species

Species name.

directory

Directory. (By default, no summary file will be generated.)

minFrequency

Percentage value. A minimum occurrence proportion required for building a reference peaks. All peaks with their occurence proportion less than minFrequency will be moved. (Default: 0.50). See filterPeaks and referencePeaks for details.

align.tolerance

Mass tolerance. Must be multiplied by 10^-6 for ppm. (Default: 0.0005).

snr

Signal-to-noise ratio. (Default: 3).

halfWindowSize

The highest peaks in the given window (+/-halfWindowSize) will be recognized as peaks. (Default: 20). See detectPeaks for details.

top.N

The top N peaks will be chosen for the analysis. An integer value. (Default: 50).

Value

A data frame that contains the peaks informations: m/z, mean log intensity, standard deviation of log intensity, missing rate of peaks. In addition, it also contains species and strain information.

Examples

spectra.processed.A <- process_monospectra(
   file=system.file("extdata", "listA.txt", package="MGMS2"),
   mass.range=c(1000,2200))
spectra.mono.summary.A <- summarize_monospectra(
   processed.obj=spectra.processed.A, species='A',
   directory=tempdir())

[Package MGMS2 version 1.0.2 Index]