From eb0ebae5c3051f50b1bafc924a2a02897aff293d Mon Sep 17 00:00:00 2001
From: Mia Croiset <mia.croiset@ens-lyon.fr>
Date: Mon, 22 Jan 2024 14:36:46 +0100
Subject: [PATCH] try correct writing in pre pairs file

---
 bin/hicstuff_build_matrix.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/hicstuff_build_matrix.py b/bin/hicstuff_build_matrix.py
index c8bf3e4..8c47ac3 100755
--- a/bin/hicstuff_build_matrix.py
+++ b/bin/hicstuff_build_matrix.py
@@ -72,7 +72,7 @@ def pairs2matrix(
     # )
 
     cmd = 'grep -v ^# %s | sort -S 2G -k8,8n -k9,9n --parallel=1' % pairs_file
-    with open(pre_mat_file, "a") as fout:
+    with open(pre_mat_file, "w") as fout:
         fout.write(str(os.system(cmd)))
 
     header_size = len(hio.get_pairs_header(pre_mat_file))
-- 
GitLab