Skip to content

Commit

Permalink
Merge pull request #107 from AlexsLemonade/jashapiro/slim-sim
Browse files Browse the repository at this point in the history
  • Loading branch information
jashapiro authored Nov 21, 2024
2 parents 8cfff66 + 6815ddc commit 2380ae2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/simulate-sce/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This workflow is designed to simulate single cell data, primarily using the [spl

Scripts are derived from the the `simulate-sce` module of the [OpenScPCA-analysis](https://github.com/AlexsLemonade/OpenScPCA-analysis) repository.

Permalink to the version used: https://github.com/AlexsLemonade/OpenScPCA-analysis/tree/714282f90979400528a213b11ea71718bdd3527c/analyses/simulate-sce
Permalink to the version used: https://github.com/AlexsLemonade/OpenScPCA-analysis/tree/a3d8a2c9144e8edb3894a7beeb89cdc6c3e6d681/analyses/simulate-sce
11 changes: 8 additions & 3 deletions modules/simulate-sce/resources/usr/bin/simulate-sce.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,16 @@ simulate_sce <- function(sce, ncells, replacement_metadata, processed) {
# reduce the cell type data matrices, if present
if (!is.null(metadata(sce_sim)$singler_results)) {
sim_cells <- cell_subset[cell_subset %in% rownames(metadata(sce_sim)$singler_results)]
metadata(sce_sim)$singler_results <- metadata(sce_sim)$singler_results[sim_cells, ]
singler_results <- metadata(sce_sim)$singler_results[sim_cells, ]
# remove any gene data present to save space
metadata(singler_results)$de.genes <- NULL
metadata(singler_results)$common.genes <- NULL
metadata(sce_sim)$singler_results <- singler_results
}
if (!is.null(metadata(sce_sim)$cellassign_predictions)) {
sim_cells <- cell_subset[cell_subset %in% rownames(metadata(sce_sim)$cellassign_predictions)]
metadata(sce_sim)$cellassign_predictions <- metadata(sce_sim)$cellassign_predictions[sim_cells, ]
cellassign_subset <- metadata(sce_sim)$cellassign_predictions |>
dplyr::filter(barcode %in% cell_subset)
metadata(sce_sim)$cellassign_predictions <- cellassign_subset
}

# Adjust cluster/cell type labels --------------------------------------------
Expand Down

0 comments on commit 2380ae2

Please sign in to comment.