Commit 06c17d33 authored by Blaise Li's avatar Blaise Li
Browse files

Code cleaning and documenting.

parent ed111f22
......@@ -264,32 +264,32 @@ def plot_norm_correlations(correlations):
#correlations.plot.kde(ax=ax1)
#sns.violinplot(data=correlations, orient="h", ax=ax2)
#ax2.set_xlabel("Pearson correlation coefficient")
ax = sns.violinplot(data=correlations, cut=0)
ax.set_ylabel("Pearson correlation coefficient")
axis = sns.violinplot(data=correlations, cut=0)
axis.set_ylabel("Pearson correlation coefficient")
def plot_counts_distribution(data, xlabel):
# TODO: try to plot with semilog x axis
#ax = data.plot.kde(legend=None)
#ax.set_xlabel(xlabel)
#ax.legend(ncol=len(REPS))
#axis = data.plot.kde(legend=None)
#axis.set_xlabel(xlabel)
#axis.legend(ncol=len(REPS))
try:
ax = data.plot.kde()
axis = data.plot.kde()
except ValueError as e:
msg = "".join([
"There seems to be a problem with the data.\n",
"The data matrix has %d lines and %d columns.\n" % (len(data), len(data.columns))])
warnings.warn(msg)
raise
ax.set_xlabel(xlabel)
axis.set_xlabel(xlabel)
def plot_boxplots(data, ylabel):
fig = plt.figure(figsize=(6, 12))
ax = fig.add_subplot(111)
data.plot.box(ax=ax)
ax.set_ylabel(ylabel)
for label in ax.get_xticklabels():
axis = fig.add_subplot(111)
data.plot.box(ax=axis)
axis.set_ylabel(ylabel)
for label in axis.get_xticklabels():
label.set_rotation(90)
plt.tight_layout()
......@@ -352,9 +352,9 @@ def plot_lfc_distribution(res, contrast, fold_type=None):
fold_type = "log2FoldChange"
lfc = getattr(res, fold_type).dropna()
lfc.name = contrast
ax = sns.kdeplot(lfc)
ax.set_xlabel(fold_type)
ax.set_ylabel("frequency")
axis = sns.kdeplot(lfc)
axis.set_xlabel(fold_type)
axis.set_ylabel("frequency")
def make_status2colour(down_statuses, up_statuses):
......
Supports Markdown
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