Skip to content

Commit c22def3

Browse files
committed
Update db handling in snpeff_snpeff
1 parent 27bf8c7 commit c22def3

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

modules.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,6 @@
224224
"modules"
225225
]
226226
},
227-
"kraken2/build": {
228-
"branch": "master",
229-
"git_sha": "b30b51e5d2d08f1f36f314a20ce4b9deddf2a5c1",
230-
"installed_by": [
231-
"modules"
232-
]
233-
},
234227
"kraken2/kraken2": {
235228
"branch": "master",
236229
"git_sha": "81880787133db07d9b4c1febd152c090eb8325dc",

subworkflows/local/additional_annotation.nf

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ workflow ADDITIONAL_ANNOTATION {
1515
take:
1616
vcf // channel: [ val(meta), [ vcf ] ]
1717
tbi // channel: [ val(meta), [ tbi ] ]
18-
fasta // path : genome.fasta
18+
fasta_path // path : genome.fasta
1919
annot // path : additional_annotation
2020
pangolin // channel: [ val(meta), [ csv ] ]
2121

@@ -45,18 +45,34 @@ workflow ADDITIONAL_ANNOTATION {
4545
ch_snpeff_config = Channel.empty()
4646

4747
SNPEFF_BUILD (
48-
fasta,
48+
fasta_path,
4949
ch_annot
5050
)
5151
ch_snpeff_db = SNPEFF_BUILD.out.db
5252
ch_snpeff_config = SNPEFF_BUILD.out.config
5353
ch_versions = ch_versions.mix(SNPEFF_BUILD.out.versions)
54-
ch_cache_empty = Channel.empty()
54+
55+
fasta = fasta_path
56+
.map { file ->
57+
def filename = file.name
58+
def basename = filename.take(filename.lastIndexOf('.'))
59+
basename
60+
}
61+
62+
fasta_basename = fasta_path.map { files ->
63+
def file = files[0]
64+
def filename = file.getBaseName()
65+
return filename
66+
}
67+
68+
snpeff_cache = ch_snpeff_db.collect()
69+
.map{ cache -> [ [ id:fasta.value ], cache ] }
5570

5671
SNPEFF_SNPEFF (
5772
vcf,
58-
ch_snpeff_db,
59-
ch_cache_empty
73+
fasta_basename,
74+
snpeff_cache,
75+
ch_snpeff_config
6076
)
6177
ch_versions = ch_versions.mix(SNPEFF_SNPEFF.out.versions.first())
6278

subworkflows/local/snpeff_snpsift.nf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,25 @@ workflow SNPEFF_SNPSIFT {
1717
main:
1818

1919
ch_versions = Channel.empty()
20-
2120
fasta = fasta_path
2221
.map { file ->
2322
def filename = file.name
2423
def basename = filename.take(filename.lastIndexOf('.'))
2524
basename
2625
}
26+
27+
fasta_basename = fasta_path.map { files ->
28+
def file = files[0]
29+
def filename = file.getBaseName()
30+
return filename
31+
}
32+
2733
snpeff_cache = db.collect()
2834
.map{ cache -> [ [ id:fasta.value ], cache ] }
2935

3036
SNPEFF_SNPEFF (
3137
vcf,
32-
"GCA_009858895.3_ASM985889v3_genomic.200409",
38+
fasta_basename,
3339
snpeff_cache,
3440
config
3541
)

0 commit comments

Comments
 (0)