Files
2015-GCAT/R/GCAT/.Rproj.user/7CB73FCA/sdb/per/t/2C8FAF10
T

16 lines
31 KiB
Plaintext
Raw Normal View History

2015-04-10 15:12:45 -05:00
{
"contents" : "#Copyright 2012 The Board of Regents of the University of Wisconsin System.\n#Contributors: Jason Shao, James McCurdy, Enhai Xie, Adam G.W. Halstead, \n#Michael H. Whitney, Nathan DiPiazza, Trey K. Sato and Yury V. Bukhman\n#\n#This file is part of GCAT.\n#\n#GCAT is free software: you can redistribute it and/or modify\n#it under the terms of the GNU Lesser General Public License as published by\n#the Free Software Foundation, either version 3 of the License, or\n#(at your option) any later version.\n#\n#GCAT is distributed in the hope that it will be useful,\n#but WITHOUT ANY WARRANTY; without even the implied warranty of\n#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n#GNU Lesser General Public License for more details.\n#\n#You should have received a copy of the GNU Lesser General Public License \n#along with GCAT. If not, see <http://www.gnu.org/licenses/>.\n\nrequire(pheatmap)\nrequire(gplots)\n\n########################################################################\n# #\n# Graphic output functions for fitted well objects. The functions are #\n# fairly complicated and intertwined and may need revision. #\n# #\n########################################################################\n\n# S3 Generic.\nplot <- function(input.well, ...) {\n UseMethod(\"plot\")\n}\n\n########################################################################\n# Basic function plots time vs. OD from a well object #\n########################################################################\n#' plot.data\n#'\n#' Basic function plots time vs. OD from a well object\n#'\n#' @param input.well The well object that need to be plottedd\n#' @param unlog should data be plotted on a linear (vs. logarithmic) scale?\n#' @param view.raw.data should the raw data be plotted? (\n#' @param number.points should points be labeled with numeric indices?\n#' @param scale determines the font scale for the entire graph. all cex values are calculated from this.\n#' @param draw.symbols - should <check.slopes> be called on the well and markings drawn on the graph?\n#' @param ... additional arguments passed to plot()\nplot.data = function(input.well, view.raw.data = F, unlog = F, scale = 1, \n main = paste(plate.name(input.well), well.name(input.well)), number.points = T, \n draw.symbols = F, constant.added, ylim, ...){\n \n # Get data as well as a vector showing which points were removed. \n\tinput.data = data.from(input.well, remove = F, remove.tanking = F, raw.data=view.raw.data)\n\tremoved.points = !(rownames(input.data) %in% rownames(data.from(input.well, remove = T, remove.tanking = T)))\n point.colors = as.character(factor(removed.points,levels=c(F,T),labels=c(\"black\",\"gray80\")))\n\n # Draw the axes and all text labels first.\n\tpar(mar = c(5, 4, 4, 5)+0.1)\n\tplot(input.data, main = main, xlab = \"Time(hours)\", ylab = \"log(OD - blank + const)\",\n mex = scale, cex.main = 1.5*scale, cex.axis = 1.2*scale, cex.lab = 1.2*scale, type =\"n\",...)\n \n\t# Draw a second vertical axis, showing unlogged OD scale\n\t# - Determine the range of the labels: from min.OD to max.OD\n if (class(try(ylim,silent=T)) == \"try-error\") {\n OD = unlog(input.data[,2],constant.added)\n baseline.OD = unlog(baseline(input.well),constant.added)\n min.OD = min(min(OD,na.rm=T),baseline.OD,na.rm=T)\n plateau.OD = unlog(plateau(input.well),constant.added)\n max.OD = max(max(OD,na.rm=T),plateau.OD,na.rm=T)\n } else {\n min.OD = unlog(ylim[1],constant.added)\n max.OD = unlog(ylim[2],constant.added)\n }\n\t# - Compute labels and their positions\n\tOD.labels = seq(from = min.OD, to = max.OD, length.out = 5)\n\tOD.labels = signif(OD.labels,2)\n\tOD.at = log(OD.labels+constant.added)\n # - Draw the axis\n\taxis(side=4, at=OD.at, labels=OD.labels, cex.axis = 1.2*scale, cex.lab = 1.2*scale)\n\tmtext(4, text = \"OD - blank\", line = 3, cex=1.2)\n \
"created" : 1425413258441.000,
"dirty" : false,
"encoding" : "UTF-8",
"folds" : "",
"hash" : "1576748553",
"id" : "2C8FAF10",
"lastKnownWriteTime" : 1428438949,
"path" : "~/Documents/GCAT4/trunk/R/GCAT/R/plot.fit.R",
"project_path" : "R/plot.fit.R",
"properties" : {
},
"source_on_save" : false,
"type" : "r_source"
}