diff options
author | zsloan | 2016-03-24 15:57:54 +0000 |
---|---|---|
committer | zsloan | 2016-03-24 15:57:54 +0000 |
commit | 6eff6c4cc097feba53022898ddfe96f26386e258 (patch) | |
tree | a0c46000ad826e416c37d4f490f4156144f9548b | |
parent | 04d0803abc543df0afc50d7a1bcafe797cb1bf67 (diff) | |
download | genenetwork2-6eff6c4cc097feba53022898ddfe96f26386e258.tar.gz |
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
-rw-r--r-- | wqflask/wqflask/marker_regression/marker_regression.py | 12 |
1 files 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): |