cytottest: preform t-test on cfList

Description Usage Arguments Value Examples

View source: R/cytottest.R

Description

Performs a separate t-test on each cluster within a cfList. The output is added and can also be used by other functions

Usage

1
cytottest(cfList, group, adjustMethod, ...)

Arguments

cfList

a cfList object. It should contain at least data in the 'counts' slot.

group

one of:

  • a character vector referring to a column name in the samples slot of the cfList.

  • a factor indicating the grouping for the t.test.

adjustMethod

character, correction method used in p.adjust, choose from c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"). If omitted, no correction takes place.

...

further arguments passed on to t.test.

Value

Returns a cfList with a 'results' slot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Read Data
dirFCS <- system.file("extdata", package="cytofast")
cfData <- readCytosploreFCS(dir = dirFCS, colNames = "description")

# relabeling of clusterID
levels(cfData@expr[,"clusterID"]) <- gsub("[^0-9]", "", levels(cfData@expr[,"clusterID"]))  

# Add cell counts to cfList and add meta data
cfData <- cellCounts(cfData, frequency = TRUE, scale = TRUE)
meta <- spitzer[match(row.names(cfData@samples), spitzer$CSPLR_ST),]
cfData@samples <- cbind(cfData@samples, meta)

# Run t-test
cfData@samples$effect <- gsub("_D\\d", "", spitzer$group)
cfData <- cytottest(cfData, group  = "effect", adjustMethod = "bonferroni")
cfData@results

cytofast documentation built on Nov. 8, 2020, 5:46 p.m.