From 74753080de9c4a801619f654fbfbcf3906b9c565 Mon Sep 17 00:00:00 2001
From: Blaise Li <blaise.li__git@nsup.org>
Date: Wed, 15 May 2019 18:42:17 +0200
Subject: [PATCH] Plot gene lists without selection_label set.

Also switched to read_csv to remove warnings.

The latex processing fails when no X server is available, it seems that
xcolor package is not loaded.
---
 plot_lfclfc_scatter.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/plot_lfclfc_scatter.py b/plot_lfclfc_scatter.py
index a561786..9478e63 100755
--- a/plot_lfclfc_scatter.py
+++ b/plot_lfclfc_scatter.py
@@ -97,11 +97,11 @@ class Scatterplot:
         else:
             x_usecols = ["gene", x_column, *extra_cols].__contains__
             y_usecols = ["gene", y_column, *extra_cols].__contains__
-        x_data = pd.read_table(
-            x_input_file, index_col="gene", usecols=x_usecols).rename(
+        x_data = pd.read_csv(
+            x_input_file, sep="\t", index_col="gene", usecols=x_usecols).rename(
                 columns={x_column: "x"})
-        y_data = pd.read_table(
-            y_input_file, index_col="gene", usecols=y_usecols).rename(
+        y_data = pd.read_csv(
+            y_input_file, sep="\t", index_col="gene", usecols=y_usecols).rename(
                 columns={y_column: "y"})
         # Just some experiments
         # from cytoolz import merge_with
@@ -445,7 +445,7 @@ def main():
             "%s.log" % args.plot_name)
         with open(out_log, "w") as log_file:
             print(" \\\n\t".join(sys.argv), file=log_file)
-        if gene_list and args.selection_label:
+        if gene_list:
             plot_data.data.assign(hightlighted=plot_data.data.apply(
                 # apply takes a function of row
                 # get the row name
@@ -453,7 +453,8 @@ def main():
                 compose(curry(contains)(gene_list), attrgetter("name")),
                 axis=1)).to_csv(
                     out_table, sep="\t")
-            list_name = args.selection_label
+            if args.selection_label:
+                list_name = args.selection_label
             # if args.gene_list:
             #     if args.selection_label:
             #         list_name = args.selection_label
-- 
GitLab