slidingMean: Data smoothing for peptide microarray.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/slidingMean.R

Description

This function applies a sliding mean window to intensities to reduce noise generated by experimental variation, as well as take advantage of the overlapping nature of array peptides to share signal.

Usage

1
slidingMean(peptideSet, width = 9, verbose = FALSE, split.by.clade = TRUE)

Arguments

peptideSet

A peptideSet. The expression data for the peptides as well as annotations and ranges. The range information is required to run this function.

width

A numeric. The width of the sliding window.

verbose

A logical. If set to TRUE, progress information will be displayed.

split.by.clade

A logical. If TRUE, the peptides will be smoothed by clade (See details section below for more information).

Details

Peptide membership in the sliding mean window is determined by its position and the width argument. Two peptides are in the same window if the difference in their positions is less than or equal to width/2. A peptide's position is taken to be position(peptideSet).

A peptide's intensity is replaced by the mean of all peptide intensities within the peptide's sliding mean window.

When split.by.clade = TRUE, peptides are smoothed within clades defined by the clade column of the GRanges object occupying the featureRange slot of peptideSet. If set to FALSE, a peptide at a given position will borrow information from the neighboring peptides as well as the ones from other clades around this position.

Value

A peptideSet object with smoothed intensities.

Author(s)

Gregory Imholte

See Also

summarizePeptides, normalizeArray

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## This example curated from the vignette -- please see vignette("pepStat")
## for more information
if (require("pepDat")) {

  ## Get example GPR files + associated mapping file
  dirToParse <- system.file("extdata/gpr_samples", package = "pepDat")
  mapFile <- system.file("extdata/mapping.csv", package = "pepDat")

  ## Make a peptide set
  pSet <- makePeptideSet(files = NULL, path = dirToParse,
                         mapping.file = mapFile, log=TRUE)

  ## Plot array images -- useful for quality control
  plotArrayImage(pSet, array.index = 1)
  plotArrayResiduals(pSet, array.index = 1, smooth = TRUE)

  ## Summarize peptides, using pep_hxb2 as the position database
  data(pep_hxb2)
  psSet <- summarizePeptides(pSet, summary = "mean", position = pep_hxb2)

  ## Normalize the peptide set
  pnSet <- normalizeArray(psSet)

  ## Smooth
  psmSet <- slidingMean(pnSet, width = 9)

  ## Make calls
  calls <- makeCalls(psmSet, freq = TRUE, group = "treatment",
                     cutoff = .1, method = "FDR", verbose = TRUE)

  ## Produce a summary of the results
  summary <- restab(psmSet, calls)

}

Example output

Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: IRanges
Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

No methods found in "GenomicRanges" for requests: mcols<-
No methods found in "GenomicRanges" for requests: mcols
Loading required package: pepDat
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'pepDat'

pepStat documentation built on Nov. 8, 2020, 6:45 p.m.