In [1]:
%run GLOBALS.py


3.5.1 |Continuum Analytics, Inc.| (default, Dec  7 2015, 11:24:55) 
[GCC 4.2.1 (Apple Inc. build 5577)]

In [2]:
import matplotlib as mpl
mpl.use('TkAgg')
import matplotlib.pyplot as plt
%matplotlib inline

import pandas as pd
import seaborn as sns

In [3]:
mpl.rcParams.update({
    'font.size': 12, 'axes.titlesize': 14, 'axes.labelsize': 12,
    'xtick.labelsize': 10, 'ytick.labelsize': 13,
    'font.family': 'Lato', 'font.weight': 600,
    'axes.labelweight': 600, 'axes.titleweight': 600,
    #'figure.autolayout': True
    })

In [4]:
import abundance_plot_utils

In [5]:
data_reduced = pd.read_csv(MAIN_DIR + "/results/reduced_data--all_taxonomy_remains.csv")

In [6]:
ax = abundance_plot_utils.heatmap_from_taxa_dict(
    dataframe = data_reduced,
    taxa_dict = {'Family':['Bacteriovoracaceae','Myxococcaceae']},
    size_spec = 2,
    annotate=False,
    aspect_spec = 2,
    main_dir=MAIN_DIR
    )
ax.set_yticklabels(rotation=0)
#plt.yticks(rotation=45)


Index(['Kingdom', 'Phylum', 'Class', 'Order', 'Family', 'Genus', 'Length',
       'fraction of reads', 'project', 'ID', 'oxy', 'rep', 'week'],
      dtype='object')
Index(['Kingdom', 'Phylum', 'Class', 'Order', 'Family', 'Genus', 'Length',
       'fraction of reads', 'project', 'ID', 'oxy', 'rep', 'week'],
      dtype='object')
plot_data.head()
          ID  abundance sum taxonomic level      taxonomic name   oxy  rep  \
0  100_LOW12       0.000001          Family  Bacteriovoracaceae   Low    4   
1  100_LOW12       0.001753          Family       Myxococcaceae   Low    4   
2  103_HOW12       0.014467          Family  Bacteriovoracaceae  High    1   
3  103_HOW12       0.000010          Family       Myxococcaceae  High    1   
4  104_HOW12       0.016953          Family  Bacteriovoracaceae  High    2   

   week  project  
0    12  1056214  
1    12  1056214  
2    12  1056217  
3    12  1056217  
4    12  1056220  
/Users/janet/miniconda3/envs/elviz/lib/python3.5/site-packages/matplotlib/font_manager.py:1288: UserWarning: findfont: Font family ['Lato'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/Users/janet/miniconda3/envs/elviz/lib/python3.5/site-packages/matplotlib/figure.py:1744: UserWarning: This figure includes Axes that are not compatible with tight_layout, so its results might be incorrect.
  warnings.warn("This figure includes Axes that are not "
Family
plot directory: ./plots/mixed_taxonomy/
./plots/mixed_taxonomy/Family-Bacteriovoracaceae_Myxococcaceae--rep.pdf
Out[6]:
<seaborn.axisgrid.FacetGrid at 0x104864a58>

In [7]:
ax = abundance_plot_utils.heatmap_from_taxa_dict(
    dataframe = data_reduced,
    taxa_dict = {'Family':['Bacteriovoracaceae','Myxococcaceae']},
    size_spec = 2,
    annotate=True,
    aspect_spec = 7,
    main_dir=MAIN_DIR
    )
ax.set_yticklabels(rotation=0)
#plt.yticks(rotation=45)


Index(['Kingdom', 'Phylum', 'Class', 'Order', 'Family', 'Genus', 'Length',
       'fraction of reads', 'project', 'ID', 'oxy', 'rep', 'week'],
      dtype='object')
Index(['Kingdom', 'Phylum', 'Class', 'Order', 'Family', 'Genus', 'Length',
       'fraction of reads', 'project', 'ID', 'oxy', 'rep', 'week'],
      dtype='object')
plot_data.head()
          ID  abundance sum taxonomic level      taxonomic name   oxy  rep  \
0  100_LOW12       0.000001          Family  Bacteriovoracaceae   Low    4   
1  100_LOW12       0.001753          Family       Myxococcaceae   Low    4   
2  103_HOW12       0.014467          Family  Bacteriovoracaceae  High    1   
3  103_HOW12       0.000010          Family       Myxococcaceae  High    1   
4  104_HOW12       0.016953          Family  Bacteriovoracaceae  High    2   

   week  project  
0    12  1056214  
1    12  1056214  
2    12  1056217  
3    12  1056217  
4    12  1056220  
/Users/janet/miniconda3/envs/elviz/lib/python3.5/site-packages/matplotlib/figure.py:1744: UserWarning: This figure includes Axes that are not compatible with tight_layout, so its results might be incorrect.
  warnings.warn("This figure includes Axes that are not "
/Users/janet/miniconda3/envs/elviz/lib/python3.5/site-packages/matplotlib/font_manager.py:1288: UserWarning: findfont: Font family ['Lato'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
Family
plot directory: ./plots/mixed_taxonomy/
./plots/mixed_taxonomy/Family-Bacteriovoracaceae_Myxococcaceae--rep--annotated.pdf
Out[7]:
<seaborn.axisgrid.FacetGrid at 0x109eea2b0>

In [8]:
ax.fig.figure

In [9]:
ax.set_ylabels(rotation=45)


Out[9]:
<seaborn.axisgrid.FacetGrid at 0x109eea2b0>

In [ ]:


In [ ]: