profileSummarize: Calculates a mean protein or peptide profiles and standard...

View source: R/profileSummarize.R

profileSummarizeR Documentation

Calculates a mean protein or peptide profiles and standard errors

Description

ProfileSummarize calculates mean and SE for each channel in each protein or peptide profile using a random effect model (proteins) or arithmetic mean (peptides). A random effect model can avoid dominance of a peptide with a large number spectra. See Tutorial 6 for details.

Usage

profileSummarize(
  protsCombineCnew,
  numRefCols,
  numDataCols,
  refColsKeep = c(1, 2),
  eps,
  GroupBy = "protId",
  outlierExclude = "spectraAndPeptide",
  setSeed = NULL,
  set.seed = NULL,
  cpus = NULL,
  multiprocess = FALSE,
  singularList = FALSE
)

Arguments

protsCombineCnew

data frame of profiles (spectra or spectra and peptides) with outlier information

numRefCols

number of columns preceding the profile data

numDataCols

number of fractions in each profile

refColsKeep

which reference columns to keep (requires columns 1 and 2 for protein and peptide name)

eps

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

GroupBy

‘protId’ if average peptides to give mean protein profile; ‘peptideId’ if average spectra to give mean peptide profiles

outlierExclude

'none', 'spectra', or 'spectraAndpeptide' (default) according to exclusion level

setSeed

NULL (default) deprecated; see note for "cpus"

set.seed

NULL (default) deprecated; see note for "cpus"

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

singularList

if TRUE, list fractions associated with a given protein or peptide with singular fit from the random effects function lmer; default is FALSE

Value

Mean or weighted mean NSA profiles

Examples

set.seed(17356)  # this works if multiprocess is set to 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)
pepProfiles <- profileSummarize(protsCombineCnew=flagSpectraBox,
           numRefCols=6, numDataCols=9, refColsKeep=c(1,2,4),eps=eps,
           GroupBy='peptideId', outlierExclude='spectra', 
           multiprocess=FALSE)
str(pepProfiles, strict.width='cut', width=65)
# Now use multiple processors with specified random number seed
snowParam <- BiocParallel::SnowParam(workers = 2, RNGseed=92883)
#
# now modifiy the existing BiocParallelParam
BiocParallel::register(snowParam, default=FALSE)
pepProfilesM <- profileSummarize(protsCombineCnew=flagSpectraBox,
           numRefCols=6, numDataCols=9, refColsKeep=c(1,2,4),eps=eps,
           GroupBy='peptideId', outlierExclude='spectra', 
           multiprocess=TRUE)
str(pepProfilesM, strict.width='cut', width=65)


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