From 6eff6c4cc097feba53022898ddfe96f26386e258 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 24 Mar 2016 15:57:54 +0000 Subject: Mapping results table is now limited to the top 200 markers; previously the page took a long time to load when there were too many markers --- wqflask/wqflask/marker_regression/marker_regression.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index 09dd7852..6d996bd3 100644 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -1025,12 +1025,14 @@ def trim_markers_for_table(markers): sorted_markers = sorted(markers, key=lambda k: k['lod_score'], reverse=True) else: sorted_markers = sorted(markers, key=lambda k: k['lrs_value'], reverse=True) - trimmed_sorted_markers = sorted_markers[:int(len(sorted_markers) * 0.001)] - - if len(trimmed_sorted_markers) < 50: - return sorted_markers - else: + + #ZS: So we end up with a list of just 200 markers + if len(sorted_markers) >= 200: + trimming_factor = 200 / len(sorted_markers) + trimmed_sorted_markers = sorted_markers[:int(len(sorted_markers) * trimming_factor)] return trimmed_sorted_markers + else: + return sorted_markers def get_markers_from_csv(included_markers, p_values, group_name): -- cgit v1.2.3