Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@

* `novel_train`: Store only the metadata `novel_predict` needs in the model artifact, instead of a full copy of `train_mod2` (PR #47).

* `lm`: Fit every column of mod2 in one `solve()` of the normal equations instead of calling `RcppArmadillo::fastLm()` once per column. Every column shares the same design matrix, so the old loop redid an `n x n_pcs` decomposition for each of the ~229k ATAC peaks. Predictions are unchanged; `RcppArmadillo` and `pbapply` are no longer needed (PR #58).

* `novel_predict`, `simple_mlp_predict`, `ss_opm_predict`, `babel_predict`: Ask for `midgpu` rather than `gpu`. All four peak below 4 GB, so they fit the `de.NBI GPU T4 medium` flavour and no longer occupy a whole large node. The train steps stay on `gpu` (PR #58).

* `knnr_py`, `knnr_r`, `cellmapper_linear`: Ask for `highmem` rather than `midmem`, and `lowcpu` rather than `midcpu` for the latter two. `knnr_py` peaks at 82 GB and `cellmapper_linear` at 68 GB against a 50 GB request, and both were OOM-killed on the larger datasets (PR #58).

* `solution`, `zeros`: Ask for `lowmem` rather than `midmem` -- they use 0.5 GB and 11 GB of the 50 GB they asked for (PR #58).

## BUG FIXES

* `guanlab_dengkw_pm`: Restore the consensus scheme of the original submission -- five reshuffles of the batches into two halves, ten kernel ridge models averaged. The port had replaced it with a single fixed two-way split for ADT pairs and leave-one-batch-out otherwise, so the result depended on the order the batches happened to come in. `--n_repeats` and `--seed` are now arguments; the unused `--distance_method` and `--n_pcs` are gone (PR #32).
Expand Down
2 changes: 1 addition & 1 deletion common
2 changes: 1 addition & 1 deletion src/control_methods/solution/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [midtime, midmem, lowcpu]
label: [midtime, lowmem, lowcpu]
2 changes: 1 addition & 1 deletion src/control_methods/zeros/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [midtime, midmem, lowcpu]
label: [midtime, lowmem, lowcpu]
2 changes: 1 addition & 1 deletion src/methods/babel/babel_predict/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [highmem, hightime, midcpu, gpu]
label: [highmem, hightime, midcpu, midgpu]
2 changes: 1 addition & 1 deletion src/methods/cellmapper_linear/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [midtime,midmem,midcpu]
label: [midtime, highmem, lowcpu]
2 changes: 1 addition & 1 deletion src/methods/knnr_py/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [hightime, midmem, midcpu]
label: [hightime, highmem, midcpu]
2 changes: 1 addition & 1 deletion src/methods/knnr_r/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [hightime, midmem, midcpu]
label: [hightime, highmem, lowcpu]
2 changes: 1 addition & 1 deletion src/methods/lm/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ engines:
image: openproblems/base_r:1
setup:
- type: r
cran: [ lmds, RcppArmadillo, pbapply]
cran: [ lmds ]
runners:
- type: executable
- type: nextflow
Expand Down
21 changes: 5 additions & 16 deletions src/methods/lm/script.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
cat("Loading dependencies\n")
requireNamespace("anndata", quietly = TRUE)
requireNamespace("pbapply", quietly = TRUE)
library(Matrix, warn.conflicts = FALSE, quietly = TRUE)

## VIASH START
Expand Down Expand Up @@ -42,24 +41,14 @@ gc()
cat("Reading mod2 files\n")
X_mod2 <- anndata::read_h5ad(par$input_train_mod2)$layers[["normalized"]]

cat("Predicting for each column in modality 2\n")
preds <- pbapply::pblapply(
seq_len(ncol(X_mod2)),
function(i) {
y <- X_mod2[, i]
uy <- unique(y)
if (length(uy) > 1) {
fit <- RcppArmadillo::fastLm(dr_train, y)
# fit <- lm(y ~ ., dr_train)
stats::predict(fit, dr_test)
} else {
rep(uy, nrow(dr_test))
}
}
cat("Predicting every column in modality 2 at once\n")
coefficients <- solve(
crossprod(dr_train),
as.matrix(crossprod(dr_train, X_mod2))
)

cat("Creating outputs object\n")
prediction <- Matrix::Matrix(do.call(cbind, preds), sparse = TRUE)
prediction <- Matrix::Matrix(dr_test %*% coefficients, sparse = TRUE)
rownames(prediction) <- rownames(dr_test)
colnames(prediction) <- colnames(X_mod2)

Expand Down
2 changes: 1 addition & 1 deletion src/methods/novel/novel_predict/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ runners:
- type: executable
- type: nextflow
directives:
label: [highmem, hightime, midcpu, highsharedmem, gpu]
label: [highmem, hightime, midcpu, highsharedmem, midgpu]

2 changes: 1 addition & 1 deletion src/methods/simple_mlp/simple_mlp_predict/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [highmem, hightime, midcpu, gpu, highsharedmem]
label: [highmem, hightime, midcpu, midgpu, highsharedmem]
2 changes: 1 addition & 1 deletion src/methods/ss_opm/ss_opm_predict/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [highmem, hightime, midcpu, highsharedmem, gpu]
label: [highmem, hightime, midcpu, highsharedmem, midgpu]
Loading