Skip to content

Commit

Permalink
fix match_combine cache
Browse files Browse the repository at this point in the history
  • Loading branch information
nebfield committed Mar 15, 2024
1 parent 50bdfdb commit a4f8fd5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
5 changes: 0 additions & 5 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ process {
ext.args2 = "zs" // compress .sscore with zstd by default
}

withName: MATCH_COMBINE {
// don't recombine unless the file content has changed
cache = 'deep'
}

// container configuration
withLabel: pgscatalog_utils {
ext.conda = "$projectDir/environments/pgscatalog_utils/environment.yml"
Expand Down
4 changes: 2 additions & 2 deletions modules/local/match_combine.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ process MATCH_COMBINE {
def ambig = params.keep_ambiguous ? '--keep_ambiguous' : ''
def multi = params.keep_multiallelic ? '--keep_multiallelic' : ''
// output one (or more) scoring files per chromosome?
def split_output = !meta.chrom.contains("ALL") ? '--split' : ''
def split_output = meta.split ? '--split' : ''
// output one (or more) scoring file per sampleset?
def combined_output = (meta.chrom.contains("ALL") || shared.name != 'NO_FILE') ? '--combined' : ''
def combined_output = (!meta.split || shared.name != 'NO_FILE') ? '--combined' : ''
// filter match candidates to intersect with reference:
// omit multi-allelic variants in reference because these will cause errors with relabelling!...
// ... unclear whether we should remove them from target with '&& ($9 == 0') as well?
Expand Down
9 changes: 7 additions & 2 deletions subworkflows/local/match.nf
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ workflow MATCH {
}
.set { ch_intersection_grouped }

// grab first() meta object for MATCH_COMBINE
// only meta.chrom is checked to see if it's set to 'ALL' or not
ch_matches.meta.first()
// but using chrom values directly in meta map breaks cache because chrom order can differ across runs
ch_matches.meta.first().map { it ->
def split = it.chrom == "ALL"
return [split:split, id: it.id]
}.set { combine_meta }

combine_meta
.concat( ch_matches.matches.collect() )
.concat( scorefile )
.concat( ch_intersection_grouped.intersections.collect() )
Expand Down

0 comments on commit a4f8fd5

Please sign in to comment.