Calour heatmap options

General setup


In [1]:
%matplotlib notebook
import calour as ca
import matplotlib as mpl


/Users/amnon/miniconda3/envs/calour/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters

Load the data


In [2]:
a = ca.read_amplicon('data/artificial-simple.biom', 
                     'data/artificial-simple.map.txt',
                     feature_metadata_file='data/artificial-simple.feature_md.txt',
                     min_reads=100, normalize=1000)

Simple plot (default parameters)


In [3]:
b = a.plot(sample_field='group',
           gui='jupyter')


Adding barx and bary labels

Also add plot title, change colormap


In [4]:
b = a.plot(sample_field='group',
           bary_fields=['oxygen'], 
           barx_fields=['group', 'categorical'],
           barx_label_kwargs=[{'color': 'b'}, {'color': 'white', 'size': 9}],
           cmap='inferno',
           gui='jupyter',
           title='simple figure');


Add y-axis ticks


In [5]:
b = a.plot(sample_field='group', feature_field='taxonomy',
           yticklabel_kwargs={'size': 9},
           bary_fields=['oxygen'], 
           barx_fields=['group', 'categorical'],
           barx_label_kwargs=[{'color': 'b'}, {'color': 'white', 'size': 9}],
           cmap='viridis',
           gui='jupyter',
           title='simple figure');


No log scale of heatmap colors


In [6]:
b = a.plot(sample_field='group', feature_field='taxonomy', yticklabel_kwargs={'size': 9},
           bary_fields=['oxygen'], barx_fields=['group', 'categorical'],
           barx_label_kwargs=[{'color': 'b'}, {'color': 'white', 'size': 9}],
           cmap='viridis', norm=mpl.colors.Normalize(),
           gui='jupyter', title='simple figure');



In [ ]: