Skip to content

Commit

Permalink
Expose perplexity
Browse files Browse the repository at this point in the history
  • Loading branch information
pcm32 committed Jul 10, 2020
1 parent f546f14 commit fe25f04
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
15 changes: 15 additions & 0 deletions r-seurat-scripts-post-install-tests.bats
Expand Up @@ -179,6 +179,21 @@
[ -f "$tsne_seurat_object" ]
}

# Run t-SNE with perplexity

@test "Run-tSNE analysis" {
if [ "$use_existing_outputs" = 'true' ] && [ -f "$tsne_seurat_object" ]; then
skip "$tsne_seurat_object exists and use_existing_outputs is set to 'true'"
fi

run rm -f $tsne_seurat_object && seurat-run-tsne.R -i $pca_seurat_object -r $reduction_type -d $dims_use -e NULL -o $tsne_seurat_object -b $tsne_embeddings_file --perplexity 20
echo "status = ${status}"
echo "output = ${output}"

[ "$status" -eq 0 ]
[ -f "$tsne_seurat_object" ]
}

# Run marker detection

@test "Find markers for each cluster" {
Expand Down
10 changes: 9 additions & 1 deletion seurat-run-tsne.R
Expand Up @@ -46,6 +46,13 @@ option_list = list(
type = 'character',
help = 'Select the method to use to compute the tSNE. Available methods are: Rtsne, Flt-SNE'
),
make_option(
c("--perplexity"),
action = "store",
default = NULL,
type = 'integer',
help = 'Perplexity value for tSNE, if none is set, the default from seurat is used.'
),
make_option(
c("-c", "--cells-use"),
action = "store",
Expand Down Expand Up @@ -176,7 +183,8 @@ tsne_seurat_object <- RunTSNE( seurat_object,
cells = cells_use,
dims = dims_use,
seed.use = opt$random_seed,
add.iter = opt$add_iter,
add.iter = opt$add_iter,
perplexity = opt$perplexity,
reduction.key = opt$reduction_key,
reduction.name = opt$reduction_name,
features = genes_use
Expand Down

0 comments on commit fe25f04

Please sign in to comment.