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

Issue 509 & 313 #533

Merged
merged 14 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
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) - Subway map for building indexes
- [#512](https://github.com/nf-core/sarek/pull/512) - 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
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
19 changes: 18 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 @@ -641,9 +657,10 @@ workflow SAREK {
[meta, normal[2], normal[3], tumor[2], tumor[3]]
}


FriederikeHanssen marked this conversation as resolved.
Show resolved Hide resolved
// GERMLINE VARIANT CALLING
GERMLINE_VARIANT_CALLING(
cram_variant_calling_status.normal,
cram_variant_calling_status_normal,
dbsnp,
dbsnp_tbi,
dict,
Expand Down