From 95495884b5fa6b9a4b524ad426053a348f79afd8 Mon Sep 17 00:00:00 2001 From: Nicola Wong Date: Fri, 6 Mar 2026 17:55:25 +0000 Subject: [PATCH] Fix missing exit0 for skip_phasing --- R/battenberg.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/battenberg.R b/R/battenberg.R index f46dbb8..0f367d7 100755 --- a/R/battenberg.R +++ b/R/battenberg.R @@ -314,7 +314,7 @@ battenberg = function(analysis="paired", ismale = gender == "male" } - + if (!skip_phasing[sampleidx]) { # if external phasing data is provided (as a vcf), split into chromosomes for use in haplotype reconstruction @@ -406,6 +406,10 @@ battenberg = function(analysis="paired", inputfile.postfix="_heterozygousMutBAFs_haplotyped.txt", outputfile=paste(samplename[sampleidx], "_heterozygousMutBAFs_haplotyped.txt", sep=""), chr_names=chrom_names) + } else{ + # If skip_phasing, we just end the script here and return exit status 0, as the downstream steps of Battenberg can be run with the output of the previous steps as input + print("Phasing and haplotype reconstruction is skipped as requested, exiting with status 0") + q(save="no", status=0) } # Segment the phased and haplotyped BAF data