fs.line.plot: Line plot of Functionality Score vs. some other axis

Description Usage Arguments Value Examples

View source: R/FunctionalityScoreLinePlot.R

Description

This function creates a line plot of Functionality Score vs. some other axis, like those generated by the GenericCOMPASSWrapper.R script. Some formatting of the input data table is required, so it is not very "generic".

Usage

1
2
3
fs.line.plot(fsData, outdir = NULL, xaxis, yaxis, groupName,
  addBox = FALSE, ylimits = NULL, fileSuffix = NULL,
  condition = NULL)

Arguments

fsData

data table to plot

outdir

(Optional) will save plot to a file in this directory, if provided

xaxis

column in fsData for stratifying x-axis

yaxis

column in fsData for the y-axis (probably functionality score)

groupName

column name which identifies groups (e.g. individuals, for connecting line plots)

addBox

(Optional) A boolean. Adds boxplots for each x-axis value if set to True.

ylimits

(Optional) numeric vector specifying upper and lower y-axis limits

fileSuffix

(Optional) What to add to end of filename

Value

Line plot of FS scores, unless outdir is specified

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# Create the fsData table from the COMPASS output FS text file.
fsFile <- "/home/path/to/CD8/8+_CMV/FS_8+_CMV.txt"
ylims <- c(0, 0.15)
fsTable <- read.table(fsFile, header=TRUE, sep="\t", check.names=FALSE)
cellSubset <- as.character(fsTable[,"CellSubset"])
condition <- as.character(fsTable[,conditioncol])
fsData1 <- t(fsTable[,3:length(colnames(fsTable))])
fsData1 <- cbind(fsData1, ldply(rownames(fsData1), .fun = function(x) {strsplit(x, ", Time ")[[1]]}))
colnames(fsData1) <- c("FunctionalityScore", "PTID", "Time")
# Draw the line plot
fs.line.plot(fsData=fsData1, xaxis="Time", yaxis="FunctionalityScore", groupName="PTID", addBox=TRUE, ylimits=ylims)

## End(Not run)

seshadrilab/flowHelpers documentation built on May 23, 2019, 4:05 a.m.