Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MAGE_2020_Marker-Gene-Benchmarking
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioCellGen-public
MAGE_2020_Marker-Gene-Benchmarking
Commits
26000796
Commit
26000796
authored
1 year ago
by
Jeffrey Pullin
Browse files
Options
Downloads
Patches
Plain Diff
Add code to run smash method
parent
686c7b24
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
code/method-pars.R
+1
-1
1 addition, 1 deletion
code/method-pars.R
code/run-smash.R
+18
-3
18 additions, 3 deletions
code/run-smash.R
with
21 additions
and
4 deletions
.gitignore
+
2
−
0
View file @
26000796
...
...
@@ -14,3 +14,5 @@ weights
NSForest/*.csv
benchmarks
figures
smash-fork/*
This diff is collapsed.
Click to expand it.
code/method-pars.R
+
1
−
1
View file @
26000796
...
...
@@ -142,7 +142,7 @@ method_pars_data <- list(
random_pars
,
logfc_pars
,
glmgampoi_pars
,
#
smash_pars,
smash_pars
,
nsforest_pars
,
cepo_pars
,
cosg_pars
...
...
This diff is collapsed.
Click to expand it.
code/run-smash.R
+
18
−
3
View file @
26000796
...
...
@@ -13,9 +13,15 @@ run_smash <- function(sce, pars) {
Sys.setenv
(
RETICULATE_PYTHON
=
"/home/jpullin/.conda/envs/mage/bin/python"
)
library
(
reticulate
)
old_wd
<-
getwd
()
# Needed for the import statement below to work
smashpy_path
<-
here
::
here
(
"smash-fork"
)
setwd
(
smashpy_path
)
# IPython and cuda errors seem spurious.
sm
<-
import
(
"smashpy
"
)
sm
<-
sm
$
smashpy
()
sm
ashpy
<-
py_run_string
(
"from smashpy import *
"
)
sm
<-
sm
ashpy
$
smashpy
()
# Needed for AnnData conversion.
sc
<-
import
(
"scanpy"
)
...
...
@@ -50,8 +56,15 @@ run_smash <- function(sce, pars) {
pct1
=
0.75
,
pct2
=
0.5
)
# Inverse PCA to remove unimportant genes
adata
<-
sm
$
scale_filter_features
(
adata
,
n_components
=
NULL
,
# Note: For a small number of simulated datasets this function errors,
# likely dues to oddness of the simulated data. Therefore, for those
# datasets we skip this step.
tryCatch
({
adata
<-
sm
$
scale_filter_features
(
adata
,
n_components
=
NULL
,
filter_expression
=
TRUE
)
},
error
=
function
(
e
)
e
)
# Run deep neural network to locate optimal markers for classification of
# cells according to the original user annotations
...
...
@@ -92,5 +105,7 @@ run_smash <- function(sce, pars) {
validate_mgs_result
(
result
)
setwd
(
old_wd
)
list
(
time
=
time
,
result
=
result
,
raw_result
=
raw_cluster_mgs
,
pars
=
pars
)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment