Skip to content

Commit 14864d7

Browse files
authored
Add gcta/reml module (#11004)
* Add gcta/reml module * Use sanitized snapshots for gcta/reml tests * Simplify gcta/reml process tag
1 parent 55d6d13 commit 14864d7

6 files changed

Lines changed: 595 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
3+
channels:
4+
- conda-forge
5+
- bioconda
6+
dependencies:
7+
- bioconda::gcta=1.94.1

modules/nf-core/gcta/reml/main.nf

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
process GCTA_REML {
2+
tag "${meta.id}_${meta2.id}"
3+
label 'process_medium'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
7+
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/46/46b0d05f0daa47561d87d2a9cac5e51edc2c78e26f1bbab439c688386241a274/data'
8+
: 'community.wave.seqera.io/library/gcta:1.94.1--9bc35dc424fcf6e9'}"
9+
10+
input:
11+
tuple val(meta), path(grm_files)
12+
tuple val(meta2), path(phenotypes_file)
13+
tuple val(meta3), path(quant_covariates_file)
14+
tuple val(meta4), path(cat_covariates_file)
15+
16+
output:
17+
tuple val(meta), path("*.hsq"), emit: reml_results
18+
tuple val("${task.process}"), val("gcta"), eval("gcta --version | sed -En 's/^[*] version v([0-9.]*).*/\\1/p'"), emit: versions_gcta, topic: versions
19+
20+
when:
21+
task.ext.when == null || task.ext.when
22+
23+
script:
24+
def args = task.ext.args ?: ''
25+
def prefix = task.ext.prefix ?: "${meta.id}"
26+
def qcovar_param = quant_covariates_file ? "--qcovar ${quant_covariates_file}" : ''
27+
def covar_param = cat_covariates_file ? "--covar ${cat_covariates_file}" : ''
28+
"""
29+
gcta \\
30+
--reml \\
31+
--grm ${meta.id} \\
32+
--pheno ${phenotypes_file} \\
33+
${qcovar_param} \\
34+
${covar_param} \\
35+
--out "${prefix}" \\
36+
--thread-num ${task.cpus} \\
37+
${args}
38+
"""
39+
40+
stub:
41+
def prefix = task.ext.prefix ?: "${meta.id}"
42+
"""
43+
touch "${prefix}.hsq"
44+
"""
45+
}

modules/nf-core/gcta/reml/meta.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
2+
name: "gcta_reml"
3+
description: Run univariate REML heritability estimation with a dense GRM
4+
keywords:
5+
- gcta
6+
- genome-wide complex trait analysis
7+
- reml
8+
- restricted maximum likelihood
9+
- grm
10+
- genetic relationship matrix
11+
- genetics
12+
tools:
13+
- "gcta":
14+
description: "Genome-wide Complex Trait Analysis (GCTA) estimates genetic relationships, variance components, and association statistics from genome-wide data."
15+
homepage: "https://yanglab.westlake.edu.cn/software/gcta/"
16+
documentation: "https://yanglab.westlake.edu.cn/software/gcta/static/gcta_doc_latest.pdf"
17+
tool_dev_url: "https://yanglab.westlake.edu.cn/software/gcta/"
18+
licence: ["GPL-3.0-only"]
19+
identifier: "biotools:gcta"
20+
input:
21+
- - meta:
22+
type: map
23+
description: |
24+
Groovy map containing dense GRM metadata
25+
`meta.id` must be the GRM basename passed to `--grm`
26+
(for example `plink_simulated_dense` for `plink_simulated_dense.grm.{id,bin,N.bin}`)
27+
- grm_files:
28+
type: file
29+
description: Dense GRM bundle containing sample identifier, binary matrix,
30+
and sample-count matrix files
31+
pattern: "*.grm.*"
32+
ontologies: []
33+
- - meta2:
34+
type: map
35+
description: |
36+
Groovy map containing phenotype metadata; should carry the same sample
37+
identity as `meta`, for example `[ id:'plink_simulated_dense' ]`
38+
- phenotypes_file:
39+
type: file
40+
description: Phenotype file passed to `--pheno`
41+
pattern: "*.{phe,pheno,txt,tsv}"
42+
ontologies:
43+
- edam: "http://edamontology.org/format_3475"
44+
- - meta3:
45+
type: map
46+
description: |
47+
Groovy map containing quantitative covariate metadata; should carry the
48+
same sample identity as `meta`, for example `[ id:'plink_simulated_dense' ]`
49+
- quant_covariates_file:
50+
type: file
51+
description: Quantitative covariates file, pass `[]` when absent
52+
pattern: "*.{covar,cov,txt,tsv}"
53+
ontologies:
54+
- edam: "http://edamontology.org/format_3475"
55+
- - meta4:
56+
type: map
57+
description: |
58+
Groovy map containing categorical covariate metadata; should carry the
59+
same sample identity as `meta`, for example `[ id:'plink_simulated_dense' ]`
60+
- cat_covariates_file:
61+
type: file
62+
description: Categorical covariates file, pass `[]` when absent
63+
pattern: "*.{covar,cov,txt,tsv}"
64+
ontologies:
65+
- edam: "http://edamontology.org/format_3475"
66+
output:
67+
reml_results:
68+
- - meta:
69+
type: map
70+
description: |
71+
Groovy map containing dense GRM metadata
72+
`meta.id` must be the GRM basename passed to `--grm`
73+
(for example `plink_simulated_dense` for `plink_simulated_dense.grm.{id,bin,N.bin}`)
74+
- "*.hsq":
75+
type: file
76+
description: REML result file
77+
pattern: "*.{hsq}"
78+
ontologies:
79+
- edam: "http://edamontology.org/format_2330"
80+
versions_gcta:
81+
- - "${task.process}":
82+
type: string
83+
description: The process the version was collected from
84+
- "gcta":
85+
type: string
86+
description: The tool name
87+
- "gcta --version | sed -En 's/^[*] version v([0-9.]*).*/\\1/p'":
88+
type: eval
89+
description: The command used to retrieve the GCTA version
90+
topics:
91+
versions:
92+
- - ${task.process}:
93+
type: string
94+
description: The process the version was collected from
95+
- gcta:
96+
type: string
97+
description: The tool name
98+
- "gcta --version | sed -En 's/^[*] version v([0-9.]*).*/\\1/p'":
99+
type: eval
100+
description: The command used to retrieve the GCTA version
101+
authors:
102+
- "@lyh970817"
103+
maintainers:
104+
- "@lyh970817"

0 commit comments

Comments
 (0)