protPepProfile_i: Combine a protein profile with its component peptide profiles

View source: R/protPepProfile.R

protPepProfile_iR Documentation

Combine a protein profile with its component peptide profiles

Description

Service function for protPepProfile. Creates a data frame containing the profile of a single protein followed by its component peptide profiles.

Usage

protPepProfile_i(i, flagPeps, numRefCols, numDataCols, protProfileData)

Arguments

i

Protein i

flagPeps

data frame containing profiles for all spectra, information mapping these to proteins and peptides, and outlier indicators for spectra and peptides

numRefCols

number of reference columns

numDataCols

number of fractions in each profile

protProfileData

data frame containing protein profiles

Value

Data frame containing the profiles for a single protein and its component peptides

Examples

set.seed(7336)
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)

# find peptide-level profiles
pepProfiles <- profileSummarize(protsCombineCnew=flagSpectraBox,
      numRefCols=6, numDataCols=9, refColsKeep=c(1,2,4),eps=eps,
      GroupBy="peptideId", outlierExclude="spectra")
 # find oulier peptides
flagPepsBox <- outlierFind(protClass=pepProfiles,
      outlierLevel="protein",
      numRefCols=3, numDataCols=9, eps=eps)
      str(flagPepsBox, strict.width="cut", width=65)
      
 # combine the two types of outliers into one
flagSpectraPeps <- merge(x=flagSpectraBox,
      y=flagPepsBox[,c(4,17)], by="pepId")
      
# Create protein profile from component peptide and spectra
protNSA_1 <-
      profileSummarize(protsCombineCnew=flagSpectraPeps,
      numRefCols=7, numDataCols=9, eps=eps, GroupBy="protId",
      outlierExclude="spectraAndPeptide")
      
# combine protein and peptide profiles 
protPepProfileNSA_i <- protPepProfile_i(i=1, flagPeps=flagPepsBox,
      numRefCols=4, numDataCols=9,
      protProfileData=protNSA_1)
str(protPepProfileNSA_i, strict.width="cut", width=65)


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