calcCombVals: Calculate group values from RNAseq data

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

Description

This script uses grep to combine the data from all individuals in a group, for a specific data type(s), and calculates the summary statistic requested.

Usage

1
2
calcCombVals(data, groupID, colID = "FPKM", combineCols = TRUE,
matchEnd = TRUE, FUN = "mean", functionName = NULL)

Arguments

data

A data.frame or matrix containing the individual data (columns) for several genes (rows) from which to calculate the test statistic FUN

groupID

A character vector or list. If character, include the group IDs, to be used as patterns in grep. Make sure the names are unique enough to match only what you want them to. To include all groups for a data type, set groupID = "all","", or "*". If a list, give the column numbers for each group, named with your desired group output name (e.g. groupID = list(control = c(1,2,3), treated = c(4,5,6)) )

colID

A character vector of the columns of interest (e.g. FPKM). To include all columns for each group, set colID = "all","", or "*". colID is ignored if groupID is a list.

combineCols

Logical, should the resulting columns be put into one data.frame (default, combineCols = TRUE), or left as enteries in a list.

matchEnd

Logical, should the colId pattern only match the end of the string.

FUN

Either be a function or a character that can be coerced to function using match.fun(FUN). This will be used to name the output columns if functionName is not set. If not a character, set functionName to assign column names for the output

functionName

A string to use in naming the output columns or list names. Defaults to as.character(FUN) if not set.

Details

This function uses grep to grab a series of columns (by group and by column type), and then runs a summary function (FUN) on each set. This can effectivley calculate group statistics for visualization and course analysis, such as means, medians, etc.

Value

If combineCols = TRUE, returns a data.frame with one column for each set (groupID by colID). If combineCols = FALSE, returns a list with one entry for each set (groupID by colID).

Author(s)

Mark Peterson

See Also

calcBasicDE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Only run if DESeq is available
if(require(DESeq)){

## Create sample data
## Could be reads or FPKM from your input
exampleCounts <- counts(makeExampleCountDataSet())


testComb <- calcCombVals(exampleCounts,
                         groupID=c("A","B","*"),
                         colID=c("all"))
head(testComb)
}

rnaseqWrapper documentation built on May 2, 2019, 5:58 a.m.