Skip to content

Commit

Permalink
Plink linkage disequilibrium additional output (#5388)
Browse files Browse the repository at this point in the history
* adding outputs

* output and style correction

* fixing stub

---------

Co-authored-by: Francesco Lescai <[email protected]>
  • Loading branch information
DavideBag and lescai authored Mar 26, 2024
1 parent 3234616 commit a55519e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 12 deletions.
8 changes: 6 additions & 2 deletions modules/nf-core/plink/ld/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ process PLINK_LD {
tuple val(meta4), path(snpfile)

output:
tuple val(meta), path("*.ld") , emit: ld
path "versions.yml" , emit: versions
tuple val(meta), path("*.ld") , emit: ld
tuple val(meta), path("*.log") , emit: log
tuple val(meta), path("*.nosex"), emit: nosex, optional:true
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down Expand Up @@ -83,6 +85,8 @@ process PLINK_LD {
}
"""
touch ${prefix}.ld
touch ${prefix}.log
touch ${prefix}.nosex
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
11 changes: 9 additions & 2 deletions modules/nf-core/plink/ld/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ input:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
meta is associated to phenotype files input
meta is associated to randomly selected snp files input
- bed:
type: file
description: PLINK binary biallelic genotype table file
Expand Down Expand Up @@ -76,11 +76,18 @@ output:
type: file
description: File containing software versions
pattern: "versions.yml"

- ld:
type: file
description: |
The output of a linkage disequilibrium analysis in PLINK typically includes a table showing variant pairs and their associated LD values, often expressed as R².
- log:
type: file
description: |
Log file of the ld process
- nosex:
type: file
description: |
Ambiguous sex ID file
authors:
- "@davidebag"
maintainers:
Expand Down
18 changes: 14 additions & 4 deletions modules/nf-core/plink/ld/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

nextflow_process {

name "Test Process PLINK_LD"
Expand Down Expand Up @@ -35,7 +34,11 @@ nextflow_process {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.version).match("version") },
{ assert snapshot(process.out.ld).match() }
{ assert snapshot(
process.out.ld,
process.out.nosex
).match() },
{ assert process.out.log.get(0).get(1) ==~ ".*/*.log" }
)
}
}
Expand Down Expand Up @@ -66,7 +69,10 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.ld).match() }
{ assert snapshot(
process.out.ld
).match() },
{ assert process.out.log.get(0).get(1) ==~ ".*/*.log" }
)
}
}
Expand Down Expand Up @@ -95,7 +101,11 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.ld).match() }
{ assert snapshot(
process.out.ld,
process.out.nosex
).match() },
{ assert process.out.log.get(0).get(1) ==~ ".*/*.log" }
)
}
}
Expand Down
24 changes: 20 additions & 4 deletions modules/nf-core/plink/ld/tests/main.nf.test.snap

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

0 comments on commit a55519e

Please sign in to comment.