From 621efa9410a27d660b0baf8c0cf1a744328096bd Mon Sep 17 00:00:00 2001 From: Amine Ghozlane Date: Mon, 18 Nov 2024 15:18:18 +0100 Subject: [PATCH] Move vcf with shutil instead of rename --- meteor/variantcalling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meteor/variantcalling.py b/meteor/variantcalling.py index 484143f..4db4179 100644 --- a/meteor/variantcalling.py +++ b/meteor/variantcalling.py @@ -17,6 +17,7 @@ import lzma import bgzip import pickle +import shutil from subprocess import CalledProcessError, run, Popen, PIPE from dataclasses import dataclass from pathlib import Path @@ -31,7 +32,6 @@ import pandas as pd from typing import ClassVar import numpy as np -import pysam def run_freebayes_chunk( @@ -666,7 +666,7 @@ def execute(self) -> None: logging.info("Merging vcf") self.merge_vcf_files(vcf_chunk_files, vcf_file) else: - Path(vcf_chunk_files[0]).rename(vcf_file) + shutil.move(str(vcf_chunk_files[0]), str(vcf_file.resolve())) logging.info( "Completed freebayes step in %f seconds", perf_counter() - startfreebayes )