Skip to content
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

Adding sentieon-dedup #1002

Merged
merged 5 commits into from
Apr 24, 2023
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
2 changes: 1 addition & 1 deletion conf/modules/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ process {
]
}

withName: 'NFCORE_SAREK:SAREK:(BAM_MARKDUPLICATES|BAM_MARKDUPLICATES_SPARK):CRAM_QC_MOSDEPTH_SAMTOOLS:SAMTOOLS_STATS' {
withName: 'NFCORE_SAREK:SAREK:(BAM_MARKDUPLICATES|BAM_MARKDUPLICATES_SPARK|BAM_SENTIEON_DEDUP):CRAM_QC_MOSDEPTH_SAMTOOLS:SAMTOOLS_STATS' {
ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('samtools')) }
ext.prefix = { "${meta.id}.md.cram" }
publishDir = [
Expand Down
46 changes: 46 additions & 0 deletions conf/modules/sentieon_dedup.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Config file for defining DSL2 per module options and publishing paths
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Available keys to override module options:
ext.args = Additional arguments appended to command in module.
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).
ext.args3 = Third set of arguments appended to command in module (multi-tool modules).
ext.prefix = File name prefix for output files.
ext.when = When to run the module.
----------------------------------------------------------------------------------------
*/

// SENTIEON_DEDUP

process {

withName: 'SENTIEON_DEDUP' {
ext.prefix = { "${meta.id}.md" }
ext.when = { params.tools && params.tools.split(',').contains('sentieon_dedup') }
publishDir = [
[
enabled: !params.save_output_as_bam,
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/sentieon_dedup/${meta.id}/" },
pattern: "*{cram,crai}"
],
[
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/" },
pattern: "*metrics",
saveAs: { !(params.skip_tools && params.skip_tools.split(',').contains('sentieon_dedup_report')) ? "sentieon_dedup/${meta.id}/${it}" : null}
]
]
}

withName: 'INDEX_DEDUPED' {
publishDir = [
enabled: !params.save_output_as_bam,
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/sentieon_dedup/${meta.id}/" },
pattern: "*{cram,crai}"
]
}

}
16 changes: 16 additions & 0 deletions conf/test/test_sentieon_dedup_bam.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/sarek -profile test,<extra_test_profile>,<docker/singularity> --outdir <OUTDIR>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

params {
input = "${projectDir}/tests/csv/3.0/mapped_single_bam.csv"
step = 'markduplicates'
tools = 'sentieon_dedup'
}
16 changes: 16 additions & 0 deletions conf/test/test_sentieon_dedup_cram.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/sarek -profile test,<extra_test_profile>,<docker/singularity> --outdir <OUTDIR>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

