16 lines
11 KiB
Plaintext
16 lines
11 KiB
Plaintext
|
|
{
|
||
|
|
"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\n########################################################################\n# #\n# Populate an output table with parameters and other useful info for #\n# each well in a fitted dataset. #\n# #\n########################################################################\n#\n# unlog - Should OD values be returned on the linear scale instead of log-transformed scale? \n# constant.added - For returning values on linear scale, what constant was added to ODs before the log transform? \n# reach.cutoff - what proportion of the plateau OD must tbe reached by the last valid timepoint for the curve to be marked as reaching its plateau OD?\n#\n\ntable.out = function(fitted.data.set, unlog = F, constant.added, reach.cutoff = 0.90, filename.timestamp = NULL,use.linear.param=F, use.loess=F){\n \n # The idea is basically to use <unlist> and <aapply> on the fitted data array in order \n # to get one vector for each column of the output table. \n \n # Get identifying information (plate, well, media and strain names)\n plate.ID = unlist(aapply(fitted.data.set,plate.name))\n well.ID = unlist(aapply(fitted.data.set,well.name))\n media.ID = unlist(aapply(fitted.data.set,media.name))\n strain.ID = unlist(aapply(fitted.data.set,strain.name))\n # Get fit information for each well\n # - was it marked as empty in the plate layout?\n # - did the program find it to contain no growth (\"dead\")? \n # - was the fitting procedure successful? \n # - did the curve tank? if so, at what timepoint? if not, set value to \"-\"\n \n empty = unlist(aapply(fitted.data.set, is.empty))\n dead = unlist(aapply(fitted.data.set, lacks.growth))\n fit = unlist(aapply(fitted.data.set, contains.fit))\n tanking = unlist(aapply(fitted.data.set, tanking.start))\n tanking[is.na(tanking) | tanking == 1 | dead] = \"-\"\n \n # Get calculated values for each well: specific growth, final and initial OD, fitted plateau and baseline OD, lag time, etc.\n inflection.time = unlist(aapply(fitted.data.set, inflection.time))\n max.spec.growth.rate = unlist(aapply(fitted.data.set, max.spec.growth.rate))\n max.log.OD = unlist(aapply(fitted.data.set, max.log.OD))\n inoc.log.OD = unlist(aapply(fitted.data.set, inoc.log.OD))\n projected.growth = unlist(aapply(fitted.data.set, projected.growth))\n projected.growth.OD = unlist(aapply(fitted.data.set, projected.growth.OD, constant.added))\n achieved.growth = unlist(aapply(fitted.data.set, achieved.growth))\n achieved.growth.OD = unlist(aapply(fitted.data.set, achieved.growth.OD, constant.added))\n lag.time = unlist(aapply(fitted.data.set, lag.time))\n shape.par = unlist(aapply(fitted.data.set, shape.par))\n RSS = unlist(aapply(fitted.data.set, rss))\n baseline = unlist(aapply(fitted.data.set, baseline))\n amplitude = unlist(aapply(fitted.data.set, amplitude))\n plateau = unlist(aapply(fitted.data.set, plateau))\n ########################3h#############################################\n max.spec.growth.rate.SE = unlist(aapply(fitted.
|
||
|
|
"created" : 1425413247086.000,
|
||
|
|
"dirty" : false,
|
||
|
|
"encoding" : "UTF-8",
|
||
|
|
"folds" : "",
|
||
|
|
"hash" : "2376564637",
|
||
|
|
"id" : "6FF7DC6F",
|
||
|
|
"lastKnownWriteTime" : 1424208623,
|
||
|
|
"path" : "~/Documents/GCAT4/trunk/R/GCAT/R/table.output.R",
|
||
|
|
"project_path" : "R/table.output.R",
|
||
|
|
"properties" : {
|
||
|
|
},
|
||
|
|
"source_on_save" : false,
|
||
|
|
"type" : "r_source"
|
||
|
|
}
|