In [53]:
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import datetime
#%matplotlib inline
output_folder = '/drone/src/output/'
abundances = pd.read_csv(output_folder + 'abundance.tsv', delimiter='\t')
In [58]:
# Figure 1
datetime_str = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
generated_text = 'Figures generated at: ' + datetime_str
g = sns.distplot(abundances['eff_length'], kde=False, color="b")
g.figure.suptitle(generated_text, fontsize=18, fontweight='bold')
g.figure.savefig(output_folder + 'fig1.png', bbox_inches='tight')
In [50]:
# Figure 2
sns.set(style="darkgrid", color_codes=True)
g = sns.jointplot("length", "est_counts", data=abundances, kind="reg",
xlim=(800, 2400), ylim=(0, 1000), color="r", size=7)
g.savefig(output_folder + 'fig2.png', bbox_inches='tight')
In [40]:
# Figure 3
f, ax = plt.subplots(figsize=(8, 10))
sns.set_color_codes("pastel")
sns.barplot(x="length", y="target_id", data=abundances,
label="Length", color="b")
# Plot the crashes where alcohol was involved
sns.set_color_codes("muted")
sns.barplot(x="eff_length", y="target_id", data=abundances,
label="Effective Length", color="b")
ax.legend(ncol=2, loc="lower right", frameon=True)
ax.set(ylabel="",
xlabel="Length and Effective Length")
sns.despine(left=True, bottom=True)
f.savefig(output_folder + 'fig3.png', bbox_inches='tight')
In [39]:
# Figure 4
f, ax = plt.subplots(figsize=(8, 10))
sns.set_color_codes("pastel")
sns.barplot(x="tpm", y="target_id", data=abundances,
label="TPM", color="b")
# Plot the crashes where alcohol was involved
sns.set_color_codes("muted")
sns.barplot(x="est_counts", y="target_id", data=abundances,
label="Estimated Counts", color="b")
ax.legend(ncol=2, loc="lower right", frameon=True)
ax.set(ylabel="",
xlabel="Counts and Transcripts Per Million")
sns.despine(left=True, bottom=True)
f.savefig(output_folder + 'fig4.png', bbox_inches='tight')