Skip to content

Commit f02d7c0

Browse files
committed
Add gcta/bivariateremlldms module
1 parent 4b801f9 commit f02d7c0

6 files changed

Lines changed: 732 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
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
process GCTA_BIVARIATEREMLLDMS {
2+
tag "bivariate_reml_ldms_${meta.id}_${meta2.id}"
3+
label 'process_medium'
4+
conda "${moduleDir}/environment.yml"
5+
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
6+
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/46/46b0d05f0daa47561d87d2a9cac5e51edc2c78e26f1bbab439c688386241a274/data'
7+
: 'community.wave.seqera.io/library/gcta:1.94.1--9bc35dc424fcf6e9'}"
8+
9+
input:
10+
tuple val(meta), path(phenotype_file)
11+
tuple val(meta2), path(mgrm_file), path(grm_files)
12+
tuple val(meta3), path(quant_covariates_file)
13+
tuple val(meta4), path(cat_covariates_file)
14+
15+
output:
16+
tuple val(meta), path("*.hsq"), emit: bivariate_results
17+
tuple val(meta), path("*.log"), emit: log_file
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 prefix = task.ext.prefix ?: "${meta.id}"
25+
def pair_id = prefix
26+
def qcovar_param = quant_covariates_file ? "--qcovar ${quant_covariates_file}" : ''
27+
def covar_param = cat_covariates_file ? "--covar ${cat_covariates_file}" : ''
28+
def extra_args = task.ext.args ?: ''
29+
30+
"""
31+
set -euo pipefail
32+
33+
gcta \\
34+
--reml-bivar 1 2 \\
35+
--mgrm ${mgrm_file} \\
36+
--pheno "${phenotype_file}" \\
37+
${qcovar_param} \\
38+
${covar_param} \\
39+
--reml-bivar-no-constrain \\
40+
--reml-maxit 500 \\
41+
--out "${pair_id}" \\
42+
--thread-num ${task.cpus} ${extra_args}
43+
"""
44+
45+
stub:
46+
def prefix = task.ext.prefix ?: "${meta.id}"
47+
def pair_id = prefix
48+
"""
49+
touch "${pair_id}.hsq"
50+
touch "${pair_id}.log"
51+
"""
52+
}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
2+
name: "gcta_bivariateremlldms"
3+
description: Run bivariate REML-LDMS analysis with an MGRM manifest
4+
keywords:
5+
- gcta
6+
- genome-wide complex trait analysis
7+
- reml
8+
- restricted maximum likelihood
9+
- bivariate
10+
- ldms
11+
- linkage disequilibrium and minor allele frequency stratification
12+
- grm
13+
- genetic relationship matrix
14+
- genetics
15+
tools:
16+
- "gcta":
17+
description: "Genome-wide Complex Trait Analysis (GCTA) estimates genetic relationships, variance components, and association statistics from genome-wide data."
18+
homepage: "https://yanglab.westlake.edu.cn/software/gcta/"
19+
documentation: "https://yanglab.westlake.edu.cn/software/gcta/static/gcta_doc_latest.pdf"
20+
tool_dev_url: "https://yanglab.westlake.edu.cn/software/gcta/"
21+
licence: ["GPL-3.0-only"]
22+
identifier: "biotools:gcta"
23+
input:
24+
- - meta:
25+
type: map
26+
description: |
27+
Groovy map containing shared bivariate phenotype metadata
28+
`meta.id` must contain both trait names, for example `trait1__trait2`
29+
- phenotype_file:
30+
type: file
31+
description: Shared bivariate phenotype file passed to `--pheno`
32+
pattern: "*.{phe,pheno,txt,tsv}"
33+
ontologies:
34+
- edam: "http://edamontology.org/format_3475"
35+
- - meta2:
36+
type: map
37+
description: |
38+
Groovy map containing MGRM metadata
39+
e.g. `[ id:'plink_simulated_ldms' ]`
40+
- mgrm_file:
41+
type: file
42+
description: MGRM manifest file
43+
pattern: "*.mgrm"
44+
ontologies:
45+
- edam: "http://edamontology.org/format_2330"
46+
- grm_files:
47+
type: file
48+
description: GRM bundles referenced by `mgrm_file`
49+
pattern: "*.grm.*"
50+
ontologies: []
51+
- - meta3:
52+
type: map
53+
description: |
54+
Groovy map containing quantitative covariate metadata
55+
e.g. `[ id:'covariates_quant' ]`
56+
- quant_covariates_file:
57+
type: file
58+
description: Quantitative covariates file, pass `[]` when absent
59+
pattern: "*.{covar,cov,txt,tsv}"
60+
ontologies:
61+
- edam: "http://edamontology.org/format_3475"
62+
- - meta4:
63+
type: map
64+
description: |
65+
Groovy map containing categorical covariate metadata
66+
e.g. `[ id:'covariates_cat' ]`
67+
- cat_covariates_file:
68+
type: file
69+
description: Categorical covariates file, pass `[]` when absent
70+
pattern: "*.{covar,cov,txt,tsv}"
71+
ontologies:
72+
- edam: "http://edamontology.org/format_3475"
73+
output:
74+
bivariate_results:
75+
- - meta:
76+
type: map
77+
description: |
78+
Groovy map containing shared bivariate phenotype metadata
79+
`meta.id` must contain both trait names, for example `trait1__trait2`
80+
- "*.hsq":
81+
type: file
82+
description: Bivariate REML-LDMS result file
83+
pattern: "*.{hsq}"
84+
ontologies:
85+
- edam: "http://edamontology.org/format_2330"
86+
log_file:
87+
- - meta:
88+
type: map
89+
description: |
90+
Groovy map containing shared bivariate phenotype metadata
91+
`meta.id` must contain both trait names, for example `trait1__trait2`
92+
- "*.log":
93+
type: file
94+
description: Bivariate REML-LDMS log file
95+
pattern: "*.{log}"
96+
ontologies:
97+
- edam: "http://edamontology.org/format_2330"
98+
versions_gcta:
99+
- - "${task.process}":
100+
type: string
101+
description: The process the version was collected from
102+
- "gcta":
103+
type: string
104+
description: The tool name
105+
- "gcta --version | sed -En 's/^[*] version v([0-9.]*).*/\\1/p'":
106+
type: eval
107+
description: The command used to retrieve the GCTA version
108+
topics:
109+
versions:
110+
- - ${task.process}:
111+
type: string
112+
description: The process the version was collected from
113+
- gcta:
114+
type: string
115+
description: The tool name
116+
- "gcta --version | sed -En 's/^[*] version v([0-9.]*).*/\\1/p'":
117+
type: eval
118+
description: The command used to retrieve the GCTA version
119+
authors:
120+
- "@lyh970817"
121+
maintainers:
122+
- "@lyh970817"

0 commit comments

Comments
 (0)