-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8996bd
commit e5a5b10
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
__merge__: ../../api/comp_control_method.yaml | ||
|
||
name: negative | ||
label: negative | ||
summary: A negative control method. | ||
description: | | ||
A negative control method. | ||
# references: | ||
# doi: | ||
|
||
# info: | ||
# documentation_url: https://xzhoulab.github.io/SRTsim | ||
# repository_url: https://github.com/xzhoulab/srtsim | ||
|
||
resources: | ||
- type: r_script | ||
path: script.R | ||
|
||
engines: | ||
- type: docker | ||
image: openproblems/base_r:1.0.0 | ||
setup: | ||
- type: r | ||
cran: SRTsim | ||
|
||
runners: | ||
- type: executable | ||
- type: nextflow | ||
directives: | ||
label: [midtime, midmem, midcpu] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## VIASH START | ||
par <- list( | ||
input = "resources_test/datasets/MOBNEW/dataset_sp.h5ad", | ||
output = "simulated_dataset.h5ad", | ||
) | ||
meta <- list( | ||
name = "negative" | ||
) | ||
## VIASH END | ||
|
||
cat("Reading input files\n") | ||
input <- anndata::read_h5ad(par$input) | ||
|
||
count_matrix <- as.matrix(input$layers[['counts']]) | ||
|
||
n_rows <- nrow(count_matrix) | ||
n_cols <- ncol(count_matrix) | ||
|
||
random_matrix_uniform <- matrix(runif(n_rows * n_cols), nrow = n_rows, ncol = n_cols) | ||
rownames(random_matrix_uniform) <- rownames(count_matrix) | ||
|
||
cat("Generate outoput file\n") | ||
output <- anndata::AnnData( | ||
layers = list( | ||
counts = random_matrix_uniform | ||
), | ||
obs = input$obs[c("row", "col")], | ||
var = input$var, | ||
uns = c( | ||
input$uns, | ||
list( | ||
method_id = meta$name | ||
) | ||
) | ||
) | ||
|
||
cat("Write output files\n") | ||
output$write_h5ad(par$output, compression = "gzip") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
__merge__: ../../api/comp_control_method.yaml | ||
|
||
name: positive | ||
label: positive | ||
summary: A positive control method. | ||
description: | | ||
A positive control method. | ||
# references: | ||
# doi: | ||
|
||
# info: | ||
# documentation_url: https://xzhoulab.github.io/SRTsim | ||
# repository_url: https://github.com/xzhoulab/srtsim | ||
|
||
resources: | ||
- type: r_script | ||
path: script.R | ||
|
||
engines: | ||
- type: docker | ||
image: openproblems/base_r:1.0.0 | ||
setup: | ||
- type: r | ||
cran: SRTsim | ||
|
||
runners: | ||
- type: executable | ||
- type: nextflow | ||
directives: | ||
label: [midtime, midmem, midcpu] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## VIASH START | ||
par <- list( | ||
input = "resources_test/datasets/MOBNEW/dataset_sp.h5ad", | ||
output = "simulated_dataset.h5ad" | ||
) | ||
meta <- list( | ||
name = "positive" | ||
) | ||
## VIASH END | ||
|
||
cat("Reading input files\n") | ||
input <- anndata::read_h5ad(par$input) | ||
|
||
input$uns$method_id <- meta$name | ||
|
||
cat("Write output files\n") | ||
input$write_h5ad(par$output, compression = "gzip") |