Skip to content

Commit

Permalink
Fix an error with --dry-run
Browse files Browse the repository at this point in the history
  • Loading branch information
DonFreed committed Oct 31, 2024
1 parent ab45377 commit 232ec4f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sentieon_cli/dnascope.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ def call_variants(
gvcf: bool = False,
skip_svs: bool = False,
skip_version_check: bool = False,
dry_run: bool = False,
**_kwargs: Any,
) -> int:
"""Call SNVs, indels, and SVs using DNAscope"""
Expand Down Expand Up @@ -429,8 +430,9 @@ def call_variants(

# Remove the tmp_vcf
tmp_vcf_idx = pathlib.Path(str(tmp_vcf) + ".tbi")
tmp_vcf_idx.unlink(missing_ok=True)
tmp_vcf.unlink()
if not dry_run:
tmp_vcf_idx.unlink(missing_ok=True)
tmp_vcf.unlink()

# Genotype gVCFs
if gvcf:
Expand Down Expand Up @@ -462,8 +464,9 @@ def call_variants(
)
run(shlex.join(driver.build_cmd()))
out_svs_tmp_idx = pathlib.Path(str(out_svs_tmp) + ".tbi")
out_svs_tmp.unlink()
out_svs_tmp_idx.unlink(missing_ok=True)
if not dry_run:
out_svs_tmp.unlink()
out_svs_tmp_idx.unlink(missing_ok=True)

return 0

Expand Down

0 comments on commit 232ec4f

Please sign in to comment.