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

49 Add filtering to merge module to exclude known failures #54

Merged
merged 3 commits into from
May 30, 2024
Merged
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
13 changes: 12 additions & 1 deletion modules/merge-sce/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// module parameters
params.reuse_merge = false
params.max_merge_libraries = 75 // maximum number of libraries to merge (current number is a guess, based on 59 working, but 104 not)
params.num_hvg = 2000 // number of HVGs to select

// merge workflow variables
Expand Down Expand Up @@ -131,13 +132,23 @@ workflow merge_sce {
def library_ids = processed_files.collect{it.name.replace('_processed.rds', '')}
return [project_id, library_ids, processed_files]
}
.branch{
// check the number of libraries
mergeable: it[1].size() < params.max_merge_libraries
oversized: true
}

project_branch.multiplexed
.subscribe{
log.warn("Not merging ${it[0]} because it contains multiplexed libraries.")
}

libraries_branch = libraries_ch
libraries_ch.oversized
.subscribe{
log.warn("Not merging ${it[0]} because it has too many libraries.")
}

libraries_branch = libraries_ch.mergeable
.branch{
has_merge: file("${publish_merge_base}/${it[0]}/${it[0]}_merged.rds").exists() && params.reuse_merge
make_merge: true
Expand Down