Learn R Programming

imputeLCMD (version 2.0)

generate.RollUpMap: Generates peptide to protein map.

Description

Generates peptide to protein map. For a given peptide expression matrix with nPep peptides, this functions creates a random map to be used for the aggregation of the peptides into nProt proteins.

Usage

generate.RollUpMap(nProt, pep.Expr.Data)

Arguments

nProt

Number of proteins

pep.Expr.Data

Peptide expression data matrix

Value

A vector of the length nPep containing integer random samples in the range [1, nProt]

See Also

generate.ExpressionData, pep2prot

Examples

Run this code
# NOT RUN {
  
exprsDataObj = generate.ExpressionData(nSamples1 = 6, nSamples2 = 6,
                          meanSamples = 0, sdSamples = 0.2,
                          nFeatures = 1000, nFeaturesUp = 50, nFeaturesDown = 50,
                          meanDynRange = 20, sdDynRange = 1,
                          meanDiffAbund = 1, sdDiffAbund = 0.2)
exprsData = exprsDataObj[[1]]
rollUpMap = generate.RollUpMap(round(dim(exprsData)[1]/2),exprsData)

## The function is currently defined as
function (nProt, pep.Expr.Data) 
{
    n = dim(pep.Expr.Data)[1]
    temp = 1:nProt
    pep.prot.Map = rep(0, n)
    pep.prot.Map[sample(temp)] = sample(temp)
    pep.prot.Map[which(pep.prot.Map == 0)] = sample.int(nProt, 
        size = (n - nProt), replace = T)
    return(pep.prot.Map)
  }
# }

Run the code above in your browser using DataLab