makeContMatrix {CEMiTool} | R Documentation

## Make a LIMMA contrast matrix

### Description

Make a LIMMA contrast matrix

### Usage

    makeContMatrix(sample_annot, class_column = "Class",
      which_groups = "all", comp_group = "none", subject_col = NULL,
      expr)

### Arguments

`sample_annot` | Sample annotation `data.frame`
`class_column` | Character string indicating the sample grouping column. Default: "Class"
`which_groups` | Optional character vector to use if selecting groups to be compared (e.g. disease1, disease3, but not disease2)
`comp_group` | Optional character string indicating group to compare groups against. If "none" (the default), compares all groups against each other.
`subject_col` | Optional character string indicating a column containing subject information
`expr` | Optional expression matrix for direct compatibility with makeLimmaComp

### Value

A list containing LIMMA contrast and design matrices

### Examples

    ## Not run:
    # Create a mock expressionset to test functions
    mockexpset <- matrix(rnorm(15000), ncol = 15)
    colnames(mockexpset) <- paste0('GSM', seq(1, 15))
    set.seed(100)
    rownames(mockexpset) <- apply(replicate(n = 1000, sample(letters, 8)),
        2, function(x) paste(x, collapse = ''))
    sample_annot <- data.frame(geo_accession = colnames(mockexpset),
                      group = c(rep('skin_healthy', 5), rep('degree1', 5), rep('degree2', 5)),
                      subject = paste0('S', c(rep(1:5),rep(1:5), rep(1:5))))
    # Testing function below
    # Paired
    cont_mat1 <- makeContMatrix(class_column = 'group', which_groups = c('degree1', 'degree2'),
                     comp_group = 'skin_healthy', subject_col= 'subject',
                     sample_annot = sample_annot, expr = mockexpset)
    limma_result1 <- do.call(makeLimmaComp, cont_mat1)
    # Unpaired
    cont_mat2 <- makeContMatrix(class_column = 'group', which_groups = c('degree1', 'degree2'),
                     comp_group = 'skin_healthy', sample_annot = sample_annot, expr = mockexpset)
    limma_result2 <- do.call(makeLimmaComp, cont_mat2)

    ## End(Not run)

[Package CEMiTool version 1.6.11 Index]