combine_feature_intensities: Combine feature intensities of several spectra

Description Usage Arguments Value Examples

View source: R/combine_feature_intensities.R

Description

Load extracted information about features such as intensities, peak detection and measured mz values and combine them with phenotype information into a RangedSummarizedExperiment-class object. Features are removed if they have missing mz values or intensities for all samples or constant intensity across all samples.

Usage

1
2
3
4
5
6
7
combine_feature_intensities(
  feature.files,
  id.samples = NULL,
  pheno = NULL,
  cor.cutoff = 0.9,
  verbose = FALSE
)

Arguments

feature.files

Character vector. Names of files with feature intensities as generated by extract_feature_intensity.

id.samples

Character vector. Identifiers of each file. If NULL, ids will be identified as basenames of files.

pheno

data.frame. Information about each sample. Rownames need to correspond to id.samples. If NULL, pheno will only contain ids.

cor.cutoff

Numeric. Cutoff of the pair-wise absolute correlation (default: 0.9).

verbose

Logical. Print out additional information.

Value

RangedSummarizedExperiment-class object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data("info.features")
res.dir = tempdir()
mzml.files = dir(system.file("extdata",
                             package = "preprocessHighResMS"),
                 full.names = TRUE)

sapply(mzml.files,
       extract_feature_intensity,
       scanrange = c(1, 2),
       info.features = info.features,
       ppm = 20,
       res.dir = res.dir)

feature.files = dir(path = res.dir,
                    pattern = ".rds",
                    full.names = TRUE)
se.example = combine_feature_intensities(feature.files = feature.files,
                                         verbose = TRUE)

szymczak-lab/preprocessHighResMS documentation built on Oct. 6, 2020, 12:50 a.m.