aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2021-06-08 19:12:28 +0000
committerzsloan2021-06-08 19:12:28 +0000
commit3d3b153f42da30caab130a84b3eb7c3b8c3dd05b (patch)
treec88f8c0bd331f0a788c5fc50a0ef0917fb0acc76
parent69f6397c8f07245f10b4e21b23f769567db9b17f (diff)
downloadgenenetwork2-3d3b153f42da30caab130a84b3eb7c3b8c3dd05b.tar.gz
Fix issue where some groups apparently don't have samplelists
-rw-r--r--wqflask/wqflask/export_traits.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/wqflask/wqflask/export_traits.py b/wqflask/wqflask/export_traits.py
index a22d6acc..5459dc31 100644
--- a/wqflask/wqflask/export_traits.py
+++ b/wqflask/wqflask/export_traits.py
@@ -65,14 +65,18 @@ def export_search_results_csv(targs):
traits_by_group = sort_traits_by_group(trait_list)
file_list = []
- for group in list(traits_by_group.keys()):
+ for group in traits_by_group:
group_traits = traits_by_group[group]
+ samplelist = group_traits[0].dataset.group.samplelist
+ if not samplelist:
+ continue
+
buff = io.StringIO()
writer = csv.writer(buff)
csv_rows = []
sample_headers = []
- for sample in group_traits[0].dataset.group.samplelist:
+ for sample in samplelist:
sample_headers.append(sample)
sample_headers.append(sample + "_SE")