Skip to content

Commit

Permalink
Merge pull request #533 from FriederikeHanssen/issue_509
Browse files Browse the repository at this point in the history
Issue 509 & 313
  • Loading branch information
FriederikeHanssen authored May 4, 2022
2 parents 9edd5fc + e3868b4 commit 9a6b79a
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- "mutect2"
- "msisensorpro"
# - 'save_bam_mapped'
- "variantcalling_channel"
- "skip_markduplicates"
- "strelka"
- "split_fastq"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#507](https://github.com/nf-core/sarek/pull/507), [#537](https://github.com/nf-core/sarek/pull/537) - Subway map for building indexes
- [#512](https://github.com/nf-core/sarek/pull/512), [#531](https://github.com/nf-core/sarek/pull/531), [#537](https://github.com/nf-core/sarek/pull/537) - Subway map for pipeline
- [#522](https://github.com/nf-core/sarek/pull/522) - Add QC for vcf files & MultiQC
- [#533](https://github.com/nf-core/sarek/pull/533) - Add param `--only_paired_variant_calling` to allow skipping of germline variantcalling for paired samples

### Changed

Expand Down
7 changes: 7 additions & 0 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ profiles {
use_gatk_spark {
params.use_gatk_spark = 'baserecalibrator,markduplicates'
}
variantcalling_channels {
params.input = "${baseDir}/tests/csv/3.0/recalibrated.csv"
params.fasta = "${params.genomes_base}/data/genomics/homo_sapiens/genome/chr21/sequence/genome.fasta"
params.wes = true
params.step = 'variant_calling'
params.intervals = "${params.genomes_base}/data/genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed"
}
}

//This is apparently useless as it won't overwrite things in the modules.config
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ params {
sequencing_center = null // No sequencing center to be written in BAM header by aligner

// Variant Calling
only_paired_variant_calling = false //if true, skips germline variant calling for normal-paired samples
ploidy = 2 //null (in ascat, test this works) // Use default value, you can use 2,3,4
ascat_purity = null // Use default value
cf_coeff = 0.05 // default value for Control-FREEC
Expand Down
5 changes: 5 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@
"default": "",
"fa_icon": "fas fa-toolbox",
"properties": {
"only_paired_variant_calling": {
"type": "boolean",
"fa_icon": "fas fa-angle-double-right",
"description": "If true, skips germline variant calling for matched normal to tumor sample. Normal samples without matched tumor will still be processed through germline variant calling tools."
},
"ploidy": {
"type": "number",
"fa_icon": "fas fa-bacon",
Expand Down
53 changes: 53 additions & 0 deletions tests/test_only_paired_VC.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
- name: Skip variant calling on matched normal
command: nextflow run main.nf -profile test,variantcalling_channels,docker --tools strelka --only_paired_variant_calling
tags:
- somatic
- strelka
- variant_calling
- variantcalling_channel
files:
- path: results/variant_calling/sample1/strelka/sample1.variants.vcf.gz
- path: results/variant_calling/sample1/strelka/sample1.variants.vcf.gz.tbi
- path: results/variant_calling/sample1/strelka/sample1.genome.vcf.gz
- path: results/variant_calling/sample1/strelka/sample1.genome.vcf.gz.tbi
- path: results/variant_calling/sample3/strelka/sample3.variants.vcf.gz
should_exist: false
- path: results/variant_calling/sample3/strelka/sample3.variants.vcf.gz.tbi
should_exist: false
- path: results/variant_calling/sample3/strelka/sample3.genome.vcf.gz
should_exist: false
- path: results/variant_calling/sample3/strelka/sample3.genome.vcf.gz.tbi
should_exist: false
- path: results/variant_calling/sample2/strelka/sample2.variants.vcf.gz
- path: results/variant_calling/sample2/strelka/sample2.variants.vcf.gz.tbi
- path: results/variant_calling/sample2/strelka/sample2.genome.vcf.gz
- path: results/variant_calling/sample2/strelka/sample2.genome.vcf.gz.tbi
- path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_indels.vcf.gz
- path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_indels.vcf.gz.tbi
- path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz
- path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz.tbi

- name: Do germline variant calling on matched normal
command: nextflow run main.nf -profile test,variantcalling_channels,docker --tools strelka
tags:
- somatic
- strelka
- variant_calling
- variantcalling_channel
files:
- path: results/variant_calling/sample1/strelka/sample1.variants.vcf.gz
- path: results/variant_calling/sample1/strelka/sample1.variants.vcf.gz.tbi
- path: results/variant_calling/sample1/strelka/sample1.genome.vcf.gz
- path: results/variant_calling/sample1/strelka/sample1.genome.vcf.gz.tbi
- path: results/variant_calling/sample3/strelka/sample3.variants.vcf.gz
- path: results/variant_calling/sample3/strelka/sample3.variants.vcf.gz.tbi
- path: results/variant_calling/sample3/strelka/sample3.genome.vcf.gz
- path: results/variant_calling/sample3/strelka/sample3.genome.vcf.gz.tbi
- path: results/variant_calling/sample2/strelka/sample2.variants.vcf.gz
- path: results/variant_calling/sample2/strelka/sample2.variants.vcf.gz.tbi
- path: results/variant_calling/sample2/strelka/sample2.genome.vcf.gz
- path: results/variant_calling/sample2/strelka/sample2.genome.vcf.gz.tbi
- path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_indels.vcf.gz
- path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_indels.vcf.gz.tbi
- path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz
- path: results/variant_calling/sample4_vs_sample3/strelka/sample4_vs_sample3.somatic_snvs.vcf.gz.tbi
18 changes: 17 additions & 1 deletion workflows/sarek.nf
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,22 @@ workflow SAREK {
// and remove patient ID field & null value for further processing [meta1, [cram1,crai1]] [meta2, [cram2,crai2]]
cram_variant_calling_tumor_only = cram_variant_calling_tumor_filtered.transpose().map{ it -> [it[1], it[2], it[3]] }

if(params.only_paired_variant_calling){
// Normal only samples

// 1. Join with tumor samples, in each channel there is one key per patient now. Patients without matched tumor end up with: [patient1, [meta1], [cram1,crai1], null] as there is only one matched normal possible
cram_variant_calling_normal_joined = cram_variant_calling_normal_to_cross.join(cram_variant_calling_tumor_grouped, remainder: true)

// 2. Filter out entries with last entry null
cram_variant_calling_normal_filtered = cram_variant_calling_normal_joined.filter{ it -> !(it.last()) }

// 3. Remove patient ID field & null value for further processing [meta1, [cram1,crai1]] [meta2, [cram2,crai2]] (no transposing needed since only one normal per patient ID)
cram_variant_calling_status_normal = cram_variant_calling_normal_filtered.map{ it -> [it[1], it[2], it[3]] }

}else{
cram_variant_calling_status_normal = cram_variant_calling_status.normal
}

// Tumor - normal pairs
// Use cross to combine normal with all tumor samples, i.e. multi tumor samples from recurrences
cram_variant_calling_pair = cram_variant_calling_normal_to_cross.cross(cram_variant_calling_pair_to_cross)
Expand All @@ -643,7 +659,7 @@ workflow SAREK {

// GERMLINE VARIANT CALLING
GERMLINE_VARIANT_CALLING(
cram_variant_calling_status.normal,
cram_variant_calling_status_normal,
dbsnp,
dbsnp_tbi,
dict,
Expand Down

0 comments on commit 9a6b79a

Please sign in to comment.