File tree 7 files changed +87
-33
lines changed
7 files changed +87
-33
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ __merge__ : ../../api/comp_control_method.yaml
2
+
3
+ name : negative_normal
4
+ label : negative_normal
5
+ summary : A negative control which generates normal distributed data.
6
+ description : |
7
+ This control method generates normal distributed data as a negative control.
8
+ The mean and the sd are defined by the mean and sd of the input data.
9
+
10
+ resources :
11
+ - type : r_script
12
+ path : script.R
13
+
14
+ engines :
15
+ - type : docker
16
+ image : openproblems/base_r:1.0.0
17
+
18
+ runners :
19
+ - type : executable
20
+ - type : nextflow
21
+ directives :
22
+ label : [midtime, midmem, midcpu]
Original file line number Diff line number Diff line change
1
+ # # VIASH START
2
+ par <- list (
3
+ input = " resources_test/spatialsimbench_mobnew/dataset_sp.h5ad" ,
4
+ output = " simulated_dataset.h5ad"
5
+ )
6
+ meta <- list (
7
+ name = " negative_normal"
8
+ )
9
+ # # VIASH END
10
+
11
+ cat(" Reading input files\n " )
12
+ input <- anndata :: read_h5ad(par $ input )
13
+
14
+ # generate random values
15
+ n_rows <- nrow(input )
16
+ n_cols <- ncol(input )
17
+
18
+ values <- rnorm(n = n_rows * n_cols , mean = 3 , sd = 1 )
19
+
20
+ # make sure all values are positive
21
+ values [values < 0 ] <- abs(values [values < 0 ])
22
+
23
+ cat(" Generate outoput file\n " )
24
+ output <- anndata :: AnnData(
25
+ layers = list (
26
+ counts = matrix (values , nrow = n_rows , ncol = n_cols )
27
+ ),
28
+ obs = input $ obs [c(" row" , " col" )],
29
+ var = input $ var ,
30
+ uns = c(
31
+ input $ uns ,
32
+ list (
33
+ method_id = meta $ name
34
+ )
35
+ )
36
+ )
37
+
38
+ cat(" Write output files\n " )
39
+ output $ write_h5ad(par $ output , compression = " gzip" )
Original file line number Diff line number Diff line change
1
+ __merge__ : ../../api/comp_control_method.yaml
2
+
3
+ name : negative_shuffle
4
+ label : negative_shuffle
5
+ summary : A negative control method which shuffles the input data.
6
+ description : |
7
+ This control method shuffles the input data as a negative control.
8
+
9
+ resources :
10
+ - type : r_script
11
+ path : script.R
12
+
13
+ engines :
14
+ - type : docker
15
+ image : openproblems/base_r:1.0.0
16
+
17
+ runners :
18
+ - type : executable
19
+ - type : nextflow
20
+ directives :
21
+ label : [midtime, midmem, midcpu]
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ par <- list(
4
4
output = " simulated_dataset.h5ad"
5
5
)
6
6
meta <- list (
7
- name = " negative "
7
+ name = " negative_shuffle "
8
8
)
9
9
# # VIASH END
10
10
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ dependencies:
57
57
- name : methods/symsim
58
58
- name : methods/zinbwave
59
59
- name : control_methods/positive
60
- - name : control_methods/negative
60
+ - name : control_methods/negative_shuffle
61
+ - name : control_methods/negative_normal
61
62
- name : metrics/downstream
62
63
- name : metrics/ks_statistic_gene_cell
63
64
- name : metrics/ks_statistic_sc_features
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ methods = [
16
16
symsim,
17
17
zinbwave,
18
18
positive,
19
- negative
19
+ negative_shuffle,
20
+ negative_normal
20
21
]
21
22
22
23
// construct list of metrics
You can’t perform that action at this time.
0 commit comments