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
24 changes: 24 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,28 @@ process {
]
}

withName: 'COBALT_PANEL_NORMALISATION' {
publishDir = [
path: { "${params.outdir}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : "panel_resources/${filename}" },
]
}

withName: 'PAVE_PON_PANEL_CREATION' {
publishDir = [
path: { "${params.outdir}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : "panel_resources/${filename}" },
]
}

withName: 'ISOFOX_PANEL_NORMALISATION' {
publishDir = [
path: { "${params.outdir}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : "panel_resources/${filename}" },
]
}

}
5 changes: 5 additions & 0 deletions conf/panel_resource_creation_parameters.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: '^.*:AMBER' {
ext.args = '-tumor_min_depth 2'
}
}
1 change: 1 addition & 0 deletions lib/Constants.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Constants {


static enum RunMode {
PANEL_RESOURCE_CREATION,
TARGETED,
WGTS,
}
Expand Down
9 changes: 9 additions & 0 deletions lib/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,15 @@ class Utils {
Nextflow.exit(1)
}

// Require --isofox_gene_ids argument to be provided in PANEL_RESOURCE_CREATION when RNA inputs are present
if (run_config.mode === Constants.RunMode.PANEL_RESOURCE_CREATION && run_config.has_rna && !params.isofox_gene_ids) {
log.error "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
" Running the panel resource creation workflow with RNA requires that the\n" +
" --isofox_gene_ids argument is set with an appropriate input file.\n" +
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Nextflow.exit(1)
}

}

static public getEnumFromString(s, e) {
Expand Down
3 changes: 1 addition & 2 deletions lib/WorkflowMain.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class WorkflowMain {
def default_invalid = false

// Set defaults common to all run configuration

if (!params.containsKey('genome_version')) {
if (Constants.GENOMES_VERSION_37.contains(params.genome)) {
params.genome_version = '37'
Expand Down Expand Up @@ -200,7 +199,7 @@ class WorkflowMain {
def panels = Constants.PANELS_DEFINED.join('\n - ')
log.error "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
" A panel is required to be set using the --panel CLI argument or in a\n" +
" configuration file when running in targeted mode.\n" +
" configuration file when running in targeted mode or panel resource creation mode.\n" +
" Currently, the available built-in panels are:\n" +
" - ${panels}\n" +
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Expand Down
7 changes: 5 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ if (workflow.stubRun && params.create_stub_placeholders) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { TARGETED } from './workflows/targeted'
include { WGTS } from './workflows/wgts'
include { PANEL_RESOURCE_CREATION } from './workflows/panel_resource_creation'
include { TARGETED } from './workflows/targeted'
include { WGTS } from './workflows/wgts'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -78,6 +79,8 @@ workflow NFCORE_ONCOANALYSER {
WGTS()
} else if (run_mode === Constants.RunMode.TARGETED) {
TARGETED()
} else if (run_mode === Constants.RunMode.PANEL_RESOURCE_CREATION) {
PANEL_RESOURCE_CREATION()
} else {
log.error("received bad run mode: ${run_mode}")
Nextflow.exit(1)
Expand Down
4 changes: 2 additions & 2 deletions modules/local/amber/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process AMBER {
tuple val(meta), path(tumor_bam), path(normal_bam), path(donor_bam), path(tumor_bai), path(normal_bai), path(donor_bai)
val genome_ver
path heterozygous_sites
path target_region_bed
path target_regions_bed

output:
tuple val(meta), path('amber/'), emit: amber_dir
Expand All @@ -35,7 +35,7 @@ process AMBER {
if (donor_bam) reference_bams.add(donor_bam.toString())
def reference_bam_arg = reference_bams.size() > 0 ? "-reference_bam ${String.join(",", reference_bams)}" : ''

def target_regions_bed_arg = target_region_bed ? "-target_regions_bed ${target_region_bed}" : ''
def target_regions_bed_arg = target_regions_bed ? "-target_regions_bed ${target_regions_bed}" : ''

"""
amber \\
Expand Down
14 changes: 5 additions & 9 deletions modules/local/amber/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,15 @@ input:
type: file
description: AMBER heterozygous sites file
pattern: "*.{vcf.gz}"
- target_region_bed:
- target_regions_bed:
type: file
description: Target region BED file (optional)
description: Target regions BED file (optional)
pattern: "*.{bed}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [id: 'sample_id', tumor_id: 'tumor_name', normal_id: 'normal_name']
- amber_dir:
type: directory
- cobalt_normalisation:
file: directory
description: AMBER output directory
pattern: "versions.yml"
- versions:
type: file
description: File containing software versions
Expand Down
7 changes: 7 additions & 0 deletions modules/local/cobalt/panel_normalisation/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: cobalt_panel_normalisation
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::hmftools-cobalt=2.0
62 changes: 62 additions & 0 deletions modules/local/cobalt/panel_normalisation/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
process COBALT_PANEL_NORMALISATION {
label 'process_single'

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

input:
tuple path('amber_dir.*'), path('cobalt_dir.*')
val genome_ver
path gc_profile
path target_regions_bed

output:
path 'cobalt.region_normalisation.*.tsv', emit: cobalt_normalisation
path 'versions.yml' , emit: versions

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

script:
def args = task.ext.args ?: ''

"""
mkdir -p inputs/

for fp in \$(find -L amber_dir.* cobalt_dir.* -type f ! -name '*.version'); do
ln -sf ../\${fp} inputs/\${fp##*/};
done

(
echo SampleId;
find -L inputs/ -type f -name '*.amber.baf.tsv.gz' | sed 's#inputs/##; s#\\.amber\\..*\$##; s#\\.cobalt\\..*\$##' | sort -V | uniq;
) > sample_ids.txt

java -cp /usr/local/share/hmftools-cobalt-2.0-0/cobalt.jar \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
com.hartwig.hmftools.cobalt.norm.NormalisationFileBuilder \\
${args} \\
-sample_id_file sample_ids.txt \\
-amber_dir inputs/ \\
-cobalt_dir inputs/ \\
-ref_genome_version ${genome_ver} \\
-gc_profile ${gc_profile} \\
-target_regions_bed ${target_regions_bed} \\
-output_file cobalt.region_normalisation.${genome_ver}.tsv \\
-log_level ${params.module_log_level}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
cobalt_panel_normalisation: \$(cobalt -version | sed 's/^.* //')
END_VERSIONS
"""

stub:
"""
touch cobalt.region_normalisation.${genome_ver}.tsv

echo -e '${task.process}:\\n stub: noversions\\n' > versions.yml
"""
}
41 changes: 41 additions & 0 deletions modules/local/cobalt/panel_normalisation/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: cobalt_panel_normalisation
description: Count bam lines determines the read depth ratios of the supplied tumor and reference genomes
keywords:
- cobalt
- read depth ratios
- cnv
tools:
- cobalt:
description: Count bam lines determines the read depth ratios of the supplied tumor and reference genomes.
homepage: https://github.com/hartwigmedical/hmftools/tree/master/cobalt
documentation: https://github.com/hartwigmedical/hmftools/tree/master/cobalt
licence: ["GPL v3"]
input:
- amber_dirs:
type: directory
description: List of AMBER output directories
- cobalt_dirs:
type: directory
description: List of COBALT output directories
- genome_ver:
type: string
description: Reference genome version
- gc_profile:
type: file
description: GC profile file
pattern: "*.{cnp}"
- target_regions_bed:
type: file
description: Target regions BED file
pattern: "*.{bed}"
output:
- cobalt_normalisation:
type: file
description: COBALT normalisation file
pattern: "*.{tsv}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@scwatts"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cobalt
name: cobalt_run
channels:
- conda-forge
- bioconda
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ process COBALT {

cat <<-END_VERSIONS > versions.yml
"${task.process}":
cobalt: \$(cobalt -version | sed -n '/^Cobalt version/ { s/^.* //p }')
cobalt_run: \$(cobalt -version | sed -n '/^Cobalt version/ { s/^.* //p }')
END_VERSIONS
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cobalt
name: cobalt_run
description: Count bam lines determines the read depth ratios of the supplied tumor and reference genomes
keywords:
- cobalt
Expand Down
7 changes: 7 additions & 0 deletions modules/local/isofox/panel_normalisation/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: isofox_panel_normalisation
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::hmftools-isofox=1.7.1
60 changes: 60 additions & 0 deletions modules/local/isofox/panel_normalisation/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
process ISOFOX_PANEL_NORMALISATION {
label 'process_medium'

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

input:
path 'isofox_dirs.*'
val genome_ver
path gene_ids
path gene_distribution

output:
path 'isofox.gene_normalisation.*.csv', emit: isofox_normalisation
path 'versions.yml' , emit: versions

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

script:
def args = task.ext.args ?: ''

"""
mkdir -p inputs/
for fp in \$(find -L isofox_dirs.* -name '*.gene_data.csv'); do ln -sf ../\${fp} inputs/; done

(
echo SampleId;
find inputs/ -name '*csv' | sed 's#^.*/\\(.*\\).isf.gene_data.csv#\\1#';
) > sample_ids.txt

java -cp /usr/local/share/hmftools-isofox-1.7.1-0/isofox.jar \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
com.hartwig.hmftools.isofox.cohort.CohortAnalyser \\
${args} \\
-sample_data_file sample_ids.txt \\
-root_data_dir inputs/ \\
-analyses PANEL_TPM_NORMALISATION \\
-gene_id_file ${gene_ids} \\
-gene_distribution_file ${gene_distribution} \\
-output_dir ./ \\
-log_level ${params.module_log_level}

mv isofox.panel_gene_normalisation.csv isofox.gene_normalisation.${genome_ver}.csv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
isofox: \$(isofox -version | sed 's/^.* //')
END_VERSIONS
"""

stub:
"""
touch isofox.gene_normalisation.${genome_ver}.csv

echo -e '${task.process}:\\n stub: noversions\\n' > versions.yml
"""
}
37 changes: 37 additions & 0 deletions modules/local/isofox/panel_normalisation/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: isofox_panel_normalisation
description: Characterise and count gene, transcript features
keywords:
- rna
- rnaseq
tools:
- isofox:
description: Characterises and counts gene, transcript features
homepage: https://github.com/hartwigmedical/hmftools/tree/master/isofox
documentation: https://github.com/hartwigmedical/hmftools/tree/master/isofox
licence: ["GPL v3"]
input:
- isofox_dirs:
type: directory
description: List of Isofox directories
- genome_ver:
type: string
description: Reference genome version
- gene_ids:
type: file
description: Isofox gene ID file (optional)
pattern: "*.{csv}"
- gene_distribution:
type: file
description: Isofox cohort gene expression file
pattern: "*.{csv}"
output:
- isofox_normalisation:
type: file
description: Isofox normalisation file
pattern: "versions.yml"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@scwatts"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: isofox
name: isofox_run
channels:
- conda-forge
- bioconda
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: isofox
name: isofox_run
description: Characterise and count gene, transcript features
keywords:
- rna
Expand Down
Loading
Loading