Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ba9a5ae
Fix vcf_concordance_glimpse2
LouisLeNezet Mar 23, 2026
4b21ed2
Fix vcf_normalize_bcftools
LouisLeNezet Mar 23, 2026
68bebbd
Remove params outside entry workflow
LouisLeNezet Mar 23, 2026
2e3901c
Split prepare genome
LouisLeNezet Mar 23, 2026
2a99923
Migrate all params
LouisLeNezet Mar 23, 2026
bc7066e
Update changelog
LouisLeNezet Mar 23, 2026
0a88830
Merge branch 'dev' into params_main
LouisLeNezet Mar 24, 2026
aa92e99
Fix initialisation sbwf
LouisLeNezet Mar 24, 2026
f08f60f
Add nf-core-utils plugin
LouisLeNezet Mar 24, 2026
72e5569
Update snapshot
LouisLeNezet Mar 25, 2026
12aaca0
Update to sheets given
LouisLeNezet Mar 25, 2026
1468d55
Use params map for each step
LouisLeNezet Mar 25, 2026
5336302
Update nextflow version
LouisLeNezet Mar 25, 2026
da67318
Fix min_val_dp
LouisLeNezet Mar 26, 2026
b93fdcf
Update snapshot
LouisLeNezet Mar 26, 2026
8c8cf28
Simplify version
LouisLeNezet Mar 26, 2026
d387965
Pass outdir
LouisLeNezet Mar 26, 2026
31055fd
Update version to string
LouisLeNezet Mar 26, 2026
a1ac41e
Fix remaining versions
LouisLeNezet Mar 26, 2026
1d5f23b
Fix lint
LouisLeNezet Mar 26, 2026
f476826
Revert changes
LouisLeNezet Mar 26, 2026
357f10b
Revert changes
LouisLeNezet Mar 26, 2026
224c66b
Revert changes
LouisLeNezet Mar 26, 2026
d9276c8
Revert changes
LouisLeNezet Mar 26, 2026
1a8055a
Merge branch 'dev' into params_main
LouisLeNezet Mar 27, 2026
c01c229
Merge branch 'dev' into params_main
LouisLeNezet Mar 30, 2026
eb11ace
Update snapshots
LouisLeNezet Mar 30, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- isMain: false
profile: "singularity"
NXF_VER:
- "25.04.0"
- "25.10.0"
- "latest-everything"
env:
NXF_ANSI_LOG: false
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#262](https://github.com/nf-core/phaseimpute/pull/262) - Change from `master` to `main` branch.
- [#268](https://github.com/nf-core/phaseimpute/pull/268) - Refactor duplicated QUILT/STITCH posfile preprocessing into a single step.
- [#273](https://github.com/nf-core/phaseimpute/pull/273) - Update nf-core modules, fix syntax. Remove `SAMTOOLS_REHEADER` patch and pass command through meta map. Update nf-test in Github Action to 0.9.4.
- [#276](https://github.com/nf-core/phaseimpute/pull/276) - Migrate all `params.value` usage to entry workflow. Use groovy map to store parameters for each step. Use nextflow 25.10 for `getGenomeAttribute()`.

### `Fixed`

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![GitHub Actions Linting Status](https://github.com/nf-core/phaseimpute/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/phaseimpute/actions/workflows/linting.yml)[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/phaseimpute/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.14329225-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.14329225)
[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)

[![Nextflow](https://img.shields.io/badge/version-%E2%89%A525.04.0-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)
[![Nextflow](https://img.shields.io/badge/version-%E2%89%A525.10.0-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)
[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.5.1-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.5.1)
[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)
[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)
Expand Down
14 changes: 9 additions & 5 deletions conf/steps/initialisation.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ process {
publishDir = [ enabled: false ]
}

withName: 'PREPARE_GENOME:SAMTOOLS_FAIDX' {
publishDir = [
path: { "${params.outdir}/initialisation/prepare_genome" },
mode: params.publish_dir_mode,
enabled: params.publish_all,
]
ext.args = "--write-index"
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CUSTOM_GENETICMAPCONVERT'{
tag = { "${meta.panel_id} ${meta.chr}" }
ext.prefix = { "${meta.panel_id}_${meta.chr}" }
Expand All @@ -24,9 +33,4 @@ process {
enabled: params.publish_all
]
}

withName: 'PIPELINE_INITIALISATION:SAMTOOLS_FAIDX' {
publishDir = [ enabled: false ]
ext.args = "--write-index"
}
}
157 changes: 125 additions & 32 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ include { CHRCHECK as CHRCHECK_TRUTH } from './workflows/chrcheck'
include { CHRCHECK as CHRCHECK_PANEL } from './workflows/chrcheck'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_phaseimpute_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_phaseimpute_pipeline'
include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_phaseimpute_pipeline'
include { PREPARE_GENOME } from './subworkflows/local/prepare_genome'
include { getGenomeAttribute } from 'plugin/nf-core-utils'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GENOME PARAMETER VALUES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

params.fasta = getGenomeAttribute('fasta')
params.fasta_fai = getGenomeAttribute('fasta_fai')
params.fasta_gzi = getGenomeAttribute('fasta_gzi')

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -34,18 +45,27 @@ include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_p
workflow NFCORE_PHASEIMPUTE {

take:
ch_input // channel: samplesheet read in from --input
ch_input_truth // channel: samplesheet read in from --input-truth
ch_fasta // channel: reference genome FASTA file with index
ch_panel // channel: reference panel variants file
ch_regions // channel: regions to use [[chr, region], region]
ch_depth // channel: depth of coverage file [[depth], depth]
ch_map // channel: map file for imputation
ch_posfile // channel: samplesheet read in from --posfile
ch_chunks // channel: samplesheet read in from --chunks
chunk_model // parameter: chunk model
rename_chr // parameter: rename chromosome prefix
max_chr_names // parameter: max number of chr to show in message
steps // array: List of steps to perform
tools // array: List of tools to use
ch_input // channel: samplesheet read in from --input
ch_input_truth // channel: samplesheet read in from --input-truth
ch_fasta // channel: reference genome FASTA file with index
ch_panel // channel: reference panel variants file
ch_regions // channel: regions to use [[chr, region], region]
ch_depth // channel: depth of coverage file [[depth], depth]
ch_map // channel: map file for imputation
ch_posfile // channel: samplesheet read in from --posfile
ch_chunks // channel: samplesheet read in from --chunks
sheets_given // map: input sheets given
rename_chr // parameter: rename chromosome prefix
max_chr_names // parameter: max number of chr to show in message
params_simulate // map: parameters use for simulation step [depth: float, genotype: path]
params_panelprep // map: parameters use for panelprep step [normalize: boolean, remove_samples: string, compute_freq: boolean, phase: boolean, chunk_model: string ]
params_impute // map: parameters use for imputation step [batch_size: integer, k_val: integer, n_gen: integer, buffer: integer]
params_validate // map: parameters use for validation step [bins: string, min_val_gl: float, min_val_dp: integer]
params_multiqc // map: parameters use for multiqc report [config: path, logo: path, methods_description: string]
seed // integer
outdir // path

main:

Expand All @@ -56,7 +76,6 @@ workflow NFCORE_PHASEIMPUTE {
ch_input_impute = channel.empty()
ch_input_simulate = channel.empty()
ch_input_validate = channel.empty()
def steps = params.steps.split(',') as List

// Check input files for contigs names consistency
lst_chr = ch_regions.map {meta, _region -> meta.chr }
Expand Down Expand Up @@ -88,6 +107,8 @@ workflow NFCORE_PHASEIMPUTE {
// WORKFLOW: Run pipeline
//
PHASEIMPUTE (
steps,
tools,
ch_input_impute,
ch_input_simulate,
ch_input_validate,
Expand All @@ -99,12 +120,16 @@ workflow NFCORE_PHASEIMPUTE {
ch_map,
ch_posfile,
ch_chunks,
chunk_model,
params.multiqc_config,
params.multiqc_logo,
params.multiqc_methods_description,
params.outdir
sheets_given,
params_simulate,
params_panelprep,
params_impute,
params_validate,
params_multiqc,
seed,
outdir
)

emit:
multiqc_report = PHASEIMPUTE.out.multiqc_report // channel: /path/to/multiqc_report.html
}
Expand All @@ -118,6 +143,58 @@ workflow NFCORE_PHASEIMPUTE {
workflow {

main:
def steps = params.steps.split(',') as List
def tools = params.tools ? params.tools.split(',') as List : []

def sheets_given = [
input_target : params.input,
input_truth : params.input_truth,
input_region : params.input_region,
input_panel : params.panel,
input_posfile: params.posfile,
input_chunks : params.chunks,
input_map : params.map,
]

def params_simulate = [
depth : params.depth,
genotype: params.genotype
]

def params_panelprep = [
normalize : params.normalize,
remove_samples: params.remove_samples,
compute_freq : params.compute_freq,
phase : params.phase,
chunk_model : params.chunk_model
]

def params_impute = [
batch_size: params.batch_size,
k_val : params.k_val,
n_gen :params.n_gen,
buffer :params.buffer,
]

def params_validate = [
bins : params.bins,
min_val_gl: params.min_val_gl,
min_val_dp: params.min_val_dp
]

def params_multiqc = [
config : params.multiqc_config,
logo : params.multiqc_logo,
methods_description: params.multiqc_methods_description
]

PREPARE_GENOME(
params.genome ?: file(params.fasta, checkIfExists:true).getBaseName(),
params.fasta,
params.fasta_fai,
params.fasta_gzi
)

//
// SUBWORKFLOW: Run initialisation tasks
//
Expand All @@ -127,28 +204,44 @@ workflow {
params.monochrome_logs,
args,
params.outdir,
params.input,
params.help,
params.help_full,
params.show_hidden
params.show_hidden,
PREPARE_GENOME.out.ch_fasta_fai_gzi,
sheets_given,
steps,
tools,
params.max_chr_names,
params_simulate,
params_panelprep,
params_impute
)

//
// WORKFLOW: Run main workflow
//
NFCORE_PHASEIMPUTE (
PIPELINE_INITIALISATION.out.input,
PIPELINE_INITIALISATION.out.input_truth,
PIPELINE_INITIALISATION.out.fasta,
PIPELINE_INITIALISATION.out.panel,
PIPELINE_INITIALISATION.out.regions,
PIPELINE_INITIALISATION.out.depth,
PIPELINE_INITIALISATION.out.gmap,
PIPELINE_INITIALISATION.out.posfile,
PIPELINE_INITIALISATION.out.chunks,
PIPELINE_INITIALISATION.out.chunk_model,
steps,
tools,
PIPELINE_INITIALISATION.out.ch_input_target,
PIPELINE_INITIALISATION.out.ch_input_truth,
PIPELINE_INITIALISATION.out.ch_fasta_index,
PIPELINE_INITIALISATION.out.ch_panel,
PIPELINE_INITIALISATION.out.ch_regions,
PIPELINE_INITIALISATION.out.ch_depth,
PIPELINE_INITIALISATION.out.ch_map,
PIPELINE_INITIALISATION.out.ch_posfile,
PIPELINE_INITIALISATION.out.ch_chunks,
sheets_given,
params.rename_chr,
params.max_chr_names
params.max_chr_names,
params_simulate,
params_panelprep,
params_impute,
params_validate,
params_multiqc,
params.seed,
params.outdir,
)
//
// SUBWORKFLOW: Run completion tasks
Expand Down
5 changes: 3 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ params {
batch_size = 100

// QUILT
ngen = 100
n_gen = 100
buffer = 10000

// STITCH
Expand Down Expand Up @@ -348,7 +348,7 @@ manifest {
description = """Phasing and imputation pipeline"""
mainScript = 'main.nf'
defaultBranch = 'main'
nextflowVersion = '!>=25.04.0'
nextflowVersion = '!>=25.10.0'
version = '1.2.0dev'
doi = 'https://doi.org/10.5281/zenodo.14329225'
}
Expand All @@ -357,6 +357,7 @@ manifest {
plugins {
id 'nf-schema@2.5.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet
id 'nf-co2footprint@1.0.0-beta' // Calculate the carbon footprint of a Nextflow pipeline
id 'nf-core-utils@0.4.0'
}

// CO2 footprint calculation
Expand Down
2 changes: 1 addition & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
"default": 10000,
"description": "Buffer of region to perform imputation over. So imputation is run form regionStart-buffer to regionEnd+buffer, and reported for regionStart to regionEnd, including the bases of regionStart and regionEnd."
},
"ngen": {
"n_gen": {
"type": "integer",
"default": 100,
"description": "Number of generations since founding of the population to use for imputation."
Expand Down
2 changes: 1 addition & 1 deletion ro-crate-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"url": {
"@id": "https://www.nextflow.io/"
},
"version": "!>=25.04.0"
"version": "!>=25.10.0"
},
{
"@id": "#6b9b8e0a-2e44-4e58-a934-5726c0a3604e",
Expand Down
50 changes: 50 additions & 0 deletions subworkflows/local/prepare_genome/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// Prepare reference genome files
//

include { SAMTOOLS_FAIDX } from '../../../modules/nf-core/samtools/faidx'

workflow PREPARE_GENOME {
take:
genome // genome name
fasta_path // path to fasta
fasta_fai_path // path to fasta_fai
fasta_gzi_path // path to fasta_gzi

main:

def is_compressed = fasta_path.toString().endsWith('.gz') || fasta_path.toString().endsWith('.bgz')
ch_fasta = channel.of([
[genome: genome],
file(fasta_path, checkIfExists:true),
[]
])

if (fasta_fai_path) {
ch_fai = channel.of(file(fasta_fai_path, checkIfExists:true))
} else {
SAMTOOLS_FAIDX(ch_fasta, false)
ch_fai = SAMTOOLS_FAIDX.out.fai.map{ _meta, fasta_fai -> fasta_fai }
}
if (is_compressed) {
if (fasta_gzi_path) {
ch_gzi = channel.of(file(fasta_gzi_path, checkIfExists:true))
} else if (!fasta_fai_path) {
ch_gzi = SAMTOOLS_FAIDX.out.gzi.map{ _meta, gzi -> gzi }
} else {
SAMTOOLS_FAIDX(ch_fasta, false)
ch_gzi = SAMTOOLS_FAIDX.out.gzi.map{ _meta, gzi -> gzi }
}
} else {
ch_gzi = channel.of([])
}

ch_fasta_fai_gzi = ch_fasta
.map{ meta, fasta, _fai -> [meta, fasta] }
.combine(ch_fai)
.combine(ch_gzi)
.collect()

emit:
ch_fasta_fai_gzi
}
Loading
Loading