From 9fa1964dcdc127ef1f094f88725e44898eb00439 Mon Sep 17 00:00:00 2001
From: yqiqichen <s2459130@ed.ac.uk>
Date: Mon, 20 May 2024 09:18:07 +0100
Subject: [PATCH] Modify BurrowsWheelerLibrary.py

---
 src/alphaimpute2/Imputation/BurrowsWheelerLibrary.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/alphaimpute2/Imputation/BurrowsWheelerLibrary.py b/src/alphaimpute2/Imputation/BurrowsWheelerLibrary.py
index ae55132..7557127 100644
--- a/src/alphaimpute2/Imputation/BurrowsWheelerLibrary.py
+++ b/src/alphaimpute2/Imputation/BurrowsWheelerLibrary.py
@@ -59,6 +59,10 @@ def removeMissingValues(self):
     def setup_library(self, loci=None, create_reverse_library=False, create_a=False):
         self.removeMissingValues()
         self.haplotypes = np.array(self.haplotypes)
+
+        if self.haplotypes.size == 0:
+            return
+
         if loci is not None:
             bw_loci = np.array(loci, dtype=np.int64)
             sub_library = self.haplotypes[:, bw_loci]