From 17e0fb8468a92372bbfe9a2ede917bd24515b09f Mon Sep 17 00:00:00 2001
From: Blaise Li <blaise.li__git@nsup.org>
Date: Mon, 15 Jul 2024 12:32:46 +0200
Subject: [PATCH] Accomodate for possible absence of small RNA type.

---
 small_RNA-seq/small_RNA-seq.snakefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/small_RNA-seq/small_RNA-seq.snakefile b/small_RNA-seq/small_RNA-seq.snakefile
index 9666f4d..ab9838e 100644
--- a/small_RNA-seq/small_RNA-seq.snakefile
+++ b/small_RNA-seq/small_RNA-seq.snakefile
@@ -2059,7 +2059,9 @@ def source_small_RNA_counts(wildcards):
 def make_tag_association(dfs, tag):
     """Associates a tag "tag" to the union of the indices of dataframes *dfs*."""
     idx = reduce(union, (df.index for df in dfs))
-    return pd.DataFrame(list(zip(idx, repeat(tag)))).set_index(0)
+    if len(idx):
+        return pd.DataFrame(list(zip(idx, repeat(tag)))).set_index(0)
+    return pd.DataFrame()
 
 
 # Could we use biotype instead?
-- 
GitLab