Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5f97924
Module for PCA
Mar 20, 2025
23afb24
Module for PCA
Mar 20, 2025
72dd438
Module for PCA
Mar 21, 2025
f50d768
Module for PCA
Mar 21, 2025
ffd2b08
Module for PCA
Mar 21, 2025
0e1e3fd
testing conda
Mar 24, 2025
da6e525
plinkpca
Mar 24, 2025
6e37577
Fixed ivar modules (#7868)
saramonzon Mar 20, 2025
1f6783d
Update FastK + MerquryFK versions + allow conda, add merquryfk/hapmak…
prototaxites Mar 21, 2025
e9353a3
Fix rnaseq preprocessing: don't trim with bad linting (#7881)
pinin4fjords Mar 21, 2025
0ab89de
Update versions for motus/preplong (#7854)
sofstam Mar 21, 2025
5dda446
Fixed conda channel order for fq module (#7871) (#7873)
delagoya Mar 21, 2025
a458f0c
New module: `khmer/trimlowabund` (#7806)
zachary-foster Mar 21, 2025
5dc83a2
Added cram output to samtools/fixmate (#7820)
GallVp Mar 24, 2025
d568ac8
Migrate `ATAQV/MKARV` to nf-test (#7893)
LouisLeNezet Mar 24, 2025
8191ef8
Added repeatmasker/repeatmasker (#7825)
GallVp Mar 24, 2025
a6df749
Added mdust (#7823)
GallVp Mar 24, 2025
16c711a
Added agat/spfilterbyorfsize (#7822)
GallVp Mar 24, 2025
652754a
Migrate `authentict/deam2cont` to nf-test (#7947)
LouisLeNezet Mar 24, 2025
f7e7c63
Migrate `BAMTOOLS/CONVERT` to nf-test (#7958)
LouisLeNezet Mar 24, 2025
942af14
Updated deevariant to avoid failing nf-test (#7960)
scorreard Mar 24, 2025
edff87d
answer review Edo
Mar 25, 2025
8ebe44d
fixing logfile
Mar 25, 2025
3740d03
Merge branch 'master' into plinkpca
bruno-ariano Mar 25, 2025
251685e
Merge branch 'master' into plinkpca
bruno-ariano Mar 25, 2025
074d806
Merge branch 'master' into plinkpca
bruno-ariano Mar 26, 2025
f032314
fixing variable name bug
Mar 26, 2025
7c01fc9
Merge branch 'master' into plinkpca
bruno-ariano Mar 26, 2025
49663f3
rebasing
Mar 26, 2025
d6459b6
fixing variable name bug
Mar 26, 2025
c05d80b
fixing variable name bug
Mar 26, 2025
18c0f59
Merge branch 'master' into plinkpca
bruno-ariano Mar 26, 2025
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/plink2/pca/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::plink2=2.00a5.10"
52 changes: 52 additions & 0 deletions modules/nf-core/plink2/pca/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
process PLINK2_PCA {
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/plink2:2.00a5.10--h4ac6f70_0'
: 'biocontainers/plink2:2.00a5.10--h4ac6f70_0'}"

input:
tuple val(meta), val(npcs), val(use_approx), path(pgen), path(psam), path(pvar)

output:
tuple val(meta), path("*.eigenvec"), emit: evecfile
tuple val(meta), path("*.eigenval"), emit: evfile
tuple val(meta), path("*.log"), emit: logfile
path "versions.yml", emit: versions
Comment thread
bruno-ariano marked this conversation as resolved.


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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def approx_option = use_approx ? "approx" : ""
def n_pcs = npcs ? npcs : 10
"""
plink2 \\
--pca ${n_pcs} ${approx_option} \\
--memory ${task.memory.toMega()} \\
$args \\
--threads $task.cpus \\
Comment thread
bruno-ariano marked this conversation as resolved.
--pfile ${pgen.baseName} \\
--out ${prefix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
plinkpca: \$(plink2 --version |& sed '1!d ; s/plink2 //')
END_VERSIONS
"""
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.eigenvec ${prefix}.eigenval

cat <<-END_VERSIONS > versions.yml
"${task.process}":
plink2: \$(plink2 --version 2>&1 | sed 's/^PLINK v//; s/ 64.*\$//' )
END_VERSIONS
"""
}
88 changes: 88 additions & 0 deletions modules/nf-core/plink2/pca/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "plink2_pca"
description: Perform PCA analysis using PLINK
keywords:
- plink2
- pca
- plink2_pca

tools:
- plink2:
description: |
Whole genome association analysis toolset, designed to perform a range
of basic, large-scale analyses in a computationally efficient manner
homepage: http://www.cog-genomics.org/plink/2.0/
documentation: http://www.cog-genomics.org/plink/2.0/general_usage
doi: "10.1186/s13742-015-0047-8"
licence: ["GPL v3"]
identifier: ""

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- npcs:
type: integer
description: Number of PCs to compute
- use_approx:
type: boolean
description: If true, use the approximate method
- pgen:
type: file
description: PLINK 2 binary genotype table
pattern: "*.{pgen}"
- psam:
type: file
description: PLINK 2 sample information file
pattern: "*.{psam}"
- pvar:
type: file
description: PLINK 2 variant information file
pattern: "*.{pvar}"

output:
- evecfile:
- meta:
type: map
description: |
Groovy Map containing sample information
pattern: "*.eigenvec"
- "*.eigenvec":
type: map
description: |
Groovy Map containing sample information
pattern: "*.eigenvec"
- evfile:
- meta:
type: map
description: |
Groovy Map containing sample information
pattern: "*.eigenval"
- "*.eigenval":
type: map
description: |
Groovy Map containing sample information
pattern: "*.eigenval"
- logfile:
- meta:
type: map
description: |
Groovy Map containing sample information
pattern: "*.log"
- "*.log":
type: map
description: |
Groovy Map containing sample information
pattern: "*.log"
- versions:
- versions.yml:
type: file
description: |
File containing the version of the program
pattern: "versions.yml"
authors:
- "@bruno-ariano"
maintainers:
- "@bruno-ariano"
42 changes: 42 additions & 0 deletions modules/nf-core/plink2/pca/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
nextflow_process {

name "Test Process PLINK2_PCA"
script "../main.nf"
process "PLINK2_PCA"
tag "modules"
tag "modules_nfcore"
tag "plink2"
tag "plink2/pca"

test("plink2_pca") {
config "./nextflow.config"
when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [
[ id: 'pca' ], // meta map!
10,
true,
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.pgen', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.pvar', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.psam', checkIfExists: true)
]
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert process.out.evecfile.get(0).get(1) ==~ ".*.eigenvec" },
{ assert process.out.evfile.get(0).get(1) ==~ ".*.eigenval" },
{ assert process.out.logfile.get(0).get(1) ==~ ".*.log" },
{ assert snapshot(process.out.versions).match("versions") }

)
}
}
}
14 changes: 14 additions & 0 deletions modules/nf-core/plink2/pca/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"versions": {
"content": [
[
"versions.yml:md5,6aad532ec6f7666e23d269c394e1d796"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
},
"timestamp": "2025-03-26T14:48:24.762736992"
}
}
10 changes: 10 additions & 0 deletions modules/nf-core/plink2/pca/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
========================================================================================
Nextflow config file for running tests
========================================================================================
*/
process {
withName: PLINK2_PCA {
ext.prefix = { "${meta.id}.pca" }
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/plink2/pca/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
plink2/pca:
- modules/nf-core/plink2/pca/**
Loading