Skip to content
Open

TMB #616

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
9 changes: 9 additions & 0 deletions assets/tmb/mutect2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Describe the fields
## For definition, provide the expected key:values
## Note that several keys/values can be defined
##
###############################################

freq: "AF"
depth: "DP"
altDepth: "AD"
115 changes: 115 additions & 0 deletions assets/tmb/snpeff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
## Describe the fields
## For definition, provide the expected key:values
## Note that several keys/values can be defined

###############################################
## SnpEff Parsing

## Tags
tag: "ANN"
sep: "&"

## Annotation flags

isCoding:
1:
- chromosome_number_variation
- coding_sequence_variant
- conservative_inframe_deletion
- conservative_inframe_insertion
- disruptive_inframe_deletion
- disruptive_inframe_insertion
- exon_loss
- exon_loss_variant
- exon_variant
- frameshift_variant
- gene_variant
- initiator_codon_variant
- missense_variant
- rare_amino_acid_variant
- splice_acceptor_variant
- splice_donor_variant
- splice_region_variant
- start_lost
- start_retained
- stop_gained
- stop_lost
- stop_retained_variant
- synonymous_variant
- transcript_ablation
- transcript_amplification
- transcript_variant

isNonCoding:
1:
- 3_prime_UTR_truncation
- 3_prime_UTR_variant
- 5_prime_UTR_premature_start_codon_gain_variant
- 5_prime_UTR_truncation
- 5_prime_UTR_variant
- conserved_intergenic_variant
- conserved_intron_variant
- downstream_gene_variant
- feature_elongation
- feature_truncation
- intergenic_region
- intragenic_variant
- intron_variant
- mature_miRNA_variant
- miRNA
- NMD_transcript_variant
- non_coding_transcript_exon_variant
- non_coding_transcript_variant
- regulatory_region_ablation
- regulatory_region_amplification
- regulatory_region_variant
- TF_binding_site_variant
- TFBS_ablation
- TFBS_amplification
- upstream_gene_variant

isSplicing:
1:
- splice_donor_variant
- splice_acceptor_variant
- splice_region_variant

isSynonymous:
1:
- start_retained_variant
- stop_retained_variant
- synonymous_variant

isNonSynonymous:
1:
- frameshift_variant
- missense_variant
- rare_amino_acid_variant
- splice_acceptor_variant
- splice_donor_variant
- splice_region_variant
- start_lost
- stop_gained
- stop_lost

## Databases
cancerDb:
cosmic:
- cosmic_coding_ID
- cosmic_noncoding_ID

polymDb:
1k:
- kg_AMR_AF
- kg_AFR_AF
- kg_EAS_AF
- kg_EUR_AF
- kg_SAS_AF
- KG_AF_GLOBAL

gnomad:
- gnomAD_genomes_AF
- AF

esp:
- ESP_AF_GLOBAL
12 changes: 12 additions & 0 deletions assets/tmb/strelka.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Describe the fields
## For definition, provide the expected key:values
## Note that several keys/values can be defined
##
###############################################

freq: "AF"
depth: "DP" #####FORMAT=<ID=DP,Number=1,Type=Integer,Description="Read depth for tier1 (used+filtered)">
altDepth: "AD"
###FORMAT=<ID=AF,Number=A,Type=Float,Description="Allele fractions of alternate alleles in the tumor">
#####FORMAT=<ID=DP,Number=1,Type=Integer,Description="Approximate read depth (reads with MQ=255 or with bad mates are filtered)">
###FORMAT=<ID=AD,Number=R,Type=Integer,Description="Allelic depths for the ref and alt alleles in the order listed">
11 changes: 11 additions & 0 deletions conf/modules/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,15 @@ process {
withName: 'VCFTOOLS_SUMMARY' {
ext.args = "--FILTER-summary"
}

if (params.tools && params.tools.split(',').contains('tmb')) {
withName: 'BCFTOOLS_NORM'{
ext.args = "-m-"
ext.prefix = { "${vcf.baseName.minus(".vcf")}_norm" }
}

withName: 'TMB' {
ext.args = { "--sample ${meta.patient}_{meta.sample} " } //sample here is the tumor_id
}
}
}
35 changes: 35 additions & 0 deletions lib/WorkflowSarek.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,39 @@ class WorkflowSarek {
exit 1, "Unknown step $params.step"
}
}

public static String getTMBdatabase(String annotation) {

String dbConfig = "";

switch (annotation) {
case 'snpeff': dbConfig = "/assets/tmb/snpeff.yml";
break
case 'vep': dbConfig = "/assets/tmb/vep.yml";
break
// default: log.warn "Please provide a valid annotation tool"
// exit 1, "Unknown tool ${annotation}"
}

return dbConfig
}

public static String getTMBvariantcaller(String variantcaller) {

String varConfig = "";

switch (variantcaller) {
case 'freebayes': varConfig = "/assets/tmb/freebayes.yml";
break
case 'mutect2': varConfig = "/assets/tmb/mutect2.yml";
break
case 'strelka': varConfig = "/assets/tmb/strelka.yml";
break
// default: log.warn "Please provide a valid variantcalling tool"
// exit 1, "Unknown tool ${variantcaller}"
}

return varConfig

}
}
4 changes: 4 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905"
},
"bcftools/norm": {
"branch": "master",
"git_sha": "78cf39939fbe160a1410c44a6c5946f9a4c56e7e"
},
"bcftools/sort": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905"
Expand Down
38 changes: 38 additions & 0 deletions modules/local/tmb/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
process TMB {
tag "$meta.id"
label 'process_low'

conda (params.enable_conda ? "bioconda::tmb=1.3.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/tmb:1.3.0--pyh5e36f6f_0':
'quay.io/biocontainers/tmb:1.3.0--pyh5e36f6f_0' }"

input:
tuple val(meta), path(vcf), path (dbconfig), path (varconfig)
path (target_bed)

output:
tuple val(meta), path("*.log"), emit: log
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def target_bed = target_bed ? "--bed ${target_bed}" : ""
"""
pyTMB.py -i $vcf \
--dbConfig ${dbconfig} \
--varConfig ${varconfig} \
${target_bed} \
$args \
> ${prefix}.log

cat <<-END_VERSIONS > versions.yml
"${task.process}":
tmb: \$(echo \$(pyTMB.py --version 2>&1) | sed 's/^.*pyTMB.py //; s/.*\$//' | sed 's|[()]||g')
END_VERSIONS
"""
}
48 changes: 48 additions & 0 deletions modules/nf-core/bcftools/norm/main.nf

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

52 changes: 52 additions & 0 deletions modules/nf-core/bcftools/norm/meta.yml

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

5 changes: 3 additions & 2 deletions 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 Expand Up @@ -89,7 +90,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|snpeff|strelka|tiddit|tmb|vep)?,?)*[^,]+$"
},
"skip_tools": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/prepare_intervals/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ workflow PREPARE_INTERVALS {
ch_intervals_combined = Channel.fromPath(file("${params.outdir}/no_intervals.bed"))
.map{ it -> [[id:it.simpleName], it]}

} else if (params.step != 'annotate' && params.step != 'controlfreec') {
} else if (params.step != 'controlfreec') {

//If no interval/target file is provided, then intervals are generated from FASTA file
if (!params.intervals) {
Expand Down
Loading