This function generates a numerical summary of a collection of MassSpectrum objects.

summarySpectra(x, digits = 4)

Arguments

x

A list of MassSpectrum objects.

digits

Integer indicating the number of decimal places to be used.

Details

For each MassSpectrum on the list this function provides summary statistics of m/z points and signal intensities (number, minimum, mean, standard deviation, median, mean absolute deviation, maximum).

Value

A data.frame containing summary information of a collection of MassSpectrum objects.

Examples

# Load example data

data(spectra) # list of MassSpectra class objects
data(type)    # metadata

# Summary of spectra features (results for 20 first mass spectra)

summarySpectra(spectra[1:20])
#>           ID No.MZ  Min.MZ   Max.MZ Min.Int  Mean.Int   Std.Int Med.Int
#> 1  160408F21  1857 2500.05 12995.77      19  722.2649  572.9375     664
#> 2  160408F22  1857 2500.05 12995.77      18  637.1357  531.1853     582
#> 3  160408F23  1857 2500.05 12995.77       8  542.4976  447.7237     483
#> 4  160408F24  1857 2500.05 12995.77      34  957.3430  737.8402     903
#> 5  160408G01  1857 2500.05 12995.77      42 1129.8185  871.5639    1064
#> 6  160408G02  1857 2500.05 12995.77      24  637.1648  530.9029     595
#> 7  160408G03  1857 2500.05 12995.77      12  505.9499  442.6567     466
#> 8  160408G04  1857 2500.05 12995.77      43  984.1179  754.5525     936
#> 9  160408G05  1857 2500.05 12995.77      27  906.9138  686.9536     854
#> 10 160408G06  1857 2500.05 12995.77      46  906.9133  689.0228     891
#> 11 160408G07  1857 2500.05 12995.77       9  383.5385  339.6962     352
#> 12 160408G08  1857 2500.05 12995.77      26  756.7415  582.2340     715
#> 13 160408G09  1857 2500.05 12995.77      14  580.6947  522.7782     524
#> 14 160408G10  1857 2500.05 12995.77      30  730.3985  578.6044     686
#> 15 160408G11  1857 2500.05 12995.77      26  771.9882  651.0067     712
#> 16 160408G12  1857 2500.05 12995.77      86  995.9386  639.7584    1000
#> 17 160408G13  1857 2500.05 12995.77     128 1894.1125 1228.2008    1887
#> 18 160408G14  1857 2500.05 12995.77      27  925.0722  739.1213     866
#> 19 160408G15  1857 2500.05 12995.77      46  728.0070  615.4929     680
#> 20 160408G16  1857 2500.05 12995.77      37  932.3393  703.2897     897
#>     MAD.Int Max.Int
#> 1  486.2928    5888
#> 2  382.5108    6128
#> 3  401.7846    4713
#> 4  587.1096    7843
#> 5  652.3440    7860
#> 6  358.7892    5459
#> 7  298.0026    5198
#> 8  530.7708    7333
#> 9  558.9402    6068
#> 10 481.8450    7505
#> 11 237.2160    3444
#> 12 426.9888    5410
#> 13 343.9632    5480
#> 14 415.1280    5948
#> 15 441.8148    6724
#> 16 471.4668    6310
#> 17 944.4162   10911
#> 18 541.1490    7509
#> 19 373.6152    8147
#> 20 493.7058    7631

# Some pre-processing

sc.results <- screenSpectra(spectra, meta = type)

spectra <- sc.results$fspectra
type <- sc.results$fmeta

spectra <- transformIntensity(spectra, method = "sqrt")
spectra <- wavSmoothing(spectra)
spectra <- removeBaseline(spectra)

names(spectra) <- type$SpectID # spectra IDs are lost with removeBaseline()

# Summary of spectra features (results for positions 10 to 20)

summarySpectra(spectra[10:20])
#>           ID No.MZ  Min.MZ   Max.MZ Min.Int Mean.Int Std.Int Med.Int MAD.Int
#> 1  160408G06  1857 2500.05 12995.77       0   9.4187  7.4519  8.8096  4.8588
#> 2  160408G07  1857 2500.05 12995.77       0   6.1664  5.5858  5.4212  3.9122
#> 3  160408G08  1857 2500.05 12995.77       0   8.2888  7.1684  6.8744  5.0418
#> 4  160408G09  1857 2500.05 12995.77       0   7.8635  7.1346  6.6714  4.8903
#> 5  160408G10  1857 2500.05 12995.77       0   8.5955  7.3257  7.1295  5.3704
#> 6  160408G11  1857 2500.05 12995.77       0   8.7352  7.9063  6.9191  5.3274
#> 7  160408G12  1857 2500.05 12995.77       0   8.6025  6.5432  8.0877  4.5442
#> 8  160408G13  1857 2500.05 12995.77       0  11.4564  9.3089 10.0140  6.6083
#> 9  160408G14  1857 2500.05 12995.77       0   9.4141  8.2514  8.1230  5.8925
#> 10 160408G15  1857 2500.05 12995.77       0   8.7202  7.4111  7.6813  4.7545
#> 11 160408G16  1857 2500.05 12995.77       0   9.4661  7.7870  8.1631  5.5819
#>    Max.Int
#> 1  70.7444
#> 2  48.6307
#> 3  60.5929
#> 4  63.1512
#> 5  64.3077
#> 6  69.8553
#> 7  60.6308
#> 8  81.1536
#> 9  72.6329
#> 10 75.9089
#> 11 72.2888