summarize_monospectra: summarize_monospectra

Description Usage Arguments Value Examples

View source: R/SpecFunctions.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
5
6
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())

MGMS2 documentation built on April 24, 2020, 9:06 a.m.