Skip to content

Commit

Permalink
Update cellranger multi to use fromState and toState (#609)
Browse files Browse the repository at this point in the history
* Update cellranger multi to use fromState and toState

* Add CHANGELOG entry
  • Loading branch information
DriesSchaumont authored Oct 31, 2023
1 parent d40f041 commit b6ca0af
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ This project now uses viash version 0.8.0 to build components and workflows. Mov

* Refactored `rna_multisample` pipeline to use `fromState` and `toState` functionality (PR #607).

* Refactored `cellranger_multi` workflow to use `fromState` and `toState` functionality (PR #609).

# openpipelines 0.12.0

## BREAKING CHANGES
Expand Down
4 changes: 2 additions & 2 deletions src/workflows/ingestion/cellranger_multi/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export NXF_VER=22.10.3

nextflow \
run . \
-main-script workflows/ingestion/cellranger_multi/main.nf \
-main-script src/workflows/ingestion/cellranger_multi/main.nf \
-entry test_wf \
-resume \
-profile docker,no_publish \
-c workflows/utils/labels_ci.config \
-c src/workflows/utils/labels_ci.config \
-with-trace work/trace.txt
41 changes: 21 additions & 20 deletions src/workflows/ingestion/cellranger_multi/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ workflow run_wf {
main:
output_ch = input_ch
| preprocessInputs("config": config)
// split params for downstream components
| setWorkflowArguments(
cellranger_multi: [
| cellranger_multi.run(
fromState: [
"input": "input",
"output": "output_raw",
"cell_multiplex_sample_id": "cell_multiplex_sample_id",
"cell_multiplex_oligo_ids": "cell_multiplex_oligo_ids",
"cell_multiplex_description": "cell_multiplex_description",
"gex_reference": "gex_reference",
"feature_reference": "feature_reference",
"vdj_reference": "vdj_reference",
"gex_expect_cells": "gex_expect_cells",
"gex_chemistry": "gex_chemistry",
"gex_secondary_analysis": "gex_secondary_analysis",
Expand All @@ -46,26 +49,24 @@ workflow run_wf {
"library_lanes": "library_lanes",
"vdj_inner_enrichment_primers": "vdj_inner_enrichment_primers"
],
from_cellranger_multi_to_h5mu: [
"output": "output_h5mu",
"uns_metrics": "uns_metrics"
]
toState: [
"output_raw": "output",
"input": "output"
],
auto: [ publish: true ]
)

| getWorkflowArguments(key: "cellranger_multi")
| cellranger_multi.run(auto: [ publish: true ])
| pmap {id, data ->
def new_data = ["input": data.output]
[id, new_data]
}
| from_cellranger_multi_to_h5mu.run(
auto: [ publish: true ],
args: [ output_compression: "gzip" ]
fromState: {id, state ->
[
"input": state.input,
"output": state.output_h5mu,
"uns_metrics": state.uns_metrics,
"output_compression": "gzip"
]
},
toState: ["output_h5mu": "output"],
auto: [ publish: true ],
)
| pmap { id, data, output_data ->
[ id, output_data + [h5mu: data.output] ]
}


emit:
output_ch
Expand Down

0 comments on commit b6ca0af

Please sign in to comment.