+
Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ngsbits samplegender to check sex [#453](https://github.com/nf-core/raredisease/pull/453)
- New workflow for generating cgh files from SV vcfs for interpretation in the CytosSure interpretation software. Turned off by default [#456](https://github.com/nf-core/raredisease/pull/456/)
- Fastp to do adapter trimming. It can be skipped using `--skip_fastp` [#457](https://github.com/nf-core/raredisease/pull/457)
- Add FOUND_IN tag, which mentions the variant caller that found the mutation, in the INFO column of the vcf files [#471](https://github.com/nf-core/raredisease/pull/471)
- GATK CNVCaller uses segments instead of intervals, filters out "reference" segments between the calls, and fixes a bug with how `ch_readcount_intervals` was handled

### `Changed`
Expand Down
1 change: 1 addition & 0 deletions assets/foundin.hdr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
##INFO=<ID=FOUND_IN,Number=1,Type=String,Description="Program that called the variant">
8 changes: 8 additions & 0 deletions conf/modules/call_snv_deepvariant.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,12 @@ process {
ext.prefix = { "${meta.id}_split_rmdup" }
}

withName: '.*CALL_SNV_DEEPVARIANT:ZIP_TABIX_VARCALLERBED' {
ext.args2 = '-s 1 -b 2 -e 3'
}

withName: '.*CALL_SNV_DEEPVARIANT:BCFTOOLS_ANNOTATE' {
ext.args = "-c CHROM,FROM,TO,FOUND_IN --output-type z"
ext.prefix = { "${meta.id}_split_rmdup_info" }
}
}
9 changes: 9 additions & 0 deletions conf/modules/call_snv_sentieon.config
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,14 @@ process {
ext.args = '--output-type z --rm-dup none'
ext.prefix = { "${meta.id}_split_rmdup" }
}

withName: '.*CALL_SNV:CALL_SNV_SENTIEON:ZIP_TABIX_VARCALLERBED' {
ext.args2 = '-s 1 -b 2 -e 3'
}

withName: '.*CALL_SNV:CALL_SNV_SENTIEON:BCFTOOLS_ANNOTATE' {
ext.args = "-c CHROM,FROM,TO,FOUND_IN --output-type z"
ext.prefix = { "${meta.id}_split_rmdup_info" }
}
}
}
11 changes: 10 additions & 1 deletion conf/modules/postprocess_MT_calls.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ process {

withName: '.*POSTPROCESS_MT_CALLS:BCFTOOLS_MERGE_MT' {
ext.args = '--output-type z'
ext.prefix = { "${meta.id}_split_rmdup_merged" }
}

withName: '.*POSTPROCESS_MT_CALLS:ZIP_TABIX_VARCALLERBED' {
ext.args2 = '-s 1 -b 2 -e 3'
}

withName: '.*POSTPROCESS_MT_CALLS:BCFTOOLS_ANNOTATE' {
ext.args = "-c CHROM,FROM,TO,FOUND_IN --output-type z"
ext.prefix = { "${meta.id}_mitochondria" }
publishDir = [
path: { "${params.outdir}/call_snv/mitochondria" },
Expand All @@ -45,7 +54,7 @@ process {
]
}

withName: '.*POSTPROCESS_MT_CALLS:TABIX_TABIX_MERGE' {
withName: '.*POSTPROCESS_MT_CALLS:TABIX_ANNOTATE' {
publishDir = [
path: { "${params.outdir}/call_snv/mitochondria" },
mode: params.publish_dir_mode,
Expand Down
1 change: 1 addition & 0 deletions conf/test_one_sample.config
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ params {
known_dbsnp = "https://raw.githubusercontent.com/nf-core/test-datasets/raredisease/reference/dbsnp_-138-.vcf.gz"
ml_model = "https://s3.amazonaws.com/sentieon-release/other/SentieonDNAscopeModel1.0.model"
reduced_penetrance = "https://raw.githubusercontent.com/nf-core/test-datasets/raredisease/reference/reduced_penetrance.tsv"
score_config_mt = "https://raw.githubusercontent.com/nf-core/test-datasets/raredisease/reference/rank_model_snv.ini"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

score_config_snv = "https://raw.githubusercontent.com/nf-core/test-datasets/raredisease/reference/rank_model_snv.ini"
score_config_sv = "https://raw.githubusercontent.com/nf-core/test-datasets/raredisease/reference/rank_model_sv.ini"
svdb_query_dbs = "https://raw.githubusercontent.com/nf-core/test-datasets/raredisease/reference/svdb_querydb_files.csv"
Expand Down
15 changes: 15 additions & 0 deletions lib/WorkflowRaredisease.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ class WorkflowRaredisease {
return outfile
}

//
// Create a bed file which includes the name of variant caller from chromsizes file
//
public static String makeBedWithVariantCallerInfo(chromsizes, varcaller) {
def parent_dir = chromsizes.parent.toString()
def outfile = new File(parent_dir + '/' + varcaller +'.bed')
def writer = outfile.newWriter()
chromsizes.eachLine { line ->
def split_str = line.tokenize("\t")
writer << [split_str[0],"0",split_str[1],varcaller].join("\t") + "\n"
}
writer.close()
return outfile
}

//
// Get workflow summary for MultiQC
//
Expand Down
16 changes: 12 additions & 4 deletions subworkflows/local/call_snv.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ workflow CALL_SNV {
take:
ch_genome_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
ch_mt_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
ch_mtshift_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
ch_mtshift_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
ch_genome_chrsizes // channel: [mandatory] [ path(sizes) ]
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
ch_genome_dictionary // channel: [mandatory] [ val(meta), path(dict) ]
Expand All @@ -28,6 +29,7 @@ workflow CALL_SNV {
ch_call_interval // channel: [mandatory] [ path(intervals) ]
ch_ml_model // channel: [mandatory] [ path(model) ]
ch_case_info // channel: [mandatory] [ val(case_info) ]
ch_foundin_header // channel: [mandatory] [ path(header) ]
ch_pcr_indel_model // channel: [optional] [ val(sentieon_dnascope_pcr_indel_model) ]

main:
Expand All @@ -42,7 +44,9 @@ workflow CALL_SNV {
ch_genome_bam_bai,
ch_genome_fasta,
ch_genome_fai,
ch_case_info
ch_case_info,
ch_foundin_header,
ch_genome_chrsizes
)
ch_deepvar_vcf = CALL_SNV_DEEPVARIANT.out.vcf
ch_deepvar_tbi = CALL_SNV_DEEPVARIANT.out.tabix
Expand All @@ -57,7 +61,9 @@ workflow CALL_SNV {
ch_call_interval,
ch_ml_model,
ch_case_info,
ch_pcr_indel_model
ch_pcr_indel_model,
ch_foundin_header,
ch_genome_chrsizes
)
ch_sentieon_vcf = CALL_SNV_SENTIEON.out.vcf
ch_sentieon_tbi = CALL_SNV_SENTIEON.out.tabix
Expand Down Expand Up @@ -100,7 +106,9 @@ workflow CALL_SNV {
ch_genome_dictionary,
ch_genome_fai,
ch_mtshift_backchain,
ch_case_info
ch_case_info,
ch_foundin_header,
ch_genome_chrsizes
)

ch_versions = ch_versions.mix(CALL_SNV_MT.out.versions)
Expand Down
49 changes: 38 additions & 11 deletions subworkflows/local/variant_calling/call_snv_deepvariant.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@
// A variant caller workflow for deepvariant
//

include { BCFTOOLS_NORM as SPLIT_MULTIALLELICS_GL } from '../../../modules/nf-core/bcftools/norm/main'
include { BCFTOOLS_NORM as REMOVE_DUPLICATES_GL } from '../../../modules/nf-core/bcftools/norm/main'
include { DEEPVARIANT } from '../../../modules/nf-core/deepvariant/main'
include { GLNEXUS } from '../../../modules/nf-core/glnexus/main'
include { TABIX_TABIX as TABIX_GL } from '../../../modules/nf-core/tabix/tabix/main'
include { BCFTOOLS_ANNOTATE } from '../../../modules/nf-core/bcftools/annotate/main'
include { BCFTOOLS_NORM as SPLIT_MULTIALLELICS_GL } from '../../../modules/nf-core/bcftools/norm/main'
include { BCFTOOLS_NORM as REMOVE_DUPLICATES_GL } from '../../../modules/nf-core/bcftools/norm/main'
include { DEEPVARIANT } from '../../../modules/nf-core/deepvariant/main'
include { GLNEXUS } from '../../../modules/nf-core/glnexus/main'
include { TABIX_BGZIPTABIX as ZIP_TABIX_VARCALLERBED } from '../../../modules/nf-core/tabix/bgziptabix/main'
include { TABIX_TABIX as TABIX_GL } from '../../../modules/nf-core/tabix/tabix/main'
include { TABIX_TABIX as TABIX_ANNOTATE } from '../../../modules/nf-core/tabix/tabix/main'

workflow CALL_SNV_DEEPVARIANT {
take:
ch_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
ch_case_info // channel: [mandatory] [ val(case_info) ]
ch_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
ch_case_info // channel: [mandatory] [ val(case_info) ]
ch_foundin_header // channel: [mandatory] [ path(header) ]
ch_genome_chrsizes // channel: [mandatory] [ path(chrsizes) ]

main:
ch_versions = Channel.empty()
Expand Down Expand Up @@ -48,14 +53,36 @@ workflow CALL_SNV_DEEPVARIANT {

TABIX_GL (REMOVE_DUPLICATES_GL.out.vcf)

ch_genome_chrsizes.flatten().map{chromsizes ->
return [[id:'deepvariant'], WorkflowRaredisease.makeBedWithVariantCallerInfo(chromsizes, "deepvariant")]
}
.set { ch_varcallerinfo }

ZIP_TABIX_VARCALLERBED (ch_varcallerinfo).gz_tbi
.map{meta,bed,tbi -> return [bed, tbi]}
.set{ch_varcallerbed}

REMOVE_DUPLICATES_GL.out.vcf
.join(TABIX_GL.out.tbi)
.combine(ch_varcallerbed)
.combine(ch_foundin_header)
.set { ch_annotate_in }

BCFTOOLS_ANNOTATE(ch_annotate_in)

TABIX_ANNOTATE(BCFTOOLS_ANNOTATE.out.vcf)

ch_versions = ch_versions.mix(DEEPVARIANT.out.versions.first())
ch_versions = ch_versions.mix(GLNEXUS.out.versions)
ch_versions = ch_versions.mix(SPLIT_MULTIALLELICS_GL.out.versions)
ch_versions = ch_versions.mix(REMOVE_DUPLICATES_GL.out.versions)
ch_versions = ch_versions.mix(TABIX_GL.out.versions)
ch_versions = ch_versions.mix(ZIP_TABIX_VARCALLERBED.out.versions)
ch_versions = ch_versions.mix(BCFTOOLS_ANNOTATE.out.versions)
ch_versions = ch_versions.mix(TABIX_ANNOTATE.out.versions)

emit:
vcf = REMOVE_DUPLICATES_GL.out.vcf // channel: [ val(meta), path(vcf) ]
tabix = TABIX_GL.out.tbi // channel: [ val(meta), path(tbi) ]
vcf = BCFTOOLS_ANNOTATE.out.vcf // channel: [ val(meta), path(vcf) ]
tabix = TABIX_ANNOTATE.out.tbi // channel: [ val(meta), path(tbi) ]
versions = ch_versions // channel: [ path(versions.yml) ]
}
53 changes: 40 additions & 13 deletions subworkflows/local/variant_calling/call_snv_sentieon.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
// A subworkflow to call SNVs by sentieon dnascope with a machine learning model.
//

include { SENTIEON_DNASCOPE } from '../../../modules/nf-core/sentieon/dnascope/main'
include { SENTIEON_DNAMODELAPPLY } from '../../../modules/nf-core/sentieon/dnamodelapply/main'
include { BCFTOOLS_MERGE } from '../../../modules/nf-core/bcftools/merge/main'
include { BCFTOOLS_NORM as SPLIT_MULTIALLELICS_SEN } from '../../../modules/nf-core/bcftools/norm/main'
include { BCFTOOLS_NORM as REMOVE_DUPLICATES_SEN } from '../../../modules/nf-core/bcftools/norm/main'
include { TABIX_TABIX as TABIX_SEN } from '../../../modules/nf-core/tabix/tabix/main'
include { TABIX_TABIX as TABIX_BCFTOOLS } from '../../../modules/nf-core/tabix/tabix/main'
include { BCFTOOLS_FILTER as BCF_FILTER_ONE } from '../../../modules/nf-core/bcftools/filter/main'
include { BCFTOOLS_FILTER as BCF_FILTER_TWO } from '../../../modules/nf-core/bcftools/filter/main'
include { SENTIEON_DNASCOPE } from '../../../modules/nf-core/sentieon/dnascope/main'
include { SENTIEON_DNAMODELAPPLY } from '../../../modules/nf-core/sentieon/dnamodelapply/main'
include { BCFTOOLS_MERGE } from '../../../modules/nf-core/bcftools/merge/main'
include { BCFTOOLS_NORM as SPLIT_MULTIALLELICS_SEN } from '../../../modules/nf-core/bcftools/norm/main'
include { BCFTOOLS_NORM as REMOVE_DUPLICATES_SEN } from '../../../modules/nf-core/bcftools/norm/main'
include { TABIX_TABIX as TABIX_SEN } from '../../../modules/nf-core/tabix/tabix/main'
include { TABIX_TABIX as TABIX_BCFTOOLS } from '../../../modules/nf-core/tabix/tabix/main'
include { BCFTOOLS_FILTER as BCF_FILTER_ONE } from '../../../modules/nf-core/bcftools/filter/main'
include { BCFTOOLS_FILTER as BCF_FILTER_TWO } from '../../../modules/nf-core/bcftools/filter/main'
include { BCFTOOLS_ANNOTATE } from '../../../modules/nf-core/bcftools/annotate/main'
include { TABIX_TABIX as TABIX_ANNOTATE } from '../../../modules/nf-core/tabix/tabix/main'
include { TABIX_BGZIPTABIX as ZIP_TABIX_VARCALLERBED } from '../../../modules/nf-core/tabix/bgziptabix/main'

workflow CALL_SNV_SENTIEON {
take:
Expand All @@ -23,7 +26,9 @@ workflow CALL_SNV_SENTIEON {
ch_ml_model // channel: [mandatory] [ val(meta), path(model) ]
ch_case_info // channel: [mandatory] [ val(case_info) ]
ch_pcr_indel_model // channel: [optional] [ val(sentieon_dnascope_pcr_indel_model) ]

ch_foundin_header // channel: [mandatory] [ path(header) ]
ch_genome_chrsizes // channel: [mandatory] [ path(chrsizes) ]

main:
ch_versions = Channel.empty()

Expand Down Expand Up @@ -85,16 +90,38 @@ workflow CALL_SNV_SENTIEON {

TABIX_SEN(REMOVE_DUPLICATES_SEN.out.vcf)

ch_genome_chrsizes.flatten().map{chromsizes ->
return [[id:'sentieon_dnascope'], WorkflowRaredisease.makeBedWithVariantCallerInfo(chromsizes, "sentieon_dnascope")]
}
.set { ch_varcallerinfo }

ZIP_TABIX_VARCALLERBED (ch_varcallerinfo).gz_tbi
.map{meta,bed,tbi -> return [bed, tbi]}
.set{ch_varcallerbed}

REMOVE_DUPLICATES_SEN.out.vcf
.join(TABIX_SEN.out.tbi)
.combine(ch_varcallerbed)
.combine(ch_foundin_header)
.set { ch_annotate_in }

BCFTOOLS_ANNOTATE(ch_annotate_in)

TABIX_ANNOTATE(BCFTOOLS_ANNOTATE.out.vcf)

ch_versions = ch_versions.mix(SENTIEON_DNASCOPE.out.versions.first())
ch_versions = ch_versions.mix(SENTIEON_DNAMODELAPPLY.out.versions.first())
ch_versions = ch_versions.mix(BCFTOOLS_MERGE.out.versions.first())
ch_versions = ch_versions.mix(SPLIT_MULTIALLELICS_SEN.out.versions.first())
ch_versions = ch_versions.mix(REMOVE_DUPLICATES_SEN.out.versions.first())
ch_versions = ch_versions.mix(TABIX_SEN.out.versions.first())
ch_versions = ch_versions.mix(BCF_FILTER_ONE.out.versions.first())
ch_versions = ch_versions.mix(ZIP_TABIX_VARCALLERBED.out.versions)
ch_versions = ch_versions.mix(BCFTOOLS_ANNOTATE.out.versions)
ch_versions = ch_versions.mix(TABIX_ANNOTATE.out.versions)

emit:
vcf = REMOVE_DUPLICATES_SEN.out.vcf // channel: [ val(meta), path(vcf) ]
tabix = TABIX_SEN.out.tbi // channel: [ val(meta), path(tbi) ]
versions = ch_versions // channel: [ path(versions.yml) ]
vcf = BCFTOOLS_ANNOTATE.out.vcf // channel: [ val(meta), path(vcf) ]
tabix = TABIX_ANNOTATE.out.tbi // channel: [ val(meta), path(tbi) ]
versions = ch_versions // channel: [ path(versions.yml) ]
}
37 changes: 32 additions & 5 deletions subworkflows/local/variant_calling/postprocess_MT_calls.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ include { TABIX_TABIX as TABIX_TABIX_MT2 } from '../../..
include { BCFTOOLS_MERGE as BCFTOOLS_MERGE_MT } from '../../../modules/nf-core/bcftools/merge/main'
include { TABIX_TABIX as TABIX_TABIX_MERGE } from '../../../modules/nf-core/tabix/tabix/main'
include { PICARD_LIFTOVERVCF } from '../../../modules/nf-core/picard/liftovervcf/main'
include { BCFTOOLS_ANNOTATE } from '../../../modules/nf-core/bcftools/annotate/main'
include { TABIX_BGZIPTABIX as ZIP_TABIX_VARCALLERBED } from '../../../modules/nf-core/tabix/bgziptabix/main'
include { TABIX_TABIX as TABIX_ANNOTATE } from '../../../modules/nf-core/tabix/tabix/main'

workflow POSTPROCESS_MT_CALLS {
take:
Expand All @@ -21,6 +24,8 @@ workflow POSTPROCESS_MT_CALLS {
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
ch_mtshift_backchain // channel: [mandatory] [ val(meta), path(backchain) ]
ch_case_info // channel: [mandatory] [ val(case_info) ]
ch_foundin_header // channel: [mandatory] [ path(header) ]
ch_genome_chrsizes // channel: [mandatory] [ path(chrsizes) ]

main:
ch_versions = Channel.empty()
Expand Down Expand Up @@ -93,19 +98,41 @@ workflow POSTPROCESS_MT_CALLS {

BCFTOOLS_MERGE_MT.out.merged_variants
.mix(ch_case_vcf.single)
.set { ch_annotation_in }
.set { ch_addfoundintag_in }

TABIX_TABIX_MERGE(ch_annotation_in)
TABIX_TABIX_MERGE(ch_addfoundintag_in)

ch_genome_chrsizes.flatten().map{chromsizes ->
return [[id:'mutect2'], WorkflowRaredisease.makeBedWithVariantCallerInfo(chromsizes, "mutect2")]
}
.set { ch_varcallerinfo }

ZIP_TABIX_VARCALLERBED (ch_varcallerinfo).gz_tbi
.map{meta,bed,tbi -> return [bed, tbi]}
.set{ch_varcallerbed}

ch_addfoundintag_in
.join(TABIX_TABIX_MERGE.out.tbi)
.combine(ch_varcallerbed)
.combine(ch_foundin_header)
.set { ch_annotate_in }

BCFTOOLS_ANNOTATE(ch_annotate_in)

TABIX_ANNOTATE(BCFTOOLS_ANNOTATE.out.vcf)

ch_versions = ch_versions.mix(PICARD_LIFTOVERVCF.out.versions.first())
ch_versions = ch_versions.mix(GATK4_MERGEVCFS_LIFT_UNLIFT_MT.out.versions.first())
ch_versions = ch_versions.mix(GATK4_VARIANTFILTRATION_MT.out.versions.first())
ch_versions = ch_versions.mix(SPLIT_MULTIALLELICS_MT.out.versions.first())
ch_versions = ch_versions.mix(REMOVE_DUPLICATES_MT.out.versions.first())
ch_versions = ch_versions.mix(BCFTOOLS_MERGE_MT.out.versions)
ch_versions = ch_versions.mix(ZIP_TABIX_VARCALLERBED.out.versions)
ch_versions = ch_versions.mix(BCFTOOLS_ANNOTATE.out.versions)
ch_versions = ch_versions.mix(TABIX_ANNOTATE.out.versions)

emit:
vcf = ch_annotation_in // channel: [ val(meta), path(vcf) ]
tbi = TABIX_TABIX_MERGE.out.tbi // channel: [ val(meta), path(tbi) ]
versions = ch_versions // channel: [ path(versions.yml) ]
vcf = BCFTOOLS_ANNOTATE.out.vcf // channel: [ val(meta), path(vcf) ]
tbi = TABIX_ANNOTATE.out.tbi // channel: [ val(meta), path(tbi) ]
versions = ch_versions // channel: [ path(versions.yml) ]
}
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载