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
4b97052c
Commit
4b97052c
authored
4 years ago
by
Jeffrey Pullin
Browse files
Options
Downloads
Patches
Plain Diff
Add snakemake step to extract marker genes from the simulated data
parent
5eb4b4c2
No related branches found
No related tags found
No related merge requests found
Pipeline
#6426
passed
4 years ago
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Snakefile.py
+18
-2
18 additions, 2 deletions
Snakefile.py
code/extract-marker-genes.R
+23
-0
23 additions, 0 deletions
code/extract-marker-genes.R
config.yaml
+2
-0
2 additions, 0 deletions
config.yaml
with
43 additions
and
2 deletions
Snakefile.py
+
18
−
2
View file @
4b97052c
...
...
@@ -31,11 +31,17 @@ res_dirs = expand(
sim_par
=
sim_pars
)
mg_dirs
=
expand
(
config
[
"
sim_data_folder
"
]
+
"
{mg_type}-{sim_par}.rds
"
,
sim_par
=
sim_pars
,
mg_type
=
config
[
"
mg_type
"
]
)
shell
(
"
module load r/4.0.0
"
)
shell
(
"
module load snakemake/5.18.1
"
)
rule
all
:
input
:
sim_dirs
,
res_dirs
input
:
sim_dirs
,
res_dirs
,
mg_dirs
rule
simulate_data
:
priority
:
100
...
...
@@ -51,6 +57,16 @@ rule simulate_data:
sim_pars={input.sim_pars} wcs={wildcards}
"
\
{input.script} {log}
'''
rule
extract_marker_genes
:
input
:
script
=
config
[
"
code_folder
"
]
+
"
extract-marker-genes.R
"
,
sim
=
config
[
"
sim_data_folder
"
]
+
"
{sim_id}.rds
"
,
output
:
mgs
=
config
[
"
sim_data_folder
"
]
+
"
{mg_type}-{sim_id}.rds
"
log
:
config
[
"
logs_folder
"
]
+
"
extract_mgs-{mg_type}-{sim_id}.Rout
"
shell
:
'''
R CMD BATCH --no-restore --no-save
\
"
--args sim={input.sim} mg_type={wildcards.mg_type}
\
mgs={output.mgs}
"
\
{input.script} {log}
'''
rule
run_method
:
priority
:
99
input
:
script
=
config
[
"
code_folder
"
]
+
"
run-method.R
"
,
...
...
@@ -61,7 +77,7 @@ rule run_method:
log
:
config
[
"
logs_folder
"
]
+
"
run_method-{sim_id}-{method_id}.Rout
"
resources
:
mem_mb
=
lambda
wildcards
,
attempt
:
(
attempt
**
2
)
*
3000
,
time_min
=
lambda
wildcards
,
attempt
:
[
20
,
60
,
12
0
][
attempt
-
1
]
time_min
=
lambda
wildcards
,
attempt
:
[
20
,
60
,
36
0
][
attempt
-
1
]
shell
:
'''
R CMD BATCH --no-restore --no-save
\
"
--args sim={input.sim} fun={input.fun}
\
meth_pars={input.method_pars} res={output.res}
"
\
...
...
This diff is collapsed.
Click to expand it.
code/extract-marker-genes.R
0 → 100644
+
23
−
0
View file @
4b97052c
# Script to extract true marker genes from the simulation.
# Get the passed arguments from the command line via Snakemake.
args
<-
R.utils
::
commandArgs
(
trailingOnly
=
TRUE
,
asValues
=
TRUE
)
# Debugging.
print
(
args
)
source
(
here
::
here
(
"code"
,
"find-marker-genes.R"
))
sim
<-
readRDS
(
args
$
sim
)
mg_type
<-
args
$
mg_type
stopifnot
(
mg_type
%in%
c
(
"umg"
,
"sumg"
))
if
(
mg_type
==
"umg"
)
{
mgs
<-
find_unique_marker_genes
(
sim
)
}
else
{
mgs
<-
find_semi_unique_marker_genes
(
sim
)
}
saveRDS
(
mgs
,
args
$
mgs
)
This diff is collapsed.
Click to expand it.
config.yaml
+
2
−
0
View file @
4b97052c
R
:
"
/opt/R/4.0.3/bin/R"
mg_type
:
[
"
umg"
,
"
sumg"
]
code_folder
:
"
code/"
logs_folder
:
"
logs/"
...
...
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