Skip to content

Commit 144b13c

Browse files
committed
Rename gcta grm cutoff module
1 parent a122777 commit 144b13c

5 files changed

Lines changed: 51 additions & 43 deletions

File tree

File renamed without changes.
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
process GCTA_REMOVERELATEDSUBJECTS {
1+
process GCTA_GRMCUTOFF {
22
tag "${meta.id}"
33
label 'process_medium'
44
conda "${moduleDir}/environment.yml"
@@ -8,33 +8,34 @@ process GCTA_REMOVERELATEDSUBJECTS {
88

99
input:
1010
tuple val(meta), path(grm_files)
11+
val cutoff
1112

1213
output:
13-
tuple val(meta), path("*_unrel05.grm.*"), emit: grm_files
14-
tuple val(meta), path("*_unrel05.grm.id"), emit: keep_file
14+
tuple val(meta), path("${prefix}.grm.*"), emit: grm_files
15+
tuple val(meta), path("${prefix}.grm.id"), emit: keep_file
1516
tuple val("${task.process}"), val("gcta"), eval("gcta --version | sed -En 's/^[*] version v([0-9.]*).*/\\1/p'"), emit: versions_gcta, topic: versions
1617

1718
when:
1819
task.ext.when == null || task.ext.when
1920

2021
script:
2122
def args = task.ext.args ?: ''
22-
def prefix = task.ext.prefix ?: "${meta.id}"
23+
prefix = task.ext.prefix ?: "${meta.id}_grmcutoff"
2324
"""
2425
gcta \\
2526
--grm ${meta.id} \\
26-
--grm-cutoff 0.05 \\
27+
--grm-cutoff ${cutoff} \\
2728
--make-grm \\
28-
--out ${prefix}_unrel05 \\
29+
--out ${prefix} \\
2930
--thread-num ${task.cpus} \\
3031
${args}
3132
"""
3233

3334
stub:
34-
def prefix = task.ext.prefix ?: "${meta.id}"
35+
prefix = task.ext.prefix ?: "${meta.id}_grmcutoff"
3536
"""
36-
touch ${prefix}_unrel05.grm.id
37-
touch ${prefix}_unrel05.grm.bin
38-
touch ${prefix}_unrel05.grm.N.bin
37+
touch ${prefix}.grm.id
38+
touch ${prefix}.grm.bin
39+
touch ${prefix}.grm.N.bin
3940
"""
4041
}

modules/nf-core/gcta/removerelatedsubjects/meta.yml renamed to modules/nf-core/gcta/grmcutoff/meta.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
2-
name: "gcta_removerelatedsubjects"
3-
description: Remove related individuals from a dense GRM using `gcta --grm-cutoff`
2+
name: "gcta_grmcutoff"
3+
description: Apply a genetic relationship cutoff to a dense GRM using `gcta --grm-cutoff`
44
keywords:
55
- gcta
66
- genome-wide complex trait analysis
@@ -30,6 +30,9 @@ input:
3030
description: Dense GRM file bundle with basename `${meta.id}`
3131
pattern: "*.grm.*"
3232
ontologies: []
33+
- cutoff:
34+
type: float
35+
description: Genetic relationship cutoff value passed to `gcta --grm-cutoff`.
3336

3437
output:
3538
grm_files:
@@ -38,21 +41,21 @@ output:
3841
description: |
3942
Groovy map containing dense GRM metadata.
4043
`meta.id` remains the dense-GRM basename contract used for `--grm`.
41-
- "*_unrel05.grm.*":
44+
- "${prefix}.grm.*":
4245
type: file
4346
description: Relatedness-filtered GRM file bundle
44-
pattern: "*_unrel05.grm.*"
47+
pattern: "${prefix}.grm.*"
4548
ontologies: []
4649
keep_file:
4750
- - meta:
4851
type: map
4952
description: |
5053
Groovy map containing dense GRM metadata.
5154
`meta.id` remains the dense-GRM basename contract used for `--grm`.
52-
- "*_unrel05.grm.id":
55+
- "${prefix}.grm.id":
5356
type: file
5457
description: Keep file of unrelated individuals emitted by GCTA
55-
pattern: "*_unrel05.grm.id"
58+
pattern: "${prefix}.grm.id"
5659
ontologies: []
5760
versions_gcta:
5861
- - "${task.process}":

modules/nf-core/gcta/removerelatedsubjects/tests/main.nf.test renamed to modules/nf-core/gcta/grmcutoff/tests/main.nf.test

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
nextflow_process {
22

3-
name "Test Process GCTA_REMOVERELATEDSUBJECTS"
3+
name "Test Process GCTA_GRMCUTOFF"
44
script "../main.nf"
5-
process "GCTA_REMOVERELATEDSUBJECTS"
5+
process "GCTA_GRMCUTOFF"
66

77
tag "modules"
88
tag "modules_nfcore"
99
tag "gcta"
10-
tag "gcta/removerelatedsubjects"
10+
tag "gcta/grmcutoff"
1111
tag "gcta/makegrm"
1212

1313
setup {
@@ -58,11 +58,12 @@ nextflow_process {
5858
}
5959
}
6060

61-
test("homo_sapiens popgen - remove related individuals from dense GRM") {
61+
test("homo_sapiens popgen - apply GRM cutoff to dense GRM") {
6262
when {
6363
process {
6464
"""
6565
input[0] = GCTA_MAKEGRM_CONTRACT.out.grm_files
66+
input[1] = 0.05
6667
"""
6768
}
6869
}
@@ -75,7 +76,7 @@ nextflow_process {
7576
{ assert process.out.grm_files.get(0).get(0).id == "tiny_dense" },
7677
{
7778
def grm_row = process.out.grm_files.get(0)
78-
def expected_prefix = "${grm_row.get(0).id}_unrel05"
79+
def expected_prefix = "${grm_row.get(0).id}_grmcutoff"
7980
assert grm_row.get(1).collect { file(it).name }.sort() == [
8081
"${expected_prefix}.grm.N.bin",
8182
"${expected_prefix}.grm.bin",
@@ -90,13 +91,14 @@ nextflow_process {
9091
}
9192
}
9293

93-
test("homo_sapiens popgen - remove related individuals fails when meta.id is not GRM basename") {
94+
test("homo_sapiens popgen - GRM cutoff fails when meta.id is not GRM basename") {
9495
when {
9596
process {
9697
"""
9798
input[0] = GCTA_MAKEGRM_CONTRACT.out.grm_files.map { meta, grm_files ->
9899
[[ id:'tiny_dense_mismatched' ], grm_files]
99100
}
101+
input[1] = 0.05
100102
"""
101103
}
102104
}
@@ -109,13 +111,14 @@ nextflow_process {
109111
}
110112
}
111113

112-
test("homo_sapiens popgen - remove related individuals fails for malformed GRM tuple") {
114+
test("homo_sapiens popgen - GRM cutoff fails for malformed GRM tuple") {
113115
when {
114116
process {
115117
"""
116118
input[0] = GCTA_MAKEGRM_CONTRACT.out.grm_files.map { meta, grm_files ->
117119
[[ id:meta.id ]]
118120
}
121+
input[1] = 0.05
119122
"""
120123
}
121124
}
@@ -125,13 +128,14 @@ nextflow_process {
125128
}
126129
}
127130

128-
test("homo_sapiens popgen - remove related individuals from dense GRM - stub") {
131+
test("homo_sapiens popgen - apply GRM cutoff to dense GRM - stub") {
129132
options "-stub"
130133

131134
when {
132135
process {
133136
"""
134137
input[0] = GCTA_MAKEGRM_STUB.out.grm_files
138+
input[1] = 0.125
135139
"""
136140
}
137141
}
@@ -142,7 +146,7 @@ nextflow_process {
142146
{ assert process.out.grm_files.get(0).get(0).id == "stub_dense" },
143147
{
144148
def grm_row = process.out.grm_files.get(0)
145-
def expected_prefix = "${grm_row.get(0).id}_unrel05"
149+
def expected_prefix = "${grm_row.get(0).id}_grmcutoff"
146150
assert grm_row.get(1).collect { file(it).name }.sort() == [
147151
"${expected_prefix}.grm.N.bin",
148152
"${expected_prefix}.grm.bin",

modules/nf-core/gcta/removerelatedsubjects/tests/main.nf.test.snap renamed to modules/nf-core/gcta/grmcutoff/tests/main.nf.test.snap

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"homo_sapiens popgen - remove related individuals from dense GRM": {
2+
"homo_sapiens popgen - apply GRM cutoff to dense GRM - stub": {
33
"content": [
44
{
55
"grm_files": [
66
[
77
{
8-
"id": "tiny_dense"
8+
"id": "stub_dense"
99
},
1010
[
11-
"tiny_dense_unrel05.grm.N.bin:md5,06b73ea8bae8f1e5f5d4de33dbd2c75e",
12-
"tiny_dense_unrel05.grm.bin:md5,b1f124463eecbae86840a6651eec372d",
13-
"tiny_dense_unrel05.grm.id:md5,ca8c0bded6951fdd3bf0dddc97b6df6b"
11+
"stub_dense_grmcutoff.grm.N.bin:md5,d41d8cd98f00b204e9800998ecf8427e",
12+
"stub_dense_grmcutoff.grm.bin:md5,d41d8cd98f00b204e9800998ecf8427e",
13+
"stub_dense_grmcutoff.grm.id:md5,d41d8cd98f00b204e9800998ecf8427e"
1414
]
1515
]
1616
],
1717
"keep_file": [
1818
[
1919
{
20-
"id": "tiny_dense"
20+
"id": "stub_dense"
2121
},
22-
"tiny_dense_unrel05.grm.id:md5,ca8c0bded6951fdd3bf0dddc97b6df6b"
22+
"stub_dense_grmcutoff.grm.id:md5,d41d8cd98f00b204e9800998ecf8427e"
2323
]
2424
],
2525
"versions_gcta": [
2626
[
27-
"GCTA_REMOVERELATEDSUBJECTS",
27+
"GCTA_GRMCUTOFF",
2828
"gcta",
2929
"1.94.1"
3030
]
@@ -35,34 +35,34 @@
3535
"nf-test": "0.9.3",
3636
"nextflow": "25.10.4"
3737
},
38-
"timestamp": "2026-05-26T21:47:04.336069243"
38+
"timestamp": "2026-06-07T23:52:40.106468066"
3939
},
40-
"homo_sapiens popgen - remove related individuals from dense GRM - stub": {
40+
"homo_sapiens popgen - apply GRM cutoff to dense GRM": {
4141
"content": [
4242
{
4343
"grm_files": [
4444
[
4545
{
46-
"id": "stub_dense"
46+
"id": "tiny_dense"
4747
},
4848
[
49-
"stub_dense_unrel05.grm.N.bin:md5,d41d8cd98f00b204e9800998ecf8427e",
50-
"stub_dense_unrel05.grm.bin:md5,d41d8cd98f00b204e9800998ecf8427e",
51-
"stub_dense_unrel05.grm.id:md5,d41d8cd98f00b204e9800998ecf8427e"
49+
"tiny_dense_grmcutoff.grm.N.bin:md5,06b73ea8bae8f1e5f5d4de33dbd2c75e",
50+
"tiny_dense_grmcutoff.grm.bin:md5,b1f124463eecbae86840a6651eec372d",
51+
"tiny_dense_grmcutoff.grm.id:md5,ca8c0bded6951fdd3bf0dddc97b6df6b"
5252
]
5353
]
5454
],
5555
"keep_file": [
5656
[
5757
{
58-
"id": "stub_dense"
58+
"id": "tiny_dense"
5959
},
60-
"stub_dense_unrel05.grm.id:md5,d41d8cd98f00b204e9800998ecf8427e"
60+
"tiny_dense_grmcutoff.grm.id:md5,ca8c0bded6951fdd3bf0dddc97b6df6b"
6161
]
6262
],
6363
"versions_gcta": [
6464
[
65-
"GCTA_REMOVERELATEDSUBJECTS",
65+
"GCTA_GRMCUTOFF",
6666
"gcta",
6767
"1.94.1"
6868
]
@@ -73,6 +73,6 @@
7373
"nf-test": "0.9.3",
7474
"nextflow": "25.10.4"
7575
},
76-
"timestamp": "2026-05-26T21:47:35.414417262"
76+
"timestamp": "2026-06-07T23:52:04.979644911"
7777
}
7878
}

0 commit comments

Comments
 (0)