BarplotOnOff: Pyramid barplot of on/off scores

Description Usage Arguments Value See Also Examples

View source: R/BarplotOnOff.R

Description

This function will generate a horizontal barplot of the OnOff scores of test cell types, as defined by the eset$sub_cell_type1 column of the input dataset. Note that if the cell types as provided in the second argument (score data frame as produced by the function OnOff, are not matching the phenotype of the input dataset, the function will return an error.

Usage

1
BarplotOnOff(eset, group.score)

Arguments

eset

an ExpressionSet containing data matrices of normalized expression data, present/absent calls, a gene annotation data.frame and a phenotype data.frame.

group.score

a data frame with cell type specific on/off scores as generated by the OnOff function.

Value

This function returns a list of two objects, as follows:

GroupComparisonsForPlot

an ordered data.frame of on/off scores,

OnOffBarplotData

a data frame of marker gain/loss and aditional features, used for making the plot.

See Also

OnOff for details on on/off score calculations, and hgu133plus2CellScore for details on the specific expressionSet object that should be provided as an input.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Load the expression set for the standard cell types
library(Biobase)
library(hgu133plus2CellScore) # eset.std

## Locate the external data files in the CellScore package
rdata.path <- system.file("extdata", "eset48.RData", package = "CellScore")
tsvdata.path <- system.file("extdata", "cell_change_test.tsv",
                            package = "CellScore")

if (file.exists(rdata.path) && file.exists(tsvdata.path)) {

   ## Load the expression set with normalized expressions of 48 test samples
   load(rdata.path)

   ## Import the cell change info for the loaded test samples
   cell.change <- read.delim(file= tsvdata.path, sep="\t",
                             header=TRUE, stringsAsFactors=FALSE)

   ## Combine the standards and the test data
   eset <- combine(eset.std, eset48)

   ## Generate a marker list
   group.OnOff <- OnOff(eset, cell.change, out.put="marker.list")

   ## Calculate on/off score for individual samples
   individ.OnOff <- OnOff(eset, cell.change, out.put="individual")
   
   ## Plot pyramid bar plot of on/off scores
   BarplotOnOff(eset, group.OnOff$scores)
}

CellScore documentation built on Nov. 8, 2020, 8:11 p.m.