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/bivariateremlldms/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
47 changes: 47 additions & 0 deletions modules/nf-core/gcta/bivariateremlldms/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
process GCTA_BIVARIATEREMLLDMS {
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(mgrm_file), path(grm_files)
tuple val(meta2), path(phenotype_file), val(phenotype_col1), val(phenotype_col2)
tuple val(meta3), path(quant_covariates_file)
tuple val(meta4), path(cat_covariates_file)

output:
tuple val(meta), path("*.hsq"), emit: bivariate_results
tuple val(meta), path("*.log"), emit: log_file
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 reml_bivar_param = phenotype_col1 && phenotype_col2 ? "--reml-bivar ${phenotype_col1} ${phenotype_col2}" : "--reml-bivar"
def qcovar_param = quant_covariates_file ? "--qcovar ${quant_covariates_file}" : ''
def covar_param = cat_covariates_file ? "--covar ${cat_covariates_file}" : ''
"""
gcta \\
${reml_bivar_param} \\
--mgrm ${mgrm_file} \\
--pheno "${phenotype_file}" \\
${qcovar_param} \\
${covar_param} \\
--out "${prefix}" \\
--thread-num ${task.cpus} \\
${args}
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch "${prefix}.hsq"
touch "${prefix}.log"
"""
}
139 changes: 139 additions & 0 deletions modules/nf-core/gcta/bivariateremlldms/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "gcta_bivariateremlldms"
description: Run bivariate REML-LDMS analysis with an MGRM manifest
keywords:
- gcta
- genome-wide complex trait analysis
- reml
- restricted maximum likelihood
- bivariate
- ldms
- linkage disequilibrium and minor allele frequency stratification
- 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 MGRM metadata
`meta.id` should match the MGRM manifest basename, for example
`plink_simulated_ldms` for `plink_simulated_ldms.mgrm`
- mgrm_file:
type: file
description: MGRM manifest file
pattern: "*.mgrm"
ontologies:
- edam: "http://edamontology.org/format_2330"
- grm_files:
type: file
description: GRM bundles referenced by `mgrm_file`; each manifest entry
should have matching `*.grm.{id,bin,N.bin}` files in this bundle
pattern: "*.grm.*"
ontologies: []
- - meta2:
type: map
description: |
Groovy map containing phenotype file metadata for the same analysis
unit as the primary MGRM metadata
e.g. `[ id:'plink_simulated_ldms' ]`
- phenotype_file:
type: file
description: Shared bivariate phenotype file passed to `--pheno`
pattern: "*.{phe,pheno,txt,tsv}"
ontologies:
- edam: "http://edamontology.org/format_3475"
- phenotype_col1:
type: integer
description: |
First phenotype column passed to `--reml-bivar` (for example `1`).
Pass an empty value together with `phenotype_col2` to use GCTA's
default bivariate phenotype columns.
- phenotype_col2:
type: integer
description: |
Second phenotype column passed to `--reml-bivar` (for example `2`).
Pass an empty value together with `phenotype_col1` to use GCTA's
default bivariate phenotype columns.
- - meta3:
type: map
description: |
Groovy map containing quantitative covariate metadata for the same
analysis unit as the primary MGRM metadata
e.g. `[ id:'plink_simulated_ldms' ]`
- 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 for the same
analysis unit as the primary MGRM metadata
e.g. `[ id:'plink_simulated_ldms' ]`
- 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:
bivariate_results:
- - meta:
type: map
description: |
Groovy map containing MGRM metadata
`meta.id` is used as the default output prefix
- "*.hsq":
type: file
description: Bivariate REML-LDMS result file
pattern: "*.{hsq}"
ontologies:
- edam: "http://edamontology.org/format_2330"
log_file:
- - meta:
type: map
description: |
Groovy map containing MGRM metadata
`meta.id` is used as the default output prefix
- "*.log":
type: file
description: Bivariate REML-LDMS log file
pattern: "*.{log}"
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