outlierFind: Identify outlier profiles

View source: R/OutlierFind.R

outlierFindR Documentation

Identify outlier profiles

Description

Identify outlier profiles. This can be done at the level of identifying outlier spectra when calculating peptide profiles or identifying outlier peptides when calculating protein profiles. See Tutorial 6 for a description of outlier determination methods.

Usage

outlierFind(
  protClass,
  outlierLevel = "peptide",
  numRefCols = 5,
  numDataCols = 9,
  outlierMeth = "boxplot",
  range = 3,
  proba = 0.99,
  eps = eps,
  randomError = TRUE,
  setSeed = NULL,
  set.seed = NULL,
  cpus = NULL,
  multiprocess = FALSE
)

Arguments

protClass

a data frame containing profiles associated with either spectra or peptides (see Tutorial 6)

outlierLevel

'peptide' for outlier spectra within peptides, or 'protein' for outlier peptides within proteins

numRefCols

number of columns (variables) before data columns

numDataCols

number of fractions in each profile

outlierMeth

boxplot (recommended), scores, or none (if no outliers are to be reported)

range

the range parameter used for identifying outliers using the boxplot method

proba

probability to exclude outlier for scores method

eps

small value to add so that log argument is greater than zero

randomError

TRUE if allow it to be random

setSeed

seed for random number generator (deprecated)

set.seed

seed for random number generator (deprecated)

cpus

NULL (default); deprecated Use BiocParallel with SnowParm or other multiprocessor method to set number of processors See examples for how to specify the number of processors

multiprocess

FALSE by default

Value

New data frame with an additional column that indicates the number of fractions in a profile (spectra or peptide) that are outliers

Examples

set.seed(17356)  # this works if multiprocess=FALSE
eps <- 0.029885209
data(spectraNSA_test)
flagSpectraBox <- outlierFind(protClass=spectraNSA_test,
                              outlierLevel='peptide', numRefCols=5,
                              numDataCols=9,
                              outlierMeth='boxplot', range=3, eps=eps,
                              randomError=TRUE, multiprocess=FALSE)
                              
# examine breakdown of spectral according to the number of fractions 
#  in their profiles that are outliers
table(flagSpectraBox$outlier.num.spectra)
# Now use multiple processors by specifying "multiprocess=TRUE";
# The actual number of cpus is defined by "workers" in SnowParam
# A random number seed may be specified by "RNGseed" in SnowParam
snowParam <- BiocParallel::SnowParam(workers = 2, RNGseed=1423)
#
# now modifiy the existing BiocParallelParam
BiocParallel::register(snowParam, default=FALSE)
flagSpectraBoxM <- outlierFind(protClass=spectraNSA_test,
                              outlierLevel='peptide', numRefCols=5,
                              numDataCols=9,
                              outlierMeth='boxplot', range=3, eps=eps,
                              randomError=TRUE, multiprocess=TRUE)
table(flagSpectraBoxM$outlier.num.spectra)


mooredf22/protlocassign documentation built on Sept. 13, 2023, 3:57 p.m.