Skip to content

Adding TSCAN Trajectory function to the package#91

Open
lobanovav wants to merge 2 commits into
DEVfrom
DEV_trajectory
Open

Adding TSCAN Trajectory function to the package#91
lobanovav wants to merge 2 commits into
DEVfrom
DEV_trajectory

Conversation

@lobanovav
Copy link
Copy Markdown
Member

Introducing TSCAN Trajectory function from NIDAP 1.0 beta template into SCWorkflow package for compatibility with existing analyses

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new TSCAN-based trajectory analysis entry point to SCWorkflow (ported from the NIDAP 1.0 beta template) and introduces minimal tests around basic argument validation and smoke-running.

Changes:

  • Introduces Trajectory_CellTypes() implementing a TSCAN/TrajectoryUtils pseudotime workflow with plotting side effects.
  • Adds a new testthat file covering missing cluster column, invalid argument types, and a minimal “runs without error” case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
R/Trajectory_CellTypes_v12.R Adds the new TSCAN trajectory function plus internal helpers.
tests/testthat/test-Trajectory_CellTypes_v12.R Adds tests for basic validation and a minimal run path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +35 to +40
required_packages <- c(
"Seurat", "scater", "scran", "scuttle", "TrajectoryUtils", "TSCAN",
"ggplot2", "gridExtra", "mclust",
"SingleCellExperiment", "SummarizedExperiment"
)
ensure_namespace(required_packages)
Comment on lines +30 to +34
#' @export
Trajectory_CellTypes <- function(Seurat_Object,
MetaData,
Clusters_to_Use,
Custom_Gene_List = NULL) {
Comment thread R/Trajectory_CellTypes_v12.R Outdated
Comment thread R/Trajectory_CellTypes_v12.R
Comment thread R/Trajectory_CellTypes_v12.R
Comment on lines +196 to +210
scater::plotHeatmap(
sce[, on_first_path],
order_columns_by = "Pseudotime",
colour_columns_by = "label",
features = head(top_up, 50),
center = TRUE,
main = "Expression of the top 50 genes that increase with pseudotime"
)
scater::plotHeatmap(
sce[, on_first_path],
order_columns_by = "Pseudotime",
colour_columns_by = "label",
features = head(top_down, 50),
center = TRUE,
main = "Expression of the top 50 genes that decrease with pseudotime"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this "AS IS" for compatibility purposes, but worth looking into

Comment thread tests/testthat/test-Trajectory_CellTypes_v12.R
Fixing R_USER_CACHE_DIR in read-only scenario

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants