Skip to content

Commit 286db43

Browse files
authored
Merge branch 'dev' into allow-bait-padding-zero
2 parents 03af0c5 + 6d4f9ea commit 286db43

File tree

7 files changed

+78
-91
lines changed

7 files changed

+78
-91
lines changed

conf/modules/annotate_genome_snvs.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
process {
1919

2020
withName: '.*ANNOTATE_GENOME_SNVS:BCFTOOLS_ROH' {
21-
ext.when = { meta.probands.size()>0 }
2221
ext.args = { "--samples ${meta.probands.unique().first()} --skip-indels " }
2322
ext.prefix = { "${meta.id}_roh" }
2423
}

conf/modules/annotate_structural_variants.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818
process {
1919

2020
withName: '.*ANNOTATE_STRUCTURAL_VARIANTS:SVDB_QUERY_BEDPE' {
21-
ext.when = {!params.svdb_query_bedpedbs.equals(null)}
2221
ext.prefix = { "${meta.id}_bedpedb" }
2322
}
2423

2524
withName: '.*ANNOTATE_STRUCTURAL_VARIANTS:SVDB_QUERY_DB' {
26-
ext.when = {!params.svdb_query_dbs.equals(null)}
2725
ext.prefix = { "${meta.id}_vcfdb" }
2826
}
2927

conf/modules/call_snv_deepvariant.config

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717

1818
process {
1919

20-
withName: '.*CALL_SNV_DEEPVARIANT:.*' {
21-
ext.when = params.variant_caller.equals("deepvariant")
22-
}
23-
2420
withName: '.*CALL_SNV_DEEPVARIANT:DEEPVARIANT' {
2521
ext.args = { [
2622
"--model_type=${params.analysis_type.toUpperCase()}",

main.nf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,16 @@ workflow NFCORE_RAREDISEASE {
159159
: channel.value([])
160160
ch_sdf = params.sdf ? channel.fromPath(params.sdf).map{it -> [[id:it.simpleName],it]}.collect()
161161
: ch_references.sdf
162-
ch_sv_dbs = params.svdb_query_dbs ? channel.fromPath(params.svdb_query_dbs)
163-
: channel.empty()
164-
ch_sv_bedpedbs = params.svdb_query_bedpedbs ? channel.fromPath(params.svdb_query_bedpedbs)
165-
: channel.empty()
166162
ch_svd_bed = params.verifybamid_svd_bed ? channel.fromPath(params.verifybamid_svd_bed)
167163
: channel.empty()
168164
ch_svd_mu = params.verifybamid_svd_mu ? channel.fromPath(params.verifybamid_svd_mu)
169165
: channel.empty()
170166
ch_svd_ud = params.verifybamid_svd_ud ? channel.fromPath(params.verifybamid_svd_ud)
171167
: channel.empty()
168+
ch_svdb_bedpedbs = params.svdb_query_bedpedbs ? channel.fromList(samplesheetToList(params.svdb_query_bedpedbs, "assets/svdb_query_bedpe_schema.json")).collect()
169+
: channel.empty()
170+
ch_svdb_dbs = params.svdb_query_dbs ? channel.fromList(samplesheetToList(params.svdb_query_dbs, "assets/svdb_query_vcf_schema.json")).collect()
171+
: channel.empty()
172172
ch_target_bed = ch_references.target_bed
173173
ch_target_intervals = ch_references.target_intervals
174174
ch_variant_catalog = params.variant_catalog ? channel.fromPath(params.variant_catalog).map { it -> [[id:it.simpleName],it]}.collect()
@@ -344,12 +344,12 @@ workflow NFCORE_RAREDISEASE {
344344
ch_score_config_snv,
345345
ch_score_config_sv,
346346
ch_sdf,
347-
ch_sv_bedpedbs,
348-
ch_sv_dbs,
349347
ch_svcaller_priority,
350348
ch_svd_bed,
351349
ch_svd_mu,
352350
ch_svd_ud,
351+
ch_svdb_bedpedbs,
352+
ch_svdb_dbs,
353353
ch_target_bed,
354354
ch_target_intervals,
355355
ch_variant_catalog,
@@ -364,6 +364,8 @@ workflow NFCORE_RAREDISEASE {
364364
ch_vep_extra_files,
365365
ch_versions,
366366
params.analysis_type,
367+
params.svdb_query_bedpedbs,
368+
params.svdb_query_dbs,
367369
skip_me_calling,
368370
skip_me_annotation,
369371
skip_mt_annotation,

subworkflows/local/annotate_genome_snvs.nf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ workflow ANNOTATE_GENOME_SNVS {
4848
ch_vcf_scatter_in = channel.empty()
4949
ch_vep_in = channel.empty()
5050

51-
BCFTOOLS_ROH (ch_vcf, ch_gnomad_af, [], [], [], [])
51+
ch_vcf
52+
.filter { meta, _vcf, _tbi ->
53+
meta.probands.size() > 0
54+
}
55+
.set { ch_roh_in }
56+
57+
BCFTOOLS_ROH (ch_roh_in, ch_gnomad_af, [], [], [], [])
5258

5359
RHOCALL_ANNOTATE (ch_vcf, BCFTOOLS_ROH.out.roh, [])
5460

subworkflows/local/annotate_structural_variants.nf

Lines changed: 55 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -13,87 +13,71 @@ workflow ANNOTATE_STRUCTURAL_VARIANTS {
1313

1414
take:
1515
ch_vcf // channel: [mandatory] [ val(meta), path(vcf) ]
16-
ch_sv_dbs // channel: [mandatory] [ val(csv) ]
17-
ch_sv_bedpedbs // channel: [mandatory] [ val(csv) ]
16+
svdb_query_bedpedbs // String: [optional] params.svdb_query_bedpedbs
17+
svdb_query_dbs // String: [optional] params.svdb_query_dbs
1818
val_vep_genome // string: [mandatory] GRCh37 or GRCh38
1919
val_vep_cache_version // string: [mandatory] default: 107
20+
ch_svdb_bedpedbs // channel: [optional]
21+
ch_svdb_dbs // channel: [optional]
2022
ch_vep_cache // channel: [mandatory] [ path(cache) ]
2123
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
2224
ch_genome_dictionary // channel: [mandatory] [ val(meta), path(dict) ]
2325
ch_vep_extra_files // channel: [mandatory] [ path(files) ]
2426

2527
main:
2628
ch_versions = channel.empty()
27-
ch_svdb_dbs = channel.empty()
28-
ch_svdb_bedpedbs = channel.empty()
29-
30-
ch_sv_dbs
31-
.splitCsv ( header:true )
32-
.multiMap { row ->
33-
vcf_dbs: row.filename
34-
in_frqs: row.in_freq_info_key
35-
in_occs: row.in_allele_count_info_key
36-
out_frqs: row.out_freq_info_key
37-
out_occs: row.out_allele_count_info_key
38-
}
39-
.set { ch_svdb_dbs }
40-
41-
ch_sv_bedpedbs
42-
.splitCsv ( header:true )
43-
.multiMap { row ->
44-
bedpedbs: row.filename
45-
in_frqs: row.in_freq_info_key
46-
in_occs: row.in_allele_count_info_key
47-
out_frqs: row.out_freq_info_key
48-
out_occs: row.out_allele_count_info_key
49-
}
50-
.set { ch_svdb_bedpedbs }
51-
52-
SVDB_QUERY_DB (
53-
ch_vcf,
54-
ch_svdb_dbs.in_occs.toList(),
55-
ch_svdb_dbs.in_frqs.toList(),
56-
ch_svdb_dbs.out_occs.toList(),
57-
ch_svdb_dbs.out_frqs.toList(),
58-
ch_svdb_dbs.vcf_dbs.toList(),
59-
[]
60-
)
61-
62-
ch_vcf
63-
.join(SVDB_QUERY_DB.out.vcf, remainder: true)
64-
.branch { meta, vcfcalls, annotatedvcf ->
65-
original_call: annotatedvcf.equals(null)
66-
return [meta, vcfcalls]
67-
annotated_with_db: !(annotatedvcf.equals(null))
68-
return [meta, annotatedvcf]
69-
}
70-
.set { ch_for_mix_querydb }
71-
72-
ch_querydb_out = ch_for_mix_querydb.original_call.mix(ch_for_mix_querydb.annotated_with_db)
73-
74-
SVDB_QUERY_BEDPE (
75-
ch_querydb_out,
76-
ch_svdb_bedpedbs.in_occs.toList(),
77-
ch_svdb_bedpedbs.in_frqs.toList(),
78-
ch_svdb_bedpedbs.out_occs.toList(),
79-
ch_svdb_bedpedbs.out_frqs.toList(),
80-
[],
81-
ch_svdb_bedpedbs.bedpedbs.toList()
82-
)
83-
84-
ch_querydb_out
85-
.join(SVDB_QUERY_BEDPE.out.vcf, remainder: true)
86-
.branch { meta, annotated_db, annotated_bedped ->
87-
querydb_out: annotated_bedped.equals(null)
88-
return [meta, annotated_db]
89-
querybedped_out: !(annotated_bedped.equals(null))
90-
return [meta, annotated_bedped]
91-
}
92-
.set { ch_for_mix_querybedpedb }
93-
94-
ch_querypedbed_out = ch_for_mix_querybedpedb.querydb_out.mix(ch_for_mix_querybedpedb.querybedped_out)
9529

96-
PICARD_SORTVCF(ch_querypedbed_out, ch_genome_fasta, ch_genome_dictionary)
30+
if (svdb_query_dbs) {
31+
ch_svdb_dbs
32+
.multiMap { file, in_freq_info_key, in_allele_count_info_key, out_freq_info_key, out_allele_count_info_key ->
33+
vcf_dbs: file
34+
in_frqs: in_freq_info_key
35+
in_occs: in_allele_count_info_key
36+
out_frqs: out_freq_info_key
37+
out_occs: out_allele_count_info_key
38+
}
39+
.set { ch_svdb_dbs }
40+
41+
SVDB_QUERY_DB (
42+
ch_vcf,
43+
ch_svdb_dbs.in_occs.toList(),
44+
ch_svdb_dbs.in_frqs.toList(),
45+
ch_svdb_dbs.out_occs.toList(),
46+
ch_svdb_dbs.out_frqs.toList(),
47+
ch_svdb_dbs.vcf_dbs.toList(),
48+
[]
49+
)
50+
51+
ch_vcf = SVDB_QUERY_DB.out.vcf
52+
ch_versions = ch_versions.mix(SVDB_QUERY_DB.out.versions)
53+
}
54+
55+
if (svdb_query_bedpedbs) {
56+
ch_svdb_bedpedbs
57+
.multiMap { file, in_freq_info_key, in_allele_count_info_key, out_freq_info_key, out_allele_count_info_key ->
58+
bedpedbs: file
59+
in_frqs: in_freq_info_key
60+
in_occs: in_allele_count_info_key
61+
out_frqs: out_freq_info_key
62+
out_occs: out_allele_count_info_key
63+
}
64+
.set { ch_svdb_bedpedbs }
65+
66+
SVDB_QUERY_BEDPE (
67+
ch_vcf,
68+
ch_svdb_bedpedbs.in_occs.toList(),
69+
ch_svdb_bedpedbs.in_frqs.toList(),
70+
ch_svdb_bedpedbs.out_occs.toList(),
71+
ch_svdb_bedpedbs.out_frqs.toList(),
72+
[],
73+
ch_svdb_bedpedbs.bedpedbs.toList()
74+
)
75+
76+
ch_vcf = SVDB_QUERY_BEDPE.out.vcf
77+
ch_versions = ch_versions.mix(SVDB_QUERY_BEDPE.out.versions)
78+
}
79+
80+
PICARD_SORTVCF(ch_vcf, ch_genome_fasta, ch_genome_dictionary)
9781

9882
PICARD_SORTVCF.out.vcf
9983
.map { meta, vcf -> return [meta,vcf,[]] }
@@ -116,8 +100,6 @@ workflow ANNOTATE_STRUCTURAL_VARIANTS {
116100

117101
TABIX_VEP (ENSEMBLVEP_SV.out.vcf)
118102

119-
ch_versions = ch_versions.mix(SVDB_QUERY_DB.out.versions)
120-
ch_versions = ch_versions.mix(SVDB_QUERY_BEDPE.out.versions)
121103
ch_versions = ch_versions.mix(PICARD_SORTVCF.out.versions)
122104
ch_versions = ch_versions.mix(BCFTOOLS_VIEW.out.versions)
123105
ch_versions = ch_versions.mix(ENSEMBLVEP_SV.out.versions)

workflows/raredisease.nf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ workflow RAREDISEASE {
132132
ch_score_config_snv
133133
ch_score_config_sv
134134
ch_sdf
135-
ch_sv_bedpedbs
136-
ch_sv_dbs
137135
ch_svcaller_priority
138136
ch_svd_bed
139137
ch_svd_mu
140138
ch_svd_ud
139+
ch_svdb_bedpedbs
140+
ch_svdb_dbs
141141
ch_target_bed
142142
ch_target_intervals
143143
ch_variant_catalog
@@ -152,6 +152,8 @@ workflow RAREDISEASE {
152152
ch_vep_extra_files
153153
ch_versions
154154
analysis_type
155+
svdb_query_bedpedbs
156+
svdb_query_dbs
155157
skip_me_calling
156158
skip_me_annotation
157159
skip_mt_annotation
@@ -551,10 +553,12 @@ workflow RAREDISEASE {
551553
if (!skip_sv_annotation) {
552554
ANNOTATE_STRUCTURAL_VARIANTS (
553555
CALL_STRUCTURAL_VARIANTS.out.vcf,
554-
ch_sv_dbs,
555-
ch_sv_bedpedbs,
556+
svdb_query_bedpedbs,
557+
svdb_query_dbs,
556558
params.genome,
557559
params.vep_cache_version,
560+
ch_svdb_bedpedbs,
561+
ch_svdb_dbs,
558562
ch_vep_cache,
559563
ch_genome_fasta,
560564
ch_genome_dictionary,

0 commit comments

Comments
 (0)