This function will fit a supervised trajectory in a lower dimensional space that
can then be used for downstream analyses.

addTrajectory(
ArchRProj = NULL,
name = "Trajectory",
trajectory = NULL,
groupBy = "Clusters",
reducedDims = "IterativeLSI",
embedding = NULL,
preFilterQuantile = 0.9,
postFilterQuantile = 0.9,
useAll = FALSE,
dof = 250,
spar = 1,
force = FALSE,
seed = 1,
logFile = createLogFile("addTrajectory")
)

## Arguments

ArchRProj |
An `ArchRProject` object. |

name |
A string indicating the name of the fitted trajectory to be added in `cellColData` . |

trajectory |
The order of cell groups to be used for constraining the initial supervised fitting procedure.
For example, to get a trajectory from Cluster1 to Cluster2 to Cluster3, input should be c("Cluster1", "Cluster2", "Cluster3").
Cells will then be used from these 3 groups to constrain an initial fit in the group order. |

groupBy |
A string indicating the column name from `cellColData` that contains the cell group definitions used in
`trajectory` to constrain the initial supervised fitting procedure. |

reducedDims |
A string indicating the name of the `reducedDims` object from the `ArchRProject` that should be used for distance computation. |

embedding |
A string indicating the name of the `embedding` object from the `ArchRProject` that should be used for distance computation. |

preFilterQuantile |
Prior to the initial supervised trajectory fitting, cells whose euclidean distance from the cell-grouping
center is above the provided quantile will be excluded. |

postFilterQuantile |
After initial supervised trajectory fitting, cells whose euclidean distance from the cell-grouping center
is above the provided quantile will be excluded. |

useAll |
A boolean describing whether to use cells outside of trajectory groups for post-fitting procedure. |

dof |
The number of degrees of freedom to be used in the spline fit. See `stats::smooth.spline()` for more information. |

spar |
The sparsity to be used in the spline fit. See `stats::smooth.spline()` for more information. |

force |
A boolean value indicating whether to force the trajactory indicated by `name` to be overwritten if it already exists in the given `ArchRProject` . |

seed |
A number to be used as the seed for random number generation for trajectory creation. |

logFile |
The path to a file to be used for logging ArchR output. |