Commit 74753080 authored by Blaise Li's avatar Blaise Li
Browse files

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.
parent c423fc12
...@@ -97,11 +97,11 @@ class Scatterplot: ...@@ -97,11 +97,11 @@ class Scatterplot:
else: else:
x_usecols = ["gene", x_column, *extra_cols].__contains__ x_usecols = ["gene", x_column, *extra_cols].__contains__
y_usecols = ["gene", y_column, *extra_cols].__contains__ y_usecols = ["gene", y_column, *extra_cols].__contains__
x_data = pd.read_table( x_data = pd.read_csv(
x_input_file, index_col="gene", usecols=x_usecols).rename( x_input_file, sep="\t", index_col="gene", usecols=x_usecols).rename(
columns={x_column: "x"}) columns={x_column: "x"})
y_data = pd.read_table( y_data = pd.read_csv(
y_input_file, index_col="gene", usecols=y_usecols).rename( y_input_file, sep="\t", index_col="gene", usecols=y_usecols).rename(
columns={y_column: "y"}) columns={y_column: "y"})
# Just some experiments # Just some experiments
# from cytoolz import merge_with # from cytoolz import merge_with
...@@ -445,7 +445,7 @@ def main(): ...@@ -445,7 +445,7 @@ def main():
"%s.log" % args.plot_name) "%s.log" % args.plot_name)
with open(out_log, "w") as log_file: with open(out_log, "w") as log_file:
print(" \\\n\t".join(sys.argv), file=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( plot_data.data.assign(hightlighted=plot_data.data.apply(
# apply takes a function of row # apply takes a function of row
# get the row name # get the row name
...@@ -453,7 +453,8 @@ def main(): ...@@ -453,7 +453,8 @@ def main():
compose(curry(contains)(gene_list), attrgetter("name")), compose(curry(contains)(gene_list), attrgetter("name")),
axis=1)).to_csv( axis=1)).to_csv(
out_table, sep="\t") out_table, sep="\t")
list_name = args.selection_label if args.selection_label:
list_name = args.selection_label
# if args.gene_list: # if args.gene_list:
# if args.selection_label: # if args.selection_label:
# list_name = args.selection_label # list_name = args.selection_label
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment