From ae8116bf9f7734571cc30602a50aad30eb6acd65 Mon Sep 17 00:00:00 2001 From: Blaise Li <blaise.li__git@nsup.org> Date: Fri, 28 Oct 2022 14:25:45 +0200 Subject: [PATCH] Escaping column name in query. This caused bugs with libraries named "1_1", which was interpreted as number 11. --- RNA_Seq_Cecere/RNA-seq.snakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RNA_Seq_Cecere/RNA-seq.snakefile b/RNA_Seq_Cecere/RNA-seq.snakefile index 03798aa..fd6421f 100644 --- a/RNA_Seq_Cecere/RNA-seq.snakefile +++ b/RNA_Seq_Cecere/RNA-seq.snakefile @@ -1367,10 +1367,10 @@ def do_linear_regression(data, x_col, y_col, y_min=0, fit_intercept=True, transf """ if transform is not None: data = getattr(np, transform)( - data[[x_col, y_col]].dropna().query(f"{y_col} >= {y_min}")).replace( + data[[x_col, y_col]].dropna().query(f"`{y_col}` >= {y_min}")).replace( [np.inf, -np.inf], np.nan).dropna() else: - data = data[[x_col, y_col]].dropna().query(f"{y_col} >= {y_min}") + data = data[[x_col, y_col]].dropna().query(f"`{y_col}` >= {y_min}") lm = LinearRegression(fit_intercept=fit_intercept) X = data.drop(y_col, axis=1) lm.fit(X, data[y_col]) -- GitLab