Skip to content

Commit 68c077d

Browse files
committed
adding in devider for whole-segment haplotyping
1 parent 440732c commit 68c077d

File tree

8 files changed

+1155
-2613
lines changed

8 files changed

+1155
-2613
lines changed

modules/devider.nf

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
process PHASE_READS_WITH_DEVIDER {
2+
3+
/* */
4+
5+
tag "${sample_id}"
6+
// publishDir
7+
8+
errorStrategy { task.attempt < 3 ? 'retry' : 'ignore' }
9+
maxRetries 2
10+
11+
cpus 4
12+
13+
input:
14+
tuple val(sample_id), path(reads), path(vcf), path(fasta_ref)
15+
16+
output:
17+
path "${sample_id}_devider"
18+
19+
script:
20+
"""
21+
devider
22+
-b ${reads} \
23+
-v ${vcf} \
24+
-r ${fasta_ref} \
25+
-o ${sample_id}_devider \
26+
-t ${task.cpus} \
27+
--preset ${devider_preset}
28+
"""
29+
30+
}

modules/samtools.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ process SPLIT_SEGMENTS {
180180
tuple val(sample_id), path(bam), path(index)
181181

182182
output:
183-
path "${sample_id}_*.bam"
183+
tuple val(sample_id), path("${sample_id}_*.bam")
184184

185185
shell:
186186
'''

nextflow.config

+3
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ params {
139139
// nextclade dataset
140140
nextclade_dataset = null
141141

142+
// devider haplotype phasing preset
143+
devider_preset = "nanopore-r10" // old-long-reads, nanopore-r9, nanopore-r10, hi-fi
144+
142145
// nextclade dataset cache
143146
nextclade_cache = "$launchDir/work/nextclade_datasets"
144147

pixi.lock

+1,108-2,610
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ csvtk = { version = ">=0.30.0,<0.31", channel = "bioconda"}
8888
snpsift = ">=5.2,<6"
8989
bbmap = ">=39.1,<40"
9090
bedtools = ">=2.31.1,<3"
91+
devider = ">=0.0.1,<0.0.2"
9192

9293
[tool.uv]
9394
dev-dependencies = [

subworkflows/haplotyping.nf

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
#!/usr/bin/env nextflow
21

32
include { SPLIT_SEGMENTS ; FASTQ_CONVERSION } from "../modules/samtools"
43
include { IDENTIFY_HAPLOTYPES } from "../modules/vsearch"
54

65
workflow HAPLOTYPING {
76
take:
87
ch_bams
8+
ch_vcfs
9+
ch_ref
910

1011
main:
1112
SPLIT_SEGMENTS(
1213
ch_bams
1314
)
1415

16+
PHASE_READS_WITH_DEVIDER(
17+
SPLIT_SEGMENTS.out.join(ch_vcfs).combine(ch_ref)
18+
)
19+
1520
FASTQ_CONVERSION(
1621
SPLIT_SEGMENTS.out.flatten().map { bam ->
1722
tuple(file(bam).getSimpleName().split("_")[0..-2].join('_'), bam)

subworkflows/variant_calling.nf

+3
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@ workflow VARIANTS {
5050
MERGE_VCF_FILES(
5151
ANNOTATE_VCF.out.map { _label, vcf -> vcf }.collect()
5252
)
53+
54+
emit:
55+
ANNOTATE_VCF.out.
5356
}

workflows/nanopore.nf

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ workflow NANOPORE {
7070
if ( params.primer_bed && Utils.countFastaHeaders(params.refseq) == Utils.countAmplicons(params.primer_bed) ) {
7171

7272
HAPLOTYPING (
73-
ALIGNMENT.out
73+
ALIGNMENT.out,
74+
VARIANTS.out,
75+
ch_refseq
7476
)
7577

7678
}

0 commit comments

Comments
 (0)