In [1]:
from msdas import *
%pylab inline
matplotlib.rcParams['savefig.dpi'] = 2 * matplotlib.rcParams['savefig.dpi']


Couldn't import dot_parser, loading of dot files will not be possible.
Populating the interactive namespace from numpy and matplotlib

In [2]:
r = readers.MassSpecReader(get_yeast_small_data())


INFO:root:Reading /home/cokelaer/Work/github/msdas/share/data/YEAST_small_all.csv
INFO:root:Renaming psites with ^ character
INFO:root:Replacing zeros with NAs
INFO:root:-- Removing 0 rows with ambigous protein names:
INFO:root:--------------------------------------------------
WARNING:root:Rebuilding identifier in the dataframe. MERGED prefixes will be lost

In [3]:
c = clustering.MSClustering(r)


INFO:root:Filling Nas with zeros if any

In [4]:
c.plot_vectors("HOG1")


rescaling over 2 columns

In [5]:
c.run_affinity_propagation_clustering()


rescaling over 57 columns
Running affinity propagation using preference=-30
Found 17 clusters
/home/cokelaer/Work/virtualenv/lib64/python2.7/site-packages/pandas/core/indexing.py:118: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  self._setitem_with_indexer(indexer, value)
Out[5]:
<msdas.clustering.Affinity at 0x5dfd6d0>

In [6]:
try:del c.df['cluster']
except:pass
c.plot_vectors("DIG1", legend=False, scale=False)
ax = gca()
patches, labels = ax.get_legend_handles_labels()
ax.legend(patches,labels, fontsize=5, loc="best")


Out[6]:
<matplotlib.legend.Legend at 0x6547850>

In [ ]: