% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Pseudotime.R
\name{GeneTrendCurve.Palantir}
\alias{GeneTrendCurve.Palantir}
\alias{GeneTrendCurve.Slingshot}
\title{Visualize Gene Expression Dynamics Along Differentiation Trajectories}
\usage{
GeneTrendCurve.Palantir(
  seu,
  features,
  pseudotime.data = "Pseudotime",
  magic = FALSE,
  method = c("smooth", "gam"),
  point = FALSE,
  line.size = NULL,
  pt.alpha = 0.3,
  pt.size = 1,
  ncol = NULL,
  se = TRUE,
  conda_env = "seuratextend"
)

GeneTrendCurve.Slingshot(
  seu,
  features,
  pseudotime.data = "PCA",
  magic = FALSE,
  method = c("smooth", "gam"),
  point = FALSE,
  line.size = NULL,
  pt.alpha = 0.3,
  pt.size = 1,
  ncol = NULL,
  se = TRUE,
  conda_env = "seuratextend"
)
}
\arguments{
\item{seu}{A Seurat object that has undergone pseudotime analysis with either Palantir or Slingshot, containing necessary gene expression data and pseudotime calculations.}

\item{features}{A vector of gene names whose expression trends will be plotted along the pseudotime axis.}

\item{pseudotime.data}{The name of the slot within `seu@misc` where pseudotime data is stored or a data.frame containing pseudotime information; for Palantir, this is typically 'Pseudotime', and for Slingshot, 'PCA'.}

\item{magic}{Logical indicating whether to use denoised gene expression data for plotting, obtained via MAGIC. Requires prior execution of Palantir.Magic() if set to TRUE. Default: FALSE.}

\item{method}{The method used to smooth and visualize gene expression trends. Can be either "smooth" or "gam" to choose between simple moving averages or generalized additive models, respectively. Default: c("smooth", "gam").}

\item{point}{Logical indicating whether to plot raw data points on top of the smoothed expression curves. Default: FALSE.}

\item{line.size}{Size of the line used for plotting the gene expression trends. Default: NULL.}

\item{pt.alpha}{Opacity of the plotted points if `point = TRUE`. Default: 0.3.}

\item{pt.size}{Size of the plotted points if `point = TRUE`. Default: 1.}

\item{ncol}{Number of columns in the plot layout if multiple genes are plotted. Default: NULL.}

\item{se}{Logical indicating whether to include confidence intervals around the smoothed trends. Default: TRUE.}

\item{conda_env}{Name of the Conda environment where necessary Python dependencies are installed for operations that require Python. Default: 'seuratextend'.}
}
\value{
A ggplot object displaying gene expression trends along computed pseudotime trajectories.
}
\description{
This function set provides tools to visualize smoothed gene expression trends along developmental trajectories derived from pseudotime analyses. GeneTrendCurve.Palantir() uses pseudotime results from Palantir, while GeneTrendCurve.Slingshot() utilizes outputs from Slingshot for similar purposes. These visualizations help elucidate the dynamics of gene expression as cells differentiate and develop.
}
\details{
GeneTrendCurve.Palantir() and GeneTrendCurve.Slingshot() are designed for researchers looking to understand how gene expression changes over the course of cellular development, providing clear visualizations that highlight trends and variations in gene expression along calculated trajectories. Each function tailors its approach based on the source of pseudotime data, ensuring that the visualizations are closely aligned with the underlying data and pseudotime analysis results.
}
\examples{
library(Seurat)
library(SeuratExtend)

# Load an example Seurat Object
mye_small <- readRDS(url("https://zenodo.org/records/10944066/files/pbmc10k_mye_small_velocyto.rds", "rb"))

# Calculate diffusion map and pseudotime using Palantir
mye_small <- Palantir.RunDM(mye_small)
mye_small <- Palantir.Pseudotime(mye_small, start_cell = "sample1_GAGAGGTAGCAGTACG-1")

# Basic gene trend curve visualization
GeneTrendCurve.Palantir(mye_small, features = c("CD14", "FCGR3A"))

# Customizing gene trend curves with Palantir
ps <- mye_small@misc$Palantir$Pseudotime
colnames(ps)[3:4] <- c("fate1", "fate2")
GeneTrendCurve.Palantir(mye_small, pseudotime.data = ps, features = c("CD14", "FCGR3A"), point = TRUE, se = FALSE)

# Run Slingshot
mye_small <- RunSlingshot(mye_small, group.by = "cluster", start.clus = "Mono CD14")

# Using Slingshot for similar visualizations
GeneTrendCurve.Slingshot(mye_small, features = c("CD14", "FCGR3A"))

}
