-
Notifications
You must be signed in to change notification settings - Fork 417
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
Implemented MSISENSORPRO tumor-only analysis #1737
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,7 @@ include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nf | |
include { PREPARE_GENOME } from './subworkflows/local/prepare_genome' | ||
include { PREPARE_INTERVALS } from './subworkflows/local/prepare_intervals' | ||
include { PREPARE_REFERENCE_CNVKIT } from './subworkflows/local/prepare_reference_cnvkit' | ||
include { MSISENSORPRO_SCAN } from './modules/nf-core/msisensorpro/scan/main' | ||
|
||
// Initialize fasta file with meta map: | ||
fasta = params.fasta ? Channel.fromPath(params.fasta).map{ it -> [ [id:it.baseName], it ] }.collect() : Channel.empty() | ||
|
@@ -91,6 +92,7 @@ germline_resource = params.germline_resource ? Channel.fromPath(para | |
known_indels = params.known_indels ? Channel.fromPath(params.known_indels).collect() : Channel.value([]) | ||
known_snps = params.known_snps ? Channel.fromPath(params.known_snps).collect() : Channel.value([]) | ||
mappability = params.mappability ? Channel.fromPath(params.mappability).collect() : Channel.value([]) | ||
msisensorpro_baseline = params.msisensorpro_baseline ? Channel.fromPath(params.msisensorpro_baseline).collect() : Channel.empty() | ||
pon = params.pon ? Channel.fromPath(params.pon).collect() : Channel.value([]) // PON is optional for Mutect2 (but highly recommended) | ||
sentieon_dnascope_model = params.sentieon_dnascope_model ? Channel.fromPath(params.sentieon_dnascope_model).collect() : Channel.value([]) | ||
|
||
|
@@ -166,8 +168,18 @@ workflow NFCORE_SAREK { | |
aligner == "bwa-mem2" ? bwamem2 : | ||
dragmap | ||
|
||
// TODO: add a params for msisensorpro_scan | ||
msisensorpro_scan = PREPARE_GENOME.out.msisensorpro_scan | ||
// Reference msi list for MSIsensorpro | ||
if (params.tools && params.tools.split(',').contains('msisensorpro')) { | ||
if (params.msisensorpro_scan) { | ||
msisensorpro_scan = Channel.fromPath(params.msisensorpro_scan).collect() | ||
} else { | ||
MSISENSORPRO_SCAN(fasta) | ||
msisensorpro_scan = MSISENSORPRO_SCAN.out.list.map{ meta, list -> [list] } | ||
versions = versions.mix(MSISENSORPRO_SCAN.out.versions) | ||
} | ||
} else { | ||
msisensorpro_scan = Channel.empty() | ||
} | ||
|
||
// For ASCAT, extracted from zip or tar.gz files | ||
allele_files = PREPARE_GENOME.out.allele_files | ||
|
@@ -177,7 +189,7 @@ workflow NFCORE_SAREK { | |
rt_file = PREPARE_GENOME.out.rt_file | ||
|
||
// Tabix indexed vcf files | ||
bcftools_annotations_tbi = params.bcftools_annotations ? params.bcftools_annotations_tbi ? Channel.fromPath(params.bcftools_annotations_tbi).collect() : PREPARE_GENOME.out.bcftools_annotations_tbi : Channel.empty([]) | ||
bcftools_annotations_tbi = params.bcftools_annotations ? params.bcftools_annotations_tbi ? Channel.fromPath(params.bcftools_annotations_tbi).collect() : PREPARE_GENOME.out.bcftools_annotations_tbi : Channel.value([]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. merged your PR, so If you merge in dev this should hopefully be fixed already There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes thanks for that, this is just shipped along. |
||
dbsnp_tbi = params.dbsnp ? params.dbsnp_tbi ? Channel.fromPath(params.dbsnp_tbi).collect() : PREPARE_GENOME.out.dbsnp_tbi : Channel.value([]) | ||
germline_resource_tbi = params.germline_resource ? params.germline_resource_tbi ? Channel.fromPath(params.germline_resource_tbi).collect() : PREPARE_GENOME.out.germline_resource_tbi : [] //do not change to Channel.value([]), the check for its existence then fails for Getpileupsumamries | ||
known_indels_tbi = params.known_indels ? params.known_indels_tbi ? Channel.fromPath(params.known_indels_tbi).collect() : PREPARE_GENOME.out.known_indels_tbi : Channel.value([]) | ||
|
@@ -296,6 +308,7 @@ workflow NFCORE_SAREK { | |
loci_files, | ||
mappability, | ||
msisensorpro_scan, | ||
msisensorpro_baseline, | ||
ngscheckmate_bed, | ||
pon, | ||
pon_tbi, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,13 +44,12 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { | |
wes // boolean: [mandatory] [default: false] whether targeted data is processed | ||
|
||
main: | ||
versions = Channel.empty() | ||
versions = Channel.empty() | ||
|
||
//TODO: Temporary until the if's can be removed and printing to terminal is prevented with "when" in the modules.config | ||
vcf_freebayes = Channel.empty() | ||
vcf_manta = Channel.empty() | ||
vcf_strelka = Channel.empty() | ||
out_msisensorpro = Channel.empty() | ||
vcf_mutect2 = Channel.empty() | ||
vcf_tiddit = Channel.empty() | ||
|
||
|
@@ -175,11 +174,10 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { | |
} | ||
|
||
// MSISENSOR | ||
if (tools.split(',').contains('msisensorpro')) { | ||
if (tools.split(',').contains('msisensorpro') && msisensorpro_scan) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be strictly necessary since the empty channel should skip the tool There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remember I tried without it but it failed for some reason that I can't remember now so I think it was necessary. |
||
MSISENSORPRO_MSISOMATIC(cram.combine(intervals_bed_combined), fasta.map{ meta, fasta -> [ fasta ] }, msisensorpro_scan) | ||
|
||
versions = versions.mix(MSISENSORPRO_MSISOMATIC.out.versions) | ||
out_msisensorpro = out_msisensorpro.mix(MSISENSORPRO_MSISOMATIC.out.output_report) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason you are not emitting the output of the workflow anymore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not used anywhere else, just published in the output directory. MultiQC does not support msisensorpro yet. |
||
} | ||
|
||
// MUTECT2 | ||
|
@@ -190,7 +188,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { | |
// joint_mutect2 mode needs different meta.map than regular mode | ||
cram.map{ meta, normal_cram, normal_crai, tumor_cram, tumor_crai -> | ||
joint_mutect2 ? | ||
//we need to keep all fields and then remove on a per-tool-basis to ensure proper joining at the filtering step | ||
// we need to keep all fields and then remove on a per-tool-basis to ensure proper joining at the filtering step | ||
[ meta + [ id:meta.patient ], [ normal_cram, tumor_cram ], [ normal_crai, tumor_crai ] ] : | ||
[ meta, [ normal_cram, tumor_cram ], [ normal_crai, tumor_crai ] ] | ||
}, | ||
|
@@ -232,7 +230,6 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { | |
) | ||
|
||
emit: | ||
out_msisensorpro | ||
vcf_all | ||
vcf_freebayes | ||
vcf_manta | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ include { BAM_VARIANT_CALLING_SINGLE_TIDDIT } from '../bam_variant_cal | |
include { BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC } from '../bam_variant_calling_tumor_only_controlfreec/main' | ||
include { BAM_VARIANT_CALLING_TUMOR_ONLY_MANTA } from '../bam_variant_calling_tumor_only_manta/main' | ||
include { BAM_VARIANT_CALLING_TUMOR_ONLY_MUTECT2 } from '../bam_variant_calling_tumor_only_mutect2/main' | ||
include { MSISENSORPRO_MSITUMORONLY } from '../../../modules/nf-core/msisensorpro/msitumoronly/main' | ||
|
||
workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { | ||
take: | ||
|
@@ -32,21 +33,22 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { | |
intervals_bed_combined // channel: [mandatory] intervals/target regions in one file unzipped | ||
intervals_bed_gz_tbi_combined // channel: [mandatory] intervals/target regions in one file zipped | ||
mappability | ||
msisensorpro_baseline // channel: [optional] msisensorpro_baseline | ||
panel_of_normals // channel: [optional] panel_of_normals | ||
panel_of_normals_tbi // channel: [optional] panel_of_normals_tbi | ||
joint_mutect2 // boolean: [mandatory] [default: false] run mutect2 in joint mode | ||
wes // boolean: [mandatory] [default: false] whether targeted data is processed | ||
|
||
main: | ||
versions = Channel.empty() | ||
versions = Channel.empty() | ||
|
||
//TODO: Temporary until the if's can be removed and printing to terminal is prevented with "when" in the modules.config | ||
vcf_freebayes = Channel.empty() | ||
vcf_manta = Channel.empty() | ||
vcf_mpileup = Channel.empty() | ||
vcf_mutect2 = Channel.empty() | ||
vcf_strelka = Channel.empty() | ||
vcf_tiddit = Channel.empty() | ||
vcf_freebayes = Channel.empty() | ||
vcf_manta = Channel.empty() | ||
vcf_mpileup = Channel.empty() | ||
vcf_mutect2 = Channel.empty() | ||
vcf_strelka = Channel.empty() | ||
vcf_tiddit = Channel.empty() | ||
|
||
// MPILEUP | ||
if (tools.split(',').contains('mpileup') || tools.split(',').contains('controlfreec')) { | ||
|
@@ -109,6 +111,13 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { | |
versions = versions.mix(BAM_VARIANT_CALLING_FREEBAYES.out.versions) | ||
} | ||
|
||
// MSISENSOR | ||
if (tools.split(',').contains('msisensorpro') && msisensorpro_baseline) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar here, if the baseline is require than the tool shouldn't run on an empty channel There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remember I tried without it but it failed for some reason that I can't remember now so I think it was necessary. |
||
MSISENSORPRO_MSITUMORONLY(cram.combine(intervals_bed_combined), fasta.map{ meta, fasta -> [ fasta ] }, msisensorpro_baseline) | ||
|
||
versions = versions.mix(MSISENSORPRO_MSITUMORONLY.out.versions) | ||
} | ||
|
||
// MUTECT2 | ||
if (tools.split(',').contains('mutect2')) { | ||
BAM_VARIANT_CALLING_TUMOR_ONLY_MUTECT2( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ include { BWA_INDEX as BWAMEM1_INDEX } from '../../../modules/nf- | |
include { BWAMEM2_INDEX } from '../../../modules/nf-core/bwamem2/index/main' | ||
include { DRAGMAP_HASHTABLE } from '../../../modules/nf-core/dragmap/hashtable/main' | ||
include { GATK4_CREATESEQUENCEDICTIONARY } from '../../../modules/nf-core/gatk4/createsequencedictionary/main' | ||
include { MSISENSORPRO_SCAN } from '../../../modules/nf-core/msisensorpro/scan/main' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the reason to move this out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved it to main workflow file |
||
include { SAMTOOLS_FAIDX } from '../../../modules/nf-core/samtools/faidx/main' | ||
include { TABIX_TABIX as TABIX_BCFTOOLS_ANNOTATIONS } from '../../../modules/nf-core/tabix/tabix/main' | ||
include { TABIX_TABIX as TABIX_DBSNP } from '../../../modules/nf-core/tabix/tabix/main' | ||
|
@@ -50,7 +49,6 @@ workflow PREPARE_GENOME { | |
DRAGMAP_HASHTABLE(fasta) // If aligner is dragmap | ||
|
||
GATK4_CREATESEQUENCEDICTIONARY(fasta) | ||
MSISENSORPRO_SCAN(fasta) | ||
SAMTOOLS_FAIDX(fasta, [ [ id:'no_fai' ], [] ] ) | ||
|
||
// the following are flattened and mapped in case the user supplies more than one value for the param | ||
|
@@ -105,7 +103,6 @@ workflow PREPARE_GENOME { | |
versions = versions.mix(BWAMEM2_INDEX.out.versions) | ||
versions = versions.mix(DRAGMAP_HASHTABLE.out.versions) | ||
versions = versions.mix(GATK4_CREATESEQUENCEDICTIONARY.out.versions) | ||
versions = versions.mix(MSISENSORPRO_SCAN.out.versions) | ||
versions = versions.mix(SAMTOOLS_FAIDX.out.versions) | ||
versions = versions.mix(TABIX_BCFTOOLS_ANNOTATIONS.out.versions) | ||
versions = versions.mix(TABIX_DBSNP.out.versions) | ||
|
@@ -125,7 +122,6 @@ workflow PREPARE_GENOME { | |
germline_resource_tbi = TABIX_GERMLINE_RESOURCE.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: germline_resource.vcf.gz.tbi | ||
known_snps_tbi = TABIX_KNOWN_SNPS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: {known_indels*}.vcf.gz.tbi | ||
known_indels_tbi = TABIX_KNOWN_INDELS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: {known_indels*}.vcf.gz.tbi | ||
msisensorpro_scan = MSISENSORPRO_SCAN.out.list.map{ meta, list -> [list] } // path: genome_msi.list | ||
pon_tbi = TABIX_PON.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: pon.vcf.gz.tbi | ||
|
||
allele_files // path: allele_files | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something we can put in the PREPARE* subworkflows together with other reference computations for tools?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that first, but it was being generated unnecessarily if msi analysis was not requested. I couldn't find a way to avoid that in the PREPARE* subworkflows so left it like this.