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

WIP: Add sentieon tnseq #1497

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions conf/modules/prepare_genome.config
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ process {
}

withName: 'TABIX_DBSNP' {
ext.when = { !params.dbsnp_tbi && params.dbsnp && ((params.step == "mapping" || params.step == "markduplicates" || params.step == "prepare_recalibration") || params.tools && (params.tools.split(',').contains('controlfreec') || params.tools.split(',').contains('haplotypecaller') || params.tools.split(',').contains('sentieon_haplotyper') || params.tools.split(',').contains('sentieon_dnascope') || params.tools.split(',').contains('mutect2'))) }
ext.when = { !params.dbsnp_tbi && params.dbsnp && ((params.step == "mapping" || params.step == "markduplicates" || params.step == "prepare_recalibration") || params.tools && (params.tools.split(',').contains('controlfreec') || params.tools.split(',').contains('haplotypecaller') || params.tools.split(',').contains('sentieon_haplotyper') || params.tools.split(',').contains('sentieon_dnascope') || params.tools.split(',').contains('mutect2') || params.tools.split(',').contains('sentieon_tnhaplotyper2'))) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reference/dbsnp" },
Expand All @@ -117,7 +117,7 @@ process {
}

withName: 'TABIX_GERMLINE_RESOURCE' {
ext.when = { !params.germline_resource_tbi && params.germline_resource && params.tools && params.tools.split(',').contains('mutect2') }
ext.when = { !params.germline_resource_tbi && params.germline_resource && params.tools && (params.tools.split(',').contains('mutect2') || params.tools.split(',').contains('sentieon_tnhaplotyper2')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reference/germline_resource" },
Expand Down Expand Up @@ -147,7 +147,7 @@ process {
}

withName: 'TABIX_PON' {
ext.when = { !params.pon_tbi && params.pon && params.tools && params.tools.split(',').contains('mutect2') }
ext.when = { !params.pon_tbi && params.pon && params.tools && (params.tools.split(',').contains('mutect2') || params.tools.split(',').contains('sentieon_tnhaplotyper2')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reference/pon" },
Expand Down
116 changes: 116 additions & 0 deletions conf/modules/sentieon_tnhaplotyper2.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
----------------------------------------------------------------------------------------
*/

// TNHAPLOTYPER2

process {

if (params.tools && (params.tools.split(',').contains('sentieon_tnhaplotyper2'))) {
withName: 'SENTIEON_TNHAPLOTYPER2' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.tnhaplotyper2" : "${meta.id}.tnhaplotyper2.${intervals.simpleName}" }
ext.when = { params.tools && (params.tools.split(',').contains('sentieon_tnhaplotyper2')) }
// TO-DO: sort out the following options which are options for mutect2
// ext.args = { params.ignore_soft_clipped_bases ? "--dont-use-soft-clipped-bases true --f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" : "--f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/" },
pattern: "*{vcf.gz,vcf.gz.tbi,stats}",
saveAs: { meta.num_intervals > 1 ? null : "tnhaplotyper2/${meta.id}/${it}" }
]
}

// PAIR_VARIANT_CALLING
withName: 'SENTIEON_TNHAPLOTYPER2_PAIRED' {
ext.args2 = { params.ignore_soft_clipped_bases ?
"--trim_soft_clip --normal_sample ${meta.patient}_${meta.normal_id} --tumor_sample ${meta.patient}_${meta.tumor_id}" :
"--normal_sample ${meta.patient}_${meta.normal_id} --tumor_sample ${meta.patient}_${meta.tumor_id}" }
ext.args3 = { "--tumor_sample ${meta.patient}_${meta.tumor_id}" }
ext.args4 = { "--normal_sample ${meta.patient}_${meta.normal_id} --tumor_sample ${meta.patient}_${meta.tumor_id}" }
}

withName: 'MERGE_TNHAPLOTYPER2.*' {
ext.prefix = { "${meta.id}.tnhaplotyper2" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/tnhaplotyper2/${meta.id}" },
pattern: "*{vcf.gz,vcf.gz.tbi}"
]
}

withName: 'SENTIEON_TNFILTER' {
ext.prefix = { "${meta.id}.filtered" }
ext.args2 = { "--normal_sample ${meta.patient}_${meta.normal_id} --tumor_sample ${meta.patient}_${meta.tumor_id}" }
}

// TO-DO: I guess that kind of prefixing with the name of the subworkflow is necessary since the user may request tnhaplotyper2 and mutect2 in the same run.
// TO-DO: Add a similar prefixing for the mutect2-subworkflow in mutect2.config `
withName: '.*_SENTIEON_TNHAPLOTYPER2:GATHERPILEUPSUMMARIES.*' {
ext.prefix = { "${meta.id}.tnhaplotyper2" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/tnhaplotyper2/${meta.id}/" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*_SENTIEON_TNHAPLOTYPER2:GETPILEUPSUMMARIES.*' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.tnhaplotyper2" : "${meta.id}.tnhaplotyper2.${intervals.simpleName}" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/" },
pattern: "*.table",
saveAs: { meta.num_intervals > 1 ? null : "tnhaplotyper2/${meta.id}/${it}" }
]
}

withName: '.*_SENTIEON_TNHAPLOTYPER2:CALCULATECONTAMINATION' {
ext.prefix = { "${meta.id}.tnhaplotyper2" }
ext.args = { "-tumor-segmentation ${meta.id}.tnhaplotyper2.segmentation.table" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/tnhaplotyper2/${meta.id}" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

if (params.joint_tnhaplotyper2) {
withName: '.*_SENTIEON_TNHAPLOTYPER2:CALCULATECONTAMINATION' {
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/tnhaplotyper2/${meta.patient}" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
}

withName: '.*_SENTIEON_TNHAPLOTYPER2:SENTIEON_TNFILTER.*' {
ext.prefix = {"${meta.id}.tnhaplotyper2.filtered"}
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/" },
saveAs: { filename -> filename.equals('versions.yml') ? null : "tnhaplotyper2/${meta.id}/${filename}" }
]
}

// TO-DO: If possible, get rid of MERGEMUTECTSTATS in the tnhaplotyper2-subworkflow and use sentieon version instead.
withName: '.*_SENTIEON_TNHAPLOTYPER2:MERGEMUTECTSTATS' {
ext.prefix = { "${meta.id}.tnhaplotyper2" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/tnhaplotyper2/${meta.id}/" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

}
}
10 changes: 10 additions & 0 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ process {
ext.args = { "--f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz --normal-sample normal" }
}

withName: '.*:SENTIEON_TNHAPLOTYPER2.*'{
//sample name from when the test data was generated
ext.args2 = { "--normal_sample normal --tumor_sample tumour" }
}

withName: '.*:SENTIEON_TNFILTER.*' {
ext.prefix = { "${meta.id}.filtered" }
ext.args2 = { "--tumor_sample tumour --normal_sample normal" }
}

withName: '.*:FILTERVARIANTTRANCHES'{
ext.args = { "--info-key CNN_1D --indel-tranche 0" }
}
Expand Down
26 changes: 26 additions & 0 deletions conf/test/tools_somatic_tnhaplotyper2.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 {
// TO-DO: Put test-data in repo.
// TO-DO: Figure out which of the following settings are relevant for tnhaplotyper2
input = "/home/ubuntu/test_data_tnhaplotyper2/fixed_readgroup.csv"
chr_dir = params.test_data['homo_sapiens']['genome']['genome_21_chromosomes_dir']
dbsnp = params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz']
fasta = params.test_data['homo_sapiens']['genome']['genome_21_fasta']
germline_resource = params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz']
intervals = params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed']
pon = params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz']
nucleotides_per_second = 20
step = 'variant_calling'
tools = 'sentieon_tnhaplotyper2'
wes = true
}
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,16 @@
"git_sha": "e809c6b078d5343bdf8b5b2b78483096a2b5a973",
"installed_by": ["modules"]
},
"sentieon/tnfilter": {
"branch": "master",
"git_sha": "388b763df527bb267cde359ded753a05e33fc0aa",
"installed_by": ["modules"]
},
"sentieon/tnhaplotyper2": {
"branch": "master",
"git_sha": "30e382429b9761f39906982cc2cb1c31e0706ebe",
"installed_by": ["modules"]
},
"sentieon/varcal": {
"branch": "master",
"git_sha": "e809c6b078d5343bdf8b5b2b78483096a2b5a973",
Expand Down
83 changes: 83 additions & 0 deletions modules/nf-core/sentieon/tnfilter/main.nf

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

85 changes: 85 additions & 0 deletions modules/nf-core/sentieon/tnfilter/meta.yml

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

Loading
Loading