diff --git a/filters_preprint.yaml b/filters_preprint.yaml index 743abdc..2b938a5 100644 --- a/filters_preprint.yaml +++ b/filters_preprint.yaml @@ -1,4 +1,7 @@ -bad_mutations: +controls: + - sample ~ /^control/ + +bad_mutations: - proto v3 - mutations in [ 28461G, 11201G, 26801C, -28461G, -11201G, -26801C ] diff --git a/lollipop/preprocessors.py b/lollipop/preprocessors.py index 62af257..4a3de7d 100644 --- a/lollipop/preprocessors.py +++ b/lollipop/preprocessors.py @@ -186,12 +186,14 @@ def apply_filter_statement(name, fs): ) case "~" | "=~" | "~=": return col.str.contains( - val[1, -2] if val[0] == val[-1] in "/@" else val + val[1:-1] if not m["qv"] and val[0] == val[-1] in "/@" else val ) case "!~" | "~!": return ~( col.str.contains( - val[1, -2] if val[0] == val[-1] in "/@" else val + val[1:-1] + if not m["qv"] and val[0] == val[-1] in "/@" + else val ) ) case _ as o: