Learn R Programming

imputeLCMD (version 1.0)

generate.ExpressionData: Generate Peptide/Protein Expression Data

Description

Generates a matrix of peptide/protein expression data. It is assumed that the expression data is log - transformed. Therefore, for each sample the peptides/proteins intensities are randomly drawn from a Gaussian distribution.

Usage

generate.ExpressionData(nSamples1, nSamples2, meanSamples, sdSamples, 
                        nFeatures, nFeaturesUp, nFeaturesDown, 
                        meanDynRange, sdDynRange, 
                        meanDiffAbund, sdDiffAbund)

Arguments

nSamples1
Number of samples in condition 1.
nSamples2
Number of samples in condition 2.
meanSamples
Mean value of the background noise.
sdSamples
Standard deviation of the background noise.
nFeatures
Number of peptides/proteins.
nFeaturesUp
Number of peptides/proteins up-regulated.
nFeaturesDown
Number of /peptidesproteins down-regulated.
meanDynRange
Mean value of the dynamic range of peptide/protein expressions.
sdDynRange
Standard deviation of the dynamic range of peptide/protein expressions.
meanDiffAbund
Mean value of the up/down-regulation.
sdDiffAbund
Standard deviation of the up/down-regulation.

Value

  • A list including elements:
  • dataPeptide/protein expression matrix
  • conditionsVector indicating the samples in each condition
  • labelFeaturesVector indicating features which are down/up/no regulated

See Also

pep2prot, generate.RollUpMap, insertMVs

Examples

Run this code
dataObj = generate.ExpressionData(nSamples1 = 6, nSamples2 = 6,
                          meanSamples = 0, sdSamples = 0.2,
                          nFeatures = 2000, nFeaturesUp = 100, nFeaturesDown = 100,
                          meanDynRange = 20, sdDynRange = 1,
                          meanDiffAbund = 1, sdDiffAbund = 0.2)
exprsData = dataObj[[1]]
  
hist(exprsData[,1])

## The function is currently defined as
function (nSamples1, nSamples2, meanSamples, sdSamples, nFeatures, 
    nFeaturesUp, nFeaturesDown, meanDynRange, sdDynRange, meanDiffAbund, 
    sdDiffAbund) 
{
    nSamples = nSamples1 + nSamples2
    data = matrix(rnorm(nSamples * nFeatures, meanSamples, sdSamples), 
        nFeatures, nSamples)
    means = rnorm(nFeatures, meanDynRange, sdDynRange)
    data = data + means
    conditions = c(rep(1, nSamples1), rep(2, nSamples2))
    DE.coef.up = matrix(rnorm(nFeaturesUp * nSamples1, meanDiffAbund, 
        sdDiffAbund), nFeaturesUp, nSamples1)
    DE.coef.down = matrix(rnorm(nFeaturesDown * nSamples2, meanDiffAbund, 
        sdDiffAbund), nFeaturesDown, nSamples2)
    data[1:nFeaturesUp, conditions == 1] = DE.coef.up + data[1:nFeaturesUp, 
        conditions == 1]
    data[(nFeaturesUp + 1):(nFeaturesUp + nFeaturesDown), conditions == 
        2] = DE.coef.down + data[(nFeaturesUp + 1):(nFeaturesUp + 
        nFeaturesDown), conditions == 2]
    labelFeatures = c(rep(1, nFeaturesUp), rep(2, nFeaturesDown), 
        rep(3, nFeatures - (nFeaturesUp + nFeaturesDown)))
    row.names(data) = 1:nFeatures
    return(list(data, conditions, labelFeatures))
  }

Run the code above in your browser using DataLab