8000 Added module lmm and copied kinshipmatrix module by KevinMLanderos · Pull Request #8475 · nf-core/modules · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added module lmm and copied kinshipmatrix module #8475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fall back this change ?

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"nextflow.formatting.harshilAlignment": true
"nextflow.formatting.harshilAlignment": true,
"nextflow.telemetry.enabled": false
}
7 changes: 7 additions & 0 deletions modules/nf-core/gemma/kinshipmatrix/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::gemma=0.98.5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need here the "

Suggested change
- "bioconda::gemma=0.98.5"
- bioconda::gemma=0.98.5

49 changes: 49 additions & 0 deletions modules/nf-core/gemma/kinshipmatrix/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
process GEMMA_KINSHIPMATRIX {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gemma:0.98.5--ha36d3ea_0':
'biocontainers/gemma/0.98.5--ha36d3ea_0' }"

input:
tuple val(meta), path(genotype)
tuple val(meta2), path(phenotype)
Comment on lines +11 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As both files represent different information from the same dataset, they should be kept in sync and therefore in the same tuple.

Suggested change
tuple val(meta), path(genotype)
tuple val(meta2), path(phenotype)
tuple val(meta), path(genotype), path(phenotype)


output:
tuple val(meta), path("output/${meta.id}.out.cXX.txt"), emit: matrix
path "versions.yml" , emit: versions
Comment on lines +15 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tuple val(meta), path("output/${meta.id}.out.cXX.txt"), emit: matrix
path "versions.yml" , emit: versions
tuple val(meta), path("output/${prefix}.out.cXX.txt"), emit: matrix
path "versions.yml" , emit: versions


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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
Comment on lines +22 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
gemma \\
$args \\
-g $genotype \\
-p $phenotype \\
Comment on lines +26 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$args \\
-g $genotype \\
-p $phenotype \\
${args} \\
-g ${genotype \\
-p ${phenotype} \\

-gk \\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not wrong the gk argument also can take a value number.
Could you add it as an optional value channel ?

-o ${meta.id}.out
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-o ${meta.id}.out
-o ${prefix}.out


cat <<-END_VERSIONS > versions.yml
"${task.process}":
gemma: \$(gemma --version)
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
Comment on lines +39 to +40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
mkdir output
touch output/${meta.id}.out.cXX.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
touch output/${meta.id}.out.cXX.txt
touch output/${prefix}.out.cXX.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gemma: \$(gemma --version)
END_VERSIONS
"""
}
64 changes: 64 additions & 0 deletions modules/nf-core/gemma/kinshipmatrix/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "gemma_kinshipmatrix"
description: GEMMA is a software toolkit for fast application of linear mixed models (LMMs)
keywords:
- matrix
- lmms
- gwas
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add kinship here

tools:
- "gemma":
description: "Linear mixed models (LMMs) for genome-wide association (GWA)"
homepage: "https://github.com/genetics-statistics/GEMMA"
documentation: "https://github.com/genetics-statistics/GEMMA"
tool_dev_url: "https://github.com/genetics-statistics/GEMMA"
doi: "https://doi.org/10.1038/ng.2310"
licence: ["GPL v3"]
identifier: biotools:gemma

## TODO nf-core: Add a description of all of the variables used as input
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## TODO nf-core: Add a description of all of the variables used as input

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`

- genotype:
type: file
description: genotype_matrix file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Gemma doesn't use a common format, could you describe briefly the columns expected ?

pattern: "*.txt"

- - meta2:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`

- phenotype:
type: file
description: phenotype file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous comment

pattern: "*.txt"

output:
- heat_map:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.cXX.txt":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- "*.cXX.txt":
- "output/${prefix}.out.cXX.txt":

type: file
description: kinship matrix
pattern: "*cXX.txt"

- versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@chriswyatt1"
maintainers:
- "@chriswyatt1"
76 changes: 76 additions & 0 deletions modules/nf-core/gemma/kinshipmatrix/test/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
nextflow_process {

name "Test Process GEMMA_KINSHIPMATRIX"
script "../main.nf"
process "GEMMA_KINSHIPMATRIX"

tag "modules"
tag "modules_nfcore"
tag "gemma"
tag "gemma/kinshipmatrix"

// TODO nf-core: Change the test name preferably indicating the test-data and file-format used
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used

test("gwas - vcf - pheno") {

when {
process {
"""
// TODO nf-core: define inputs of the process here. Example:

Comment on lines +18 to +19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO nf-core: define inputs of the process here. Example:

input[0] = [
[ id:'test', single_end:false ], // meta map
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not use the single_end information in the process. So it isn't needed in the test

Suggested change
[ id:'test', single_end:false ], // meta map
[ id:'test' ],

file( "https://raw.githubusercontent.com/genetics-statistics/GEMMA/master/example/mouse_hs1940.geno.txt.gz", checkIfExists: true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no dataset available on the nf-core/test-datasets repository ?


]
input[1] = [
[ id:'test', single_end:false ], // meta map
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

file( "https://raw.githubusercontent.com/genetics-statistics/GEMMA/master/example/mouse_hs1940.pheno.txt", checkIfExists: true),
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

// TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix.
Copy link
< 3D11 /details>
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix.

test("gwas - vcf - pheno - stub") {

options "-stub"

when {
process {
"""
// TODO nf-core: define inputs of the process here. Example:

Comment on lines +50 to +51
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO nf-core: define inputs of the process here. Example:

input[0] = [
[ id:'test', single_end:false ], // meta map
file( "https://raw.githubusercontent.com/genetics-statistics/GEMMA/master/example/mouse_hs1940.geno.txt.gz", checkIfExists: true)

]
input[1] = [
[ id:'test', single_end:false ], // meta map
file( "https://raw.githubusercontent.com/genetics-statistics/GEMMA/master/example/mouse_hs1940.pheno.txt", checkIfExists: true),
]

"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
//TODO nf-core: Add all required assertions to verify the test output.
Comment on lines +69 to +70
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ assert snapshot(process.out).match() }
//TODO nf-core: Add all required assertions to verify the test output.
{ assert snapshot(
process.out,
path(process.out.versions[0]).yaml
).match() }

)
}

}

}
128 changes: 128 additions & 0 deletions modules/nf-core/gemma/kinshipmatrix/test/main.nf.test.snap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you delete and regenerate the snapshot file ?
There is obsolete snapshot present.

10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"sarscov2 - bam - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
[

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the test such as a empty file is correctly generated here ?

]
]
],
"1": [
"versions.yml:md5,02383d9d5046a267d81f99463df55749"
],
"matrix": [
[
{
"id": "test",
"single_end": false
},
[

]
]
],
"versions": [
"versions.yml:md5,02383d9d5046a267d81f99463df55749"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
},
"timestamp": "2025-05-14T16:34:56.015094848"
},
"gwas - vcf - pheno - stub": {
"content": [
{
"0": [

],
"1": [

],
"matrix": [

],
"versions": [

]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
},
"timestamp": "2025-05-14T17:51:24.26939259"
},
"sarscov2 - bam": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
[
"test.out.cXX.txt:md5,83fbef03ff6c4e7e89bebd52ce9d11a6",
"test.out.log.txt:md5,f7eccba3f5e053669b3fb2b8c5f635e7"
]
]
],
"1": [
"versions.yml:md5,02383d9d5046a267d81f99463df55749"
],
"matrix": [
[
{
"id": "test",
"single_end": false
},
[
"test.out.cXX.txt:md5,83fbef03ff6c4e7e89bebd52ce9d11a6",
"test.out.log.txt:md5,f7eccba3f5e053669b3fb2b8c5f635e7"
]
]
],
"versions": [
"versions.yml:md5,02383d9d5046a267d81f99463df55749"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
},
"timestamp": "2025-05-14T16:34:38.506668318"
},
"gwas - vcf - pheno": {
"content": [
{
"0": [

],
"1": [

],
"matrix": [

],
"versions": [

]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
},
"timestamp": "2025-05-14T17:51:16.641698027"
}
}
7 changes: 7 additions & 0 deletions modules/nf-core/gemma/lmm/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::gemma=0.98.5"
54 changes: 54 additions & 0 deletions modules/nf-core/gemma/lmm/main.nf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update this file similarly as the kinshipmatrix process ?

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
process GEMMA_LMM {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gemma:0.98.5--ha36d3ea_0':
'community.wave.seqera.io/library/gemma:0.98.5--87bf3eea4b1ea0ad' }"

input:
tuple val(meta), path(genotype)
tuple val(meta2), path(phenotype)
Comment on lines +11 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tuple val(meta), path(genotype)
tuple val(meta2), path(phenotype)
tuple val(meta), path(genotype), path(phenotype)

tuple val(meta3), path(annot)
tuple val(meta4), path(cXX)

output:
tuple val(meta), path("output/${meta.id}.out.assoc.txt"), emit: matrix
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
gemma \\
$args \\
-g $genotype \\
-p $phenotype \\
-n 4 \\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it hard coded here ?

-a $annot \\
-k $cXX \\
-lmm \\
-o ${meta.id}.out

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gemma: \$(gemma --version)
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir output
touch output/${meta.id}.out.assoc.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gemma: \$(gemma --version)
END_VERSIONS
"""
}
Loading
Loading
0