From 3a0d9325a6df4c2fa6e8ce8cc39e6c067890a7fe Mon Sep 17 00:00:00 2001 From: M Bernt Date: Sun, 10 Nov 2019 22:16:00 +0100 Subject: [PATCH] grouping: strip newlines fixes https://github.com/galaxyproject/galaxy/issues/8383 more generally: if grouping is done on the last column then the newline was retained and contained in the output. --- tools/stats/grouping.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/stats/grouping.py b/tools/stats/grouping.py index 87bfcb89436..eeb2b79b079 100644 --- a/tools/stats/grouping.py +++ b/tools/stats/grouping.py @@ -124,7 +124,9 @@ def main(): item = line.split("\t")[group_col] except IndexError: stop_err("The following line didn't have %s columns: %s" % (group_col + 1, line)) - + # in case of grouping by the last column the newline character needs to be removed + # removal of other white spaces seems also useful + item = item.strip() if ignorecase == 1: return item.lower() return item