Skip to contents

Plot the Fitted Model

Usage

plot_result(
  para,
  t,
  color,
  marginal,
  flag,
  y1,
  gene_name,
  hill_only,
  save_dir = NULL
)

Arguments

para

A numeric vector of the Estimated parameters of the predefined distribution, length equals 6 or 7 depending on distribution(take 6 for Poisson or ZIP or Gaussian, 7 for NB and ZINB)

t

A numeric vector of the input normalized pseudotime data of a given gene, length equals the numbers of cells

color

A string vector of length 4 to define plot color

marginal

A string of the distribution name. One of Poisson, ZIP, NB, ZINB, and Gaussian.

flag

A boolean variable, flag=T indicates Valley shape, flag=F indicates Hill shape

y1

A vector of integers, representing the input expression counts of a given gene, length equals the numbers of cells

gene_name

A vector of strings, indicates the genes' name used in the model, shown in plotting

hill_only

A logical vector, determine whether the curve is hill only or not.

save_dir

A vector of strings, indicates saving path of plots, default=NULL(does not save)

Value

A ggplot object

Author

Shiyu Ma, Lehan Zou

Examples

data("df")
t<-df$Time
color<-c('red', 'darkviolet', 'orange', 'darkgreen')

#Case1
flag<-FALSE
para<-c(2.29,3.27,11.79,0.58,30.4,60.82)
y1<-df$Gene1
gene_name<-"Gene1"
marginal<-"ZIP"
plot_result(para, t, color, marginal, flag, y1, gene_name,"~/Desktop/Jessica_lab/scGTM_result/")
#> Error in !hill_only: invalid argument type

#Case2
flag<-TRUE
para<-c(2.96143,3.769441,2.098308,0.4638821,2.971249,-2.451574)
y1<-df$Gene11
gene_name<-"Gene11"
marginal<-"ZIP"
plot_result(para, t, color, marginal, flag, y1, gene_name,"~/Desktop/Jessica_lab/scGTM_result/")
#> Error in !hill_only: invalid argument type

#Case3
flag<-FALSE
para<-c(2.35,6.27,6.27,0.49)
y1<-df$Gene1
gene_name<-"Gene1"
marginal<-"Gaussian"
plot_result(para, t, color, marginal, flag, y1, gene_name,"~/Desktop/Jessica_lab/scGTM_result/")
#> Error in !hill_only: invalid argument type