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

TMB #616

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open

TMB #616

Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add new step to handle vcf&tbi combi
  • Loading branch information
FriederikeHanssen committed Nov 10, 2022
commit 500543c7023f010d8842efc0c056544649caa35c
3 changes: 2 additions & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"prepare_recalibration",
"recalibrate",
"variant_calling",
"annotate"
"annotate",
"post-process"
]
},
"input": {
Expand Down
37 changes: 28 additions & 9 deletions workflows/sarek.nf
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ include { VCF_QC_BCFTOOLS_VCFTOOLS } from '../subworkflows
include { VCF_ANNOTATE_ALL } from '../subworkflows/local/vcf_annotate_all/main'

// Tumor mutational burden
include { TUMOR_MUTATIONAL_BURDEN } from '../subworkflows/nf-core/tumor_mutational_burden'
include { TUMOR_MUTATIONAL_BURDEN } from '../subworkflows/local/tumor_mutational_burden'

// REPORTING VERSIONS OF SOFTWARE USED
include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main'
Expand Down Expand Up @@ -869,7 +869,7 @@ workflow SAREK {

if (params.tools) {

if (params.step == 'annotate') ch_cram_variant_calling = Channel.empty()
if (params.step == 'annotate' || params.step == 'post-process') ch_cram_variant_calling = Channel.empty()

//
// Logic to separate germline samples, tumor samples with no matched normal, and combine tumor-normal pairs
Expand Down Expand Up @@ -1054,16 +1054,22 @@ workflow SAREK {
vep_cache,
vep_extra_files)

vcf_to_postprocess = VCF_ANNOTATE_ALL.out.vcf_ann

// Gather used softwares versions
ch_versions = ch_versions.mix(VCF_ANNOTATE_ALL.out.versions)
ch_reports = ch_reports.mix(VCF_ANNOTATE_ALL.out.reports)
}

if(params.tools && params.tools.contains('tmb')){
vcf_to_tmb = vcf_to_annotate //TODO: proper input ANNOTATE.out.vcf_ann
// Post-process
if (params.step == 'post-process') vcf_to_postprocess = ch_input_sample

if (params.tools.split(',').contains('tmb') ) {

TUMOR_MUTATIONAL_BURDEN(vcf_to_postprocess, fasta, intervals_bed_combined)

ch_versions = ch_versions.mix(TUMOR_MUTATIONAL_BURDEN.out.versions)

intervals_bed_combined.view()
TUMOR_MUTATIONAL_BURDEN(vcf_to_tmb, fasta, intervals_bed_combined)
}
}

Expand Down Expand Up @@ -1333,7 +1339,20 @@ def extract_csv(csv_file) {
}

// annotation
} else if (row.vcf) {
} else if (row.vcf && !row.tbi) {
meta.id = meta.sample
def vcf = file(row.vcf, checkIfExists: true)

meta.data_type = 'vcf'
meta.variantcaller = row.variantcaller ?: ''

if (params.step == 'annotate') return [meta, vcf]
else {
log.error "Samplesheet contains vcf files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations"
System.exit(1)
}
// post-process
} else if (row.tbi) {
meta.id = meta.sample
def vcf = file(row.vcf, checkIfExists: true)
def tbi = file(row.tbi, checkIfExists: true)
Expand All @@ -1342,9 +1361,9 @@ def extract_csv(csv_file) {
meta.variantcaller = row.variantcaller ?: ''
meta.annotation = row.annotation ?: ''

if (params.step == 'annotate') return [meta, vcf, tbi]
if (params.step == 'post-process') return [meta, vcf, tbi]
else {
log.error "Samplesheet contains vcf files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations"
log.error "Samplesheet contains vcf & tbi files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations"
System.exit(1)
}
} else {
Expand Down