Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove grouping bottleneck #42

Merged
merged 3 commits into from
Jan 21, 2025
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
9 changes: 6 additions & 3 deletions src/data_processors/process_integration/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ workflow run_wf {

// group by original dataset id
| map{id, state ->
[state.prevId, state]
// groupKey() allows us to set a size for each group based on the state
// which means each group can continue once it is complete
[groupKey(state.prevId, state.resolutions.size()), state]
}
| groupTuple()
// Group and sort by resolution to ensure the order is consistent
| groupTuple(sort: { res1, res2 -> res1.resolution <=> res2.resolution })

// merge the clustering results into one state
| map{ id, states ->
Expand All @@ -60,7 +63,7 @@ workflow run_wf {
def clusterings = states.collect { it.output_clustering }
def newState = states[0] + ["clusterings": clusterings]

[id, newState]
[id.toString(), newState]
}

// merge clustering results into dataset h5ad
Expand Down
3 changes: 2 additions & 1 deletion src/workflows/run_benchmark/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ workflow run_wf {
fromState: [
input_integrated: "method_output",
input_dataset: "input_dataset",
expected_method_types: "method_types"
expected_method_types: "method_types",
resolutions: "resolutions"
],
toState: { id, output, state ->
// Add method types to the state
Expand Down
Loading