params {
input = "${projectDir}/tests/csv/3.0/mapped_single_cram.csv"
step = 'markduplicates'
tools = 'sentieon_dedup'
}
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@
"git_sha": "8c159ebb28cfa08890042a133bfab78de932eff7",
"installed_by": ["modules"]
},
"sentieon/dedup": {
"branch": "master",
"git_sha": "8c04ecc0c5d4ad102755b919b2525481f0380090",
"installed_by": ["modules"]
},
"snpeff/download": {
"branch": "master",
"git_sha": "aeefdd170be4583012816212f1345fbebb61ccd6",
Expand Down
76 changes: 76 additions & 0 deletions modules/nf-core/sentieon/dedup/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions modules/nf-core/sentieon/dedup/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ profiles {
annotation { includeConfig 'conf/test/test_annotation.config' }
markduplicates_bam { includeConfig 'conf/test/test_markduplicates_bam.config' }
markduplicates_cram { includeConfig 'conf/test/test_markduplicates_cram.config' }
sentieon_dedup_bam { includeConfig 'conf/test/test_sentieon_dedup_bam.config' }
sentieon_dedup_cram { includeConfig 'conf/test/test_sentieon_dedup_cram.config' }
no_intervals { includeConfig 'conf/test/test_no_intervals.config' }
pair { includeConfig 'conf/test/test_pair.config' }
prepare_recalibration_bam { includeConfig 'conf/test/test_prepare_recalibration_bam.config' }
Expand Down Expand Up @@ -304,6 +306,7 @@ includeConfig 'conf/modules/prepare_intervals.config'
includeConfig 'conf/modules/aligner.config'
includeConfig 'conf/modules/alignment_to_fastq.config'
includeConfig 'conf/modules/markduplicates.config'
includeConfig 'conf/modules/sentieon_dedup.config'
includeConfig 'conf/modules/prepare_recalibration.config'
includeConfig 'conf/modules/recalibrate.config'
includeConfig 'conf/modules/trimming.config'
Expand Down
2 changes: 1 addition & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"fa_icon": "fas fa-toolbox",
"description": "Tools to use for variant calling and/or for annotation.",
"help_text": "Multiple tools separated with commas.\n\n**Variant Calling:**\n\nGermline variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: DeepVariant, FreeBayes, HaplotypeCaller, mpileup, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit\n\nTumor-only somatic variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, mpileup, Mutect2, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit, ControlFREEC\n\nSomatic variant calling can currently only be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, Mutect2, Strelka2\n- Structural variants: Manta, TIDDIT\n- Copy-Number: ASCAT, CNVKit, Control-FREEC\n- Microsatellite Instability: MSIsensorpro\n\n> **NB** Mutect2 for somatic variant calling cannot be combined with `--no_intervals`\n\n**Annotation:**\n \n- snpEff, VEP, merge (both consecutively).\n\n> **NB** As Sarek will use bgzip and tabix to compress and index VCF files annotated, it expects VCF files to be sorted when starting from `--step annotate`.",
"pattern": "^((ascat|cnvkit|controlfreec|deepvariant|freebayes|haplotypecaller|manta|merge|mpileup|msisensorpro|mutect2|snpeff|strelka|tiddit|vep)?,?)*(?<!,)$"
"pattern": "^((ascat|cnvkit|controlfreec|deepvariant|freebayes|haplotypecaller|manta|merge|mpileup|msisensorpro|mutect2|sentieon_dedup|snpeff|strelka|tiddit|vep)?,?)*(?<!,)$"
},
"skip_tools": {
"type": "string",
Expand Down
53 changes: 53 additions & 0 deletions subworkflows/local/bam_sentieon_dedup/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// SENTIEON DEDUP
//
// For all modules here:
// A when clause condition is defined in the conf/modules.config to determine if the module should be run

include { CRAM_QC_MOSDEPTH_SAMTOOLS } from '../cram_qc_mosdepth_samtools/main'
include { GATK4_MARKDUPLICATES } from '../../../modules/nf-core/gatk4/markduplicates/main'
include { SENTIEON_DEDUP } from '../../../modules/nf-core/sentieon/dedup/main'
include { SAMTOOLS_INDEX as INDEX_INPUT } from '../../../modules/nf-core/samtools/index/main'
include { SAMTOOLS_INDEX as INDEX_DEDUPED } from '../../../modules/nf-core/samtools/index/main'
include { SAMTOOLS_INDEX as INDEX_MARKDUPLICATES } from '../../../modules/nf-core/samtools/index/main'

workflow BAM_SENTIEON_DEDUP {
take:
bam // channel: [mandatory] [ meta, bam ] // Although the channel is named "bam", it may contain cram-files.
fasta // channel: [mandatory] [ fasta ]
fasta_fai // channel: [mandatory] [ fasta_fai ]
intervals_bed_combined // channel: [optional] [ intervals_bed ]

main:
versions = Channel.empty()
reports = Channel.empty()

INDEX_INPUT(bam)
bam_bai = bam.join(INDEX_INPUT.out.bai.concat(INDEX_INPUT.out.crai), failOnMismatch:true, failOnDuplicate:true)
// The concat operation is part of the above command since if the "bam" channel contains cram-files, then the index files will be in the channel INDEX_INPUT.out.crai and not in INDEX_INPUT.out.bai
SENTIEON_DEDUP(bam_bai, fasta, fasta_fai)

INDEX_DEDUPED(SENTIEON_DEDUP.out.cram)

// Join with the crai file
cram = SENTIEON_DEDUP.out.cram.join(INDEX_DEDUPED.out.crai, failOnDuplicate: true, failOnMismatch: true)

// QC on CRAM
CRAM_QC_MOSDEPTH_SAMTOOLS(cram, fasta, intervals_bed_combined)

// Gather all reports generated
reports = reports.mix(SENTIEON_DEDUP.out.metrics)
reports = reports.mix(SENTIEON_DEDUP.out.score)
reports = reports.mix(CRAM_QC_MOSDEPTH_SAMTOOLS.out.reports)

// Gather versions of all tools used
versions = versions.mix(SENTIEON_DEDUP.out.versions)
versions = versions.mix(INDEX_DEDUPED.out.versions)
versions = versions.mix(CRAM_QC_MOSDEPTH_SAMTOOLS.out.versions)

emit:
cram
reports

versions // channel: [ versions.yml ]
}
Loading