Skip to content

Commit

Permalink
Fix bcftools merge (genomic-medicine-sweden#43)
Browse files Browse the repository at this point in the history
Fix bcftools merge
---------

Co-authored-by: Anders Jemt <[email protected]>
  • Loading branch information
fellen31 and jemten authored Mar 27, 2024
1 parent dac7bee commit 6f9f9e4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 73 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Initial release of genomic-medicine-sweden/skierfe, created with the [nf-core](h

### `Fixed`

- Fix BCFTools merge module inputs [#43](https://github.com/genomic-medicine-sweden/skierfe/pull/43)

### `Dependencies`

### `Deprecated`
6 changes: 4 additions & 2 deletions conf/modules/repeat_calling.config
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ process {
}

withName: BCFTOOLS_MERGE {
ext.args = "--output-type b"

ext.args = '--output-type b'

publishDir = [
path: { "${params.outdir}/repeat_analysis/trgt/processed/${meta.id}" },
path: { "${params.outdir}/repeat_analysis/bcftools/merge/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
Expand Down
3 changes: 1 addition & 2 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"bcftools/merge": {
"branch": "master",
"git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09",
"installed_by": ["modules"],
"patch": "modules/nf-core/bcftools/merge/bcftools-merge.diff"
"installed_by": ["modules"]
},
"bcftools/norm": {
"branch": "master",
Expand Down
38 changes: 0 additions & 38 deletions modules/nf-core/bcftools/merge/bcftools-merge.diff

This file was deleted.

9 changes: 3 additions & 6 deletions modules/nf-core/bcftools/merge/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 6 additions & 25 deletions subworkflows/local/repeat_analysis.nf
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,14 @@ workflow REPEAT_ANALYSIS {

BCFTOOLS_SORT_TRGT.out.vcf
.join(BCFTOOLS_INDEX_TRGT.out.csi)
.set{ ch_bcftools_query_in }

ch_bcftools_query_in
.map{[['id':'multisample'],it[1]]}
.groupTuple()
.set{ vcfs }

ch_bcftools_query_in
.map{[['id':'multisample'],it[2]]}
.toList()
.filter { it.size() > 1 }
.flatMap()
.map { meta, bcf, csi -> [ [ id : 'multisample' ], bcf, csi ] }
.groupTuple()
.set{ csis }

vcfs
.cross(csis)
.map{[it[0][0], it[0][1], it[1][1]]}
.set{ch_bcftools_merge_in}

// BCFTools merge fails if only one file is provided in arguments,
// therefore make a list of all files to be merged and provide it

ch_bcftools_merge_in
.map{ meta, vcf, index -> vcf.name.toString().replaceAll("[\\[\\]]", "") }
.collectFile(name: 'bcftools_merge_samples.txt', newLine: true)
.map{ file_list -> [ [:], file_list ] }
.set{ ch_bcftools_file_list }
.set{ ch_bcftools_merge_in }

BCFTOOLS_MERGE(ch_bcftools_merge_in, ch_fasta, ch_fai, [], ch_bcftools_file_list )
BCFTOOLS_MERGE ( ch_bcftools_merge_in, ch_fasta, ch_fai, [] )

ch_versions = ch_versions.mix(TRGT.out.versions)
ch_versions = ch_versions.mix(SAMTOOLS_SORT_TRGT.out.versions)
Expand Down

0 comments on commit 6f9f9e4

Please sign in to comment.