getPlotSummaryData: Extract Summary Subset for Plotting

Description Usage Arguments Value Author(s) Examples

View source: R/caOmicsV.R

Description

Extract required rows and columns from a summary data set.

Usage

1
    getPlotSummaryData(summaryData, sampleNames=NULL, geneNames=NULL)

Arguments

summaryData

a data frame with summary data for each gene (rows are for genes and columns are summary values) or for each sample (rows are summary values and columns are sample names)

sampleNames

character vector, names of samples/columns to be extracted. Set to NULL when summary data is for genes.

geneNames

character vector, names of genes to be extracted. Set to NULL when summary data is for samples

Value

A data frame with subset of input data and with the same orders as geneNames and sampleNames.

Author(s)

Henry Zhang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
    data(RNASeqDemoData)
    exprValue <- as.matrix(RNASeqDemoData[, 2:ncol(RNASeqDemoData)])

    summaryData <- data.frame(as.character(RNASeqDemoData[,1]), 
        rowMeans(exprValue), log2(rowMeans(exprValue)))
    geneSymbols <- c("ECM1", "SLC26A6", "ADAMTS13", "FCN3", "CFP")
    sumByGene <- getPlotSummaryData(summaryData, geneNames=geneSymbols)

    summaryData <- rbind(colMeans(exprValue),  log2(colMeans(exprValue)))
    summaryData <- data.frame(c("sampleMean", "log2mean"), summaryData)
    colnames(summaryData) <- colnames(exprValue)
    sampleID <- colnames(exprValue)[c(2:21, 32:41)]
    sumBySample <- getPlotSummaryData(summaryData, sampleID)

caOmicsV documentation built on Nov. 8, 2020, 8:23 p.m.