about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pyhegp/pyhegp.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/pyhegp/pyhegp.py b/pyhegp/pyhegp.py
index 3ffa314..f204a36 100644
--- a/pyhegp/pyhegp.py
+++ b/pyhegp/pyhegp.py
@@ -111,7 +111,17 @@ def encrypt_genotype(genotype, key, summary):
                      axis="columns")
 
 def cat_genotype(genotypes):
-    return pd.concat(genotypes)
+    match genotypes:
+        # If there are no input data frames, return an empty data
+        # frame with the chromosome and position columns.
+        case []:
+            genotype = pd.DataFrame(data={"chromosome": [],
+                                          "position": []})
+            genotype.chromosome = genotype.chromosome.astype("str")
+            genotype.position = genotype.position.astype("int")
+            return genotype
+        case _:
+            return pd.concat(genotypes)
 
 @click.group()
 def main():