Learn R Programming

rnaseqWrapper (version 1.0-1)

calcCombVals: Calculate group values from RNAseq data

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

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 "*"
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
functionName
A string to use in naming the output columns or list names. Defaults to as.character(FUN) if not set.

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).

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.

See Also

calcBasicDE

Examples

Run this code
## 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)
}

Run the code above in your browser using DataLab