pd_predictAndPlot2: Title

View source: R/dMod-pd.R

pd_predictAndPlot2R Documentation

Title

Description

Title

Usage

pd_predictAndPlot2(
  pd,
  pe = pd$pe,
  i,
  j,
  opt.base = pd_parf_opt.base(),
  opt.mstrust = pd_parf_opt.mstrust(),
  opt.profile = pd_parf_opt.profile(FALSE),
  opt.L1 = pd_parf_opt.L1(FALSE),
  parf = NULL,
  NFLAGsubsetType = c(none = 0, strict = 1, keepInternal = 2, strict_cutTimes = 3,
    keepInternal_cutTimes = 3)["strict_cutTimes"],
  FLAGsummarizeProfilePredictions = TRUE,
  FLAGmeanLine = FALSE,
  nrow = 4,
  ncol = 5,
  aeslist = petab_plotHelpers_aeslist(),
  ggCallback = list(),
  opt.sim = list(Ntimes_gt5ParSetIds = 100, predtimes = NULL),
  opt.gg = list(ribbonAlpha = 0.2),
  FLAGreturnPlotData = FALSE,
  ...
)

Arguments

pd
pe

to draw other data

i
j
opt.base
opt.mstrust
opt.profile
opt.L1
parf

parframe to simulate with. if supplied, opt.base,opt.mstrust,opt.profile are meaningless

NFLAGsubsetType

subset species, observableId, conditionId and "time".

  • 0 none : no subsetting

  • 1 strict : Only show predictions for conditions where there is data

  • 2 keepInternal : For observableIds match conditionIds to data, for internal species, no subsetting

  • 3 strict_cutTimes : as 1, but cut time to data for observableIds

  • 4 keepInternal_cutTimes: as 2, but cut time to data for observableIds

FLAGsummarizeProfilePredictions

summarize predictions based on profile likelihoods by ribbon

FLAGmeanLine

draw line for mean(data)

nrow
ncol
aeslist

list of aestheticss

ggCallback

list(ggplot2 calls), e.g. list(labs(title = "bla"), scale_y_log10())

opt.sim
opt.gg
FLAGreturnPlotData

return list(data.tables) which go into plotting instead of ggplot

...

Value

ggplot

Author(s)

Daniel Lill (daniel.lill@physik.uni-freiburg.de)

Examples

pd <- petab_exampleRead("04", "pd")
# Show first two steps ( second step occurs at fitrank = 6)
pd_predictAndPlot2(pd, opt.base = pd_parf_opt.base(F), opt.mstrust = pd_parf_opt.mstrust(fitrankRange = 1:6), nrow = 2, ncol = 2)
# Show only subset of conditions and observables and time
pd_predictAndPlot2(pd, i = conditionId == "C1" & observableId != "obsES" & time > 2,  opt.base = pd_parf_opt.base(F), opt.mstrust = pd_parf_opt.mstrust(fitrankRange = 1:6), nrow = 2, ncol = 2)
# Supply own parframe for simulation
parf <- pd$result$base
parf$S <- 5
parf$parameterSetId<-"modifiedBase"
pd_predictAndPlot2(pd, parf = parf, nrow = 2, ncol = 2)
# NFLAGsubsetType (implement examples with states without observables)

# return plotting data to customize your own plot
pd_predictAndPlot2(pd, parf = parf, nrow = 2, ncol = 2, FLAGreturnPlotData = TRUE)
# When profiles are available, try this: pd_parf_opt.profile(TRUE)

# ggCallback - add layers to your plot (separated by ,, not by +)
pd_predictAndPlot2(pd, parf = parf, nrow = 2, ncol = 2, ggCallback = list(geom_hline(yintercept = 0, linetype = 2, color = "pink", size = 2), scale_color_brewer(palette = "Reds"), labs(title = "Hey Putin, stop this bullshit")))

# aeslist - change aesthetics
pd_predictAndPlot2(pd, parf = parf, nrow = 2, ncol = 2, 
aeslist = petab_plotHelpers_aeslist(x=~conditionId, color = ~time), # for nice dose response, set to the dose variable in experimentalCondition and reset the group aesthetic as well
ggCallback = list(geom_hline(yintercept = 0, linetype = 2, color = "pink", size = 2), scale_color_distiller(palette = "Blues")))

dlill/petab documentation built on Oct. 9, 2022, 3:07 p.m.