Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/nf-core/gcta/reml/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::gcta=1.94.1
45 changes: 45 additions & 0 deletions modules/nf-core/gcta/reml/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process GCTA_REML {
tag "${meta.id}_${meta2.id}"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/46/46b0d05f0daa47561d87d2a9cac5e51edc2c78e26f1bbab439c688386241a274/data'
: 'community.wave.seqera.io/library/gcta:1.94.1--9bc35dc424fcf6e9'}"

input:
tuple val(meta), path(grm_files)
tuple val(meta2), path(phenotypes_file)
tuple val(meta3), path(quant_covariates_file)
tuple val(meta4), path(cat_covariates_file)

output:
tuple val(meta), path("*.hsq"), emit: reml_results
tuple val("${task.process}"), val("gcta"), eval("gcta --version | sed -En 's/^[*] version v([0-9.]*).*/\\1/p'"), emit: versions_gcta, topic: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def qcovar_param = quant_covariates_file ? "--qcovar ${quant_covariates_file}" : ''
def covar_param = cat_covariates_file ? "--covar ${cat_covariates_file}" : ''
"""
gcta \\
--reml \\
--grm ${meta.id} \\
--pheno ${phenotypes_file} \\
${qcovar_param} \\
${covar_param} \\
--out "${prefix}" \\
--thread-num ${task.cpus} \\
${args}
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch "${prefix}.hsq"
"""
}
104 changes: 104 additions & 0 deletions modules/nf-core/gcta/reml/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "gcta_reml"
description: Run univariate REML heritability estimation with a dense GRM
keywords:
- gcta
- genome-wide complex trait analysis
- reml
- restricted maximum likelihood
- grm
- genetic relationship matrix
- genetics
tools:
- "gcta":
description: "Genome-wide Complex Trait Analysis (GCTA) estimates genetic relationships, variance components, and association statistics from genome-wide data."
homepage: "https://yanglab.westlake.edu.cn/software/gcta/"
documentation: "https://yanglab.westlake.edu.cn/software/gcta/static/gcta_doc_latest.pdf"
tool_dev_url: "https://yanglab.westlake.edu.cn/software/gcta/"
licence: ["GPL-3.0-only"]
identifier: "biotools:gcta"
input:
- - meta:
type: map
description: |
Groovy map containing dense GRM metadata
`meta.id` must be the GRM basename passed to `--grm`
(for example `plink_simulated_dense` for `plink_simulated_dense.grm.{id,bin,N.bin}`)
- grm_files:
type: file
description: Dense GRM bundle containing sample identifier, binary matrix,
and sample-count matrix files
pattern: "*.grm.*"
ontologies: []
- - meta2:
type: map
description: |
Groovy map containing phenotype metadata; should carry the same sample
identity as `meta`, for example `[ id:'plink_simulated_dense' ]`
- phenotypes_file:
type: file
description: Phenotype file passed to `--pheno`
pattern: "*.{phe,pheno,txt,tsv}"
ontologies:
- edam: "http://edamontology.org/format_3475"
- - meta3:
type: map
description: |
Groovy map containing quantitative covariate metadata; should carry the
same sample identity as `meta`, for example `[ id:'plink_simulated_dense' ]`
- quant_covariates_file:
type: file
description: Quantitative covariates file, pass `[]` when absent
pattern: "*.{covar,cov,txt,tsv}"
ontologies:
- edam: "http://edamontology.org/format_3475"
- - meta4:
type: map
description: |
Groovy map containing categorical covariate metadata; should carry the
same sample identity as `meta`, for example `[ id:'plink_simulated_dense' ]`
- cat_covariates_file:
type: file
description: Categorical covariates file, pass `[]` when absent
pattern: "*.{covar,cov,txt,tsv}"
ontologies:
- edam: "http://edamontology.org/format_3475"
output:
reml_results:
- - meta:
type: map
description: |
Groovy map containing dense GRM metadata
`meta.id` must be the GRM basename passed to `--grm`
(for example `plink_simulated_dense` for `plink_simulated_dense.grm.{id,bin,N.bin}`)
- "*.hsq":
type: file
description: REML result file
pattern: "*.{hsq}"
ontologies:
- edam: "http://edamontology.org/format_2330"
versions_gcta:
- - "${task.process}":
type: string
description: The process the version was collected from
- "gcta":
type: string
description: The tool name
- "gcta --version | sed -En 's/^[*] version v([0-9.]*).*/\\1/p'":
type: eval
description: The command used to retrieve the GCTA version
topics:
versions:
- - ${task.process}:
type: string
description: The process the version was collected from
- gcta:
type: string
description: The tool name
- "gcta --version | sed -En 's/^[*] version v([0-9.]*).*/\\1/p'":
type: eval
description: The command used to retrieve the GCTA version
authors:
- "@lyh970817"
maintainers:
- "@lyh970817"
Loading