eset_instances: A function to subset an eSet with expression data into...

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/utility-functions.R

Description

This function takes two parameters, an eSet object (e.g. an ExpressionSet or CountDataSet) containing muliple samples, and a numerical matrix defining how these samples should be compared to investigate perturbations of interest. For each perturbation, a separate eSet object is generated, ready for analysis with the generate_gCMAP_NChannelSet function. Samples can be used in multiple instances, e.g. common controls can be specified in each column of the 'instance.matrix'.

Usage

1
2
eset_instances(instance.matrix, eset, control_perturb_col = "cmap", 
control = "control", perturb = "perturbation")

Arguments

instance.matrix

A numeric matrix of -1 and 1's. Each columns defines a contrast of interest and indicates whether a sample (row) corresponds to a control sample (-1) or a perturbation sample (1). The row.names of the instance.matrix correspond to sampleNames of 'eset'. Entries other than -1 or 1 will be ignored.

eset

An eSet object to be subset into smaller datasets. The row.names of 'eset' must correspond to the row.names of the 'instance.matrix'.

control_perturb_col

Character, indicating which phenoData column to use to store 'control' and 'perturb' labels.

control

Character, defining the label stored in each new eSet to indicate control samples.

perturb

Character, defining the label stored in each new eSet to indicate perturbation samples.

Value

A list of eSet objects, each corresponding to one instance defined by the columns of 'incidence.matrix'.

Note

This function can be used to generate the 'eset.list' required for differential expression analyses with generate_gCMAP_NChannelSet.

Author(s)

Thomas Sandmann, sandmann.thomas@gene.com

See Also

generate_gCMAP_NChannelSet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  library(Biobase)
  data(sample.ExpressionSet)
  
  ## contains Male/Female and Control/Case annotations
  pData( sample.ExpressionSet)
  
  ## separate analysis of Male/Female patients
  male <- ifelse( pData( sample.ExpressionSet )$type == "Control", -1, 1)
  male[which( pData( sample.ExpressionSet )$sex == "Female")] <- 0
  
  female <- ifelse( pData( sample.ExpressionSet )$type == "Control", -1, 1)
  female[which( pData( sample.ExpressionSet )$sex == "Male")]  <- 0
  
  instance.matrix <- cbind( male, female)
  row.names( instance.matrix ) <- sampleNames( sample.ExpressionSet )
  
  eset_instances( instance.matrix, sample.ExpressionSet)

gCMAP documentation built on April 29, 2020, 3:54 a.m.