qfa.plot2: Creating plots of growth curves including models for QFA...

View source: R/CreatePlots.R

qfa.plot2R Documentation

Creating plots of growth curves including models for QFA dataframe in a pdf

Description

Produces a multipage pdf of growth curves including model fits if present. Each page corresponds to a single plate and growth curves are arrayed on the page according to their position on the plate. Both observations (red crosses) and the fitted growth curve from qfa.fit2 (solid black curves) are shown for each culture. The time at which the maximum slope of the observed growth curve on the log scale occurs (solid blue line) and the time at which the maximum slope of the raw observed data occurs (dashed blue line) are also indicated. Where available, various fitness estimates are displayed for each culture, together with culture genotype. These pdfs are useful for visually checking quality of model fit & data.

Usage

qfa.plot2(
  file = "QFA_GrowthCurves.pdf",
  results,
  d,
  curves = TRUE,
  maxg = NA,
  maxt = NA,
  ming = NA,
  mainTitle = NA,
  TimeFormat = "d",
  ylabel = "Cell density (AU)",
  ptype = "p",
  fmt = "%Y-%m-%d_%H-%M-%S",
  logify = FALSE,
  densityCol = "Growth",
  barcodes = c(),
  master.plates = c(),
  treatments = c(),
  screen.names = c(),
  screenIDs = c()
)

Arguments

file

String. The pdf name to store the plots

results

data.frame. The output of qfa.fit2 which contains the model fit data. If curves = F, results should be the same as d for plotting of data without model fits

d

data.frame. The original data.frame fed to qfa.fit2 containing all of the timecourse data. Output of either Colonyzer.Read or GC2QFA

curves

logical. Indicates whether fitted model curves should be drawn. Useful to set this to false when generating diagnostic, data-only growth curves. To do this, set curves = FALSE and pass the same (data) object twice, as both the d and results arguments. For example: qfa.plot2("test.pdf",df,df,curves=FALSE)

maxg

Numeric. Upper cell density (y-axis limit) for all growth curve plots. Default value is NA. If maxg=NA, the y-limit is chosen automatically to show all datapoints

maxt

Numeric. Growth curve is plotted from time t = 0 to maxt. If set to NA, maxt is set from the data as the latest timepoint found in the data.frame d

ming

Numeric. Lower y-axis limit. If set to NA, minimal Growth value is used to set ming. Default set to NA

mainTitle

String. A string for the main title of the pdf plot. If set to NA (default), a combination of Barcode, Treatment, Medium and Master.Plate columns of the results data.frame will be used for the main title

TimeFormat

String. Either "h" for hours or "d" for days. This defines the format of the x-axis. Although, it only needs to be specified if curves=F as it is read otherwise from the results data.frame

ylabel

String. y-axis label on growth curve plots.

ptype

String. Plot type for data: "p": points, "l": lines, "b": both. Default: "p"

fmt

String. The format in which Exp.Time of measurement and inoculation time are stored. Default set to standard Colonyzer.Read or GC2QFA output

logify

logical. Indicates whether growth curve plots should be on a semilog scale. Not recommended.

densityCol

String. Name of column in data frame d which contains cell density estimate. Note that the image analysis software Colonyzer provides several possible alternatives. Default set to Growth which needs to be manually specified before calling qfa.fit2

barcodes

Vector of strings. Plot only for the plates with barcodes in this character vector; all by default

master.plates

Vector of strings. Plot only for the plates from master.plates in this character vector; all by default

treatments

Vector of strings. Plot only for the plates with treatments in this character vector; all by default

screen.names

Vector of strings. Plot only for the plates with screen.names in this character vector; all by default

screenIDs

Vector of strings. Plot only for the plates with screenIDs in this character vector; all by default

Value

This function creates a pdf file stored in the working directory named acording to the user input. On the pdf file, growth curves of the observation data.frame d and, if curves=T and the specified results data.frame contains results from the qfa.fit2 function, curves for the model fits are displayed per position.

Examples

#qfa.testdata was generated with the call in the Not run section
#(files not included in package)
data(qfa.testdata)
#Strip non-experimental edge cultures
qfa.testdata = qfa.testdata[(qfa.testdata$Row!=1) & (qfa.testdata$Col!=1) & (qfa.testdata$Row!=8) & (qfa.testdata$Col!=12),]
# Define which measure of cell density to use
qfa.testdata$Growth = qfa.testdata$Intensity
GmpFit = qfa.fit2(qfa.testdata, inocguess=NULL, detectThresh=0, globalOpt=F, AUCLim=NA, TimeFormat="h", Model="Gmp")
# Construct fitness measures
GmpFit = makeFitness2(GmpFit, AUCLim=NA, plotFitness="All", filename="Example_Gmp_fitness.pdf")
# Create plot
qfa.plot2("Example_Gmp_GrowthCurves.pdf", GmpFit, qfa.testdata, maxt=30)

## Not run: 
qfa.testdata = try(colonyzer.read(experiment = "SAU1ExptDescription.txt", ORF2gene = "ORF2GENE.txt",
libraries = "LibraryDescription1.txt" , screenID = "SAUtest1"))

## End(Not run)

JulBaer/baQFA documentation built on Feb. 19, 2023, 10:32 p.m.