% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/branchpointPlot.R
\name{plotBranchpoint}
\alias{plotBranchpoint}
\title{Plot Data On Branchpoint Layout}
\usage{
plotBranchpoint(
  object,
  branchpoint.layout,
  label,
  label.2 = NULL,
  label.type = "search",
  populations = NULL,
  visited.size = T,
  point.alpha = 0.2,
  pt.lim = NULL,
  color.scale = NULL,
  discrete.colors = NULL,
  ylab = "Pseudotime",
  xlab = "Preference",
  title = label,
  axis.lines = T,
  legend = T,
  fade.low = 0.5
)
}
\arguments{
\item{object}{An URD object}

\item{branchpoint.layout}{The output of \code{\link{branchpointPreferenceLayout}}}

\item{label}{(Character) Value to plot}

\item{label.2}{(Character) If dual-color plotting, the second value to plot.}

\item{label.type}{(Character)}

\item{populations}{(Character vector, length 2) Labels for the two populations on the x-axis.}

\item{visited.size}{(Logical) Should the size of points reflect how frequently they were visited by the random walks (to emphasize the more confident data points)}

\item{point.alpha}{(Numeric) Transparency of points}

\item{pt.lim}{(Numeric vector) Pseudotime (y) axis limits. Default \code{NULL} lets ggplot determine them automatically.}

\item{color.scale}{(Character vector) Vector of colors to use as a color scale if \code{label} is continuous values. Does not apply if a second label is given, in which case the color scale will be red-green.}

\item{discrete.colors}{(Character vector) Vector of colors to use as a color scale if \code{label} is discrete values.}

\item{ylab}{(Character) Y-axis label}

\item{xlab}{(Character) X-axis label}

\item{title}{(Character) Plot title}

\item{axis.lines}{(Logical) Plot axis lines on the plot?}

\item{legend}{(Logical) Plot an expression legend?}

\item{fade.low}{(Numeric) The transparency of the lowest expression points are 
decreased by this factor in order to prevent them from blocking the visualization 
of expressing cells if they are intermixed.}
}
\value{
A ggplot2 object
}
\description{
This plots gene expression or metadata on a branchpoint preference plot generated
by \code{\link{branchpointPreferenceLayout}}.
}
\examples{
# Plot with a discrete label -- STAGE
plotBranchpoint(object, np.layout, label="stage.nice", 
point.alpha=0.5, populations = c("P", "N"), pt.lim=c(0.7,0.1), 
xlab="", ylab="", legend=T, axis.lines = F, fade.low=0, 
discrete.colors = stage.colors[c(1,3:12)], title="Stage")

# Define genes to plot
axial.genes.plot <- c("NANOG", "TA", "NOTO", "NTD5", 
"SHHA", "COL8A1A", "MEX3B", "GSC", "FRZB", "PRDM1A", 
"ICN", "HE1A")

# Plot expression of many genes on the branchpoint 
# npreference plot in a grid
axial.branchpoint.plots <- lapply(axial.genes.plot, function(gene) 
plotBranchpoint(object, np.layout, label=gene, point.alpha=1, 
populations = c("P", "N"), pt.lim=c(0.7,0.11), color.scale = pref.colors, 
xlab="", ylab="", title=gene, legend=F, axis.lines = F, fade.low=0.66))
gridExtra::grid.arrange(grobs=axial.branchpoint.plots, ncol=6)

}
