In [1]:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
In [2]:
sns.set(style='ticks', context='paper', font_scale=1.5)
In [3]:
df = pd.read_excel('/Users/luke.thompson/singlecell/clusters/rsonly_stats.xlsx')
df
Out[3]:
In [4]:
df2 = pd.DataFrame(df.iloc[-2:].stack())
df2.reset_index(inplace=True)
df2.columns = ['Set of OGs', 'clusters', 'count']
df2
Out[4]:
In [9]:
sns.barplot(data=df2, x='clusters', y='count', hue='Set of OGs',
palette=[sns.xkcd_rgb['light pink'], sns.xkcd_rgb['red']])
plt.ylabel('Count')
plt.xlabel('')
plt.xticks([-0.5, 0.5, 1.5, 2.5],
['SAR11 clusters v1\n(%s Red Sea SAGs,\n%s other genomes)' % (df.sar3['RS SAGs'], df.sar3['Trad genomes']+df.sar3['Non-RS SAGs']),
'SAR11 clusters v2\n(%s Red Sea SAGs,\n%s other genomes)' % (df.sar4['RS SAGs'], df.sar4['Trad genomes']+df.sar4['Non-RS SAGs']),
'Proch. clusters v1\n(%s Red Sea SAGs,\n%s other genomes)' % (df.pro3['RS SAGs'], df.pro3['Trad genomes']+df.pro3['Non-RS SAGs']),
'Proch. clusters v2\n(%s Red Sea SAGs,\n%s other genomes)' % (df.pro4['RS SAGs'], df.pro4['Trad genomes']+df.pro4['Non-RS SAGs'])],
rotation=30)
plt.tight_layout()
plt.savefig('/Users/luke.thompson/singlecell/plots/rsonly_counts.pdf')
In [ ]:
In [ ]: