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
3 changes: 0 additions & 3 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

process {

// TODO nf-core: Check the defaults for all processes
cpus = { 1 * task.attempt }
memory = { 6.GB * task.attempt }
time = { 4.h * task.attempt }
Expand All @@ -24,8 +23,6 @@ process {
// These labels are used and recognised by default in DSL2 files hosted on nf-core/modules.
// If possible, it would be nice to keep the same label naming convention when
// adding in your local modules too.
// TODO nf-core: Customise requirements for specific processes.
// See https://www.nextflow.io/docs/latest/config.html#config-process-selectors
withLabel:process_single {
cpus = { 1 }
memory = { 5.GB * task.attempt }
Expand Down
26 changes: 9 additions & 17 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ process {
path: { "${params.outdir}/${meta.id}/filtered_bam" },
mode: 'copy'
]
cpus = 4 // Set the number of CPUs here
cpus = 4
}


Expand All @@ -92,7 +92,6 @@ process {
hifi: 'map-hifi',
pacbio: 'map-pb'
]
// Use manual model if provided, otherwise use platform-based preset
def preset = params.minimap2_model ?: (presets[params.sequencing_platform] ?: 'map-ont')
"-Y -y -ax ${preset} -R '@RG\\tID:${meta.id}\\tSM:${meta.id}\\tPL:${params.sequencing_platform.toUpperCase()}'"
}
Expand Down Expand Up @@ -477,32 +476,25 @@ process {

withName: 'DEEPVARIANT_RUNDEEPVARIANT' {
ext.args = {
// Define model type presets based on sequencing platform
def model_types = [
ont: 'ONT_R104',
hifi: 'PACBIO',
pacbio: 'PACBIO',
]
def model_type = model_types[params.sequencing_platform] ?: 'ONT_R104'

// Build arguments list
def args_list = [
def regions_arg = ""
if (params.deepvariant_regions) {
regions_arg = "--regions=${params.deepvariant_regions}"
}

return [
"--model_type=${model_type}",
"--sample_name=${meta.id}",
"--regions=${params.deepvariant_regions}",
regions_arg,
"--make_examples_extra_args=${params.deepvariant_make_examples_extra_args}"
]

return args_list.findAll { it }.join(' ').trim()
].findAll { it }.join(' ').trim()
}

ext.prefix = { "${meta.id}_deepvariant" }

publishDir = [
path: { "${params.outdir}/${meta.id}/deepvariant" },
mode: 'copy'
]

}

withName: 'DEEPVARIANT_VCFSTATSREPORT'{
Expand Down
51 changes: 41 additions & 10 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,49 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
executor {
name = 'local'
cpus = 8
memory = '16.GB'
name = 'local'
cpus = 12
memory = '24.GB'
queueSize = 10
}

process {
resourceLimits = [
cpus: 1,
memory: '10.GB'
]
// nf-core standard process labels
withLabel: 'process_single' {
cpus = 1
memory = 2.GB
time = 4.h
}
withLabel: 'process_low' {
cpus = 2
memory = 4.GB
time = 6.h
}
withLabel: 'process_medium' {
cpus = 2 // ← REDUCED from 4
memory = 4.GB // ← REDUCED from 8
time = 8.h
}
withLabel: 'process_high' {
cpus = 4 // ← REDUCED from 8
memory = 8.GB // ← REDUCED from 16
time = 10.h
}

// CRITICAL: Force MINIMAP2_ALIGN to use minimal resources
withName: 'MINIMAP2_ALIGN' {
cpus = 2
memory = 4.GB
// Now 4 samples can run in parallel: 8 CPUs / 2 = 4 parallel tasks
}

withName: 'MINIMAP2_INDEX' {
cpus = 2
memory = 4.GB
}
}
trace.fields = "task_id,hash,native_id,script"



params {
// ========================================
Expand All @@ -28,7 +59,7 @@ params {
use_winnowmap = false // Use Winnowmap for alignment instead of Minimap2
winnowmap_model = null
haplotag_bam = true
trio_analysis = false // Enable trio analysis for SNV calling and phasing
trio_analysis = true // Enable trio analysis for SNV calling and phasing
filter_targets = false // Enable filtering of alignments to target regions (e.g. for gene panels or exomes)
targets_bed = null
generate_bam_stats = true // Enable generation of BAM statistics
Expand All @@ -44,7 +75,7 @@ params {
straglr_bed = "https://raw.githubusercontent.com/nf-core/test-datasets/longraredisease/straglr/str.test.bed"
trgt_bed = "${projectDir}/assets/data/trgt_repeat_catalog.hg38.bed"
chromosome_codes = ['chr22']
deepvariant_regions = 'chr22'
deepvariant_regions = null
outdir = './results'
annotate_sv = false
unify_vcf = false
Expand Down
2 changes: 1 addition & 1 deletion fix_editorconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def fix_nextflow_formatting(filepath):
'assets/snpeff_db.txt',
'nextflow.config',
'conf/modules.config',
'modules/local/svim/alignment/tests/main.nf.test',
'modules/local/spectre/cnvcaller/main.nf',
'subworkflows/local/call_str/tests/main.nf.test',
'subworkflows/local/annotate_sv/main.nf',
'subworkflows/local/align/main.nf',
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@
"git_sha": "72717e1f3feabaa57a6a71ba5a85d9c4ceeba514",
"installed_by": ["modules"]
},
"svim/alignment": {
"branch": "master",
"git_sha": "040e62715d9e5a54c962338426e02718f19abee6",
"installed_by": ["modules"]
},
"tabix/bgzip": {
"branch": "master",
"git_sha": "f2cfcf9d3f6a2d123e6c44aefa788aa232204a7a",
Expand Down
14 changes: 0 additions & 14 deletions modules/local/spectre/cnvcaller/environment.yml

This file was deleted.

24 changes: 8 additions & 16 deletions modules/local/spectre/cnvcaller/main.nf
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ process SPECTRE_CNVCALLER {
tag "$meta.id"
label 'process_high'

conda "${moduleDir}/environment.yml"
container "ghcr.io/nourmahfel/spectre-ont:0.3.2"
// FIXME Conda is not supported at the moment

container "community.wave.seqera.io/library/ont-spectre:0.3.2--adfae189059be3d9"

input:
tuple val(meta), path(summary), path(regions_bed), path(regions_csi), path(vcf)
tuple val(meta), path(mosdepth_summary), path(mosdepth_regions_bed), path(mosdepth_regions_csi), path(vcf)
tuple val(meta2), path(fasta)
path(metadata_file)
path(blacklist)
Expand All @@ -18,7 +19,7 @@ process SPECTRE_CNVCALLER {
tuple val(meta), path("*.spc.gz") , emit: spc
tuple val(meta), path("predicted_karyotype.txt") , emit: txt
tuple val(meta), path("windows_stats", type: 'dir') , emit: winstats
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('spectre'), eval('spectre version 2>&1 | grep -oP "Spectre version: \\K[0-9.]+"'), emit: versions_spectre, topic: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -32,26 +33,21 @@ process SPECTRE_CNVCALLER {
mkdir -p ${coverage_dir}

# Stage the mosdepth files into the directory with proper naming
cp -L ${summary} ${coverage_dir}/${meta.id}.mosdepth.summary.txt
cp -L ${regions_bed} ${coverage_dir}/${meta.id}.regions.bed.gz
cp -L ${regions_csi} ${coverage_dir}/${meta.id}.regions.bed.gz.csi
cp -L ${mosdepth_summary} ${coverage_dir}/${meta.id}.mosdepth.summary.txt
cp -L ${mosdepth_regions_bed} ${coverage_dir}/${meta.id}.regions.bed.gz
cp -L ${mosdepth_regions_csi} ${coverage_dir}/${meta.id}.regions.bed.gz.csi

# Now run spectre with the directory - use bin_size input parameter, not params
spectre CNVCaller \\
--coverage ${coverage_dir} \\
--snv ${vcf} \\
--reference ${fasta} \\
--output-dir . \\
--sample-id=${prefix} \\
--metadata ${metadata_file} \\
--blacklist ${blacklist} \\
--bin-size ${bin_size} \\
${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
spectre: \$(spectre --version 2>&1 | grep -oP 'version \\K[0-9.]+' || spectre --help 2>&1 | grep -oP 'v[0-9.]+' | sed 's/v//' || echo "1.0.0")
END_VERSIONS
"""

stub:
Expand All @@ -63,9 +59,5 @@ process SPECTRE_CNVCALLER {
touch predicted_karyotype.txt
mkdir windows_stats

cat <<-END_VERSIONS > versions.yml
"${task.process}":
spectre: 0.3.2
END_VERSIONS
"""
}
Loading
Loading