Description Usage Arguments Value Examples
View source: R/FunctionalityScoreLinePlot.R
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".
1 2 3 |
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 |
Line plot of FS scores, unless outdir is specified
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.