meansByProteins: Find mean and standard error of profile for a protein or...

View source: R/profileSummarize.R

meansByProteinsR Documentation

Find mean and standard error of profile for a protein or peptide

Description

Service function for profileSummarize. Find mean profiles using a random effects model for nested data.

Usage

meansByProteins(
  i,
  uniqueLabel,
  protsCombineCnew,
  numRefCols,
  numDataCols,
  GroupBy,
  eps,
  outlierExclude,
  singularList = FALSE
)

Arguments

i

protId or pepId (only one)

uniqueLabel

vector of either protId or pepId as specified by 'GroupBy' in profileSummarize

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

GroupBy

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

eps

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

outlierExclude

none, spectra, or spectraAndPeptide

singularList

If TRUE, list fractions associated with a given protein or peptide with singular lmer fit results; default is FALSE

Value

estimated mean and standard error for a protein or peptide profile

Estimated mean and standard error (log2 scale) for a protein or peptide profile, and Nspectra, Npep, protId, and pepId

Examples

set.seed(17356)
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)
                              
uniqueLabel <- flagSpectraBox$pepId
pepProfile_i_out <- meansByProteins(i=uniqueLabel[1], 
          uniqueLabel=uniqueLabel,
          protsCombineCnew=flagSpectraBox,
          numRefCols=6, numDataCols=9, GroupBy="peptideId",eps=eps,
          outlierExclude='spectra')
round(pepProfile_i_out, digits=3)

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