#!/usr/bin/env python # coding: utf-8 # # Visualizing an interactive ordination # In[ ]: import pandas as pd, numpy as np from emperor import Emperor, nbinstall from skbio import OrdinationResults nbinstall() def load_mf(fn, index='#SampleID'): _df = pd.read_csv(fn, sep='\t', dtype=str, keep_default_na=False, na_values=[]) _df.set_index(index, inplace=True) return _df # We are going to load data from [Fierer et al. 2010](http://www.pnas.org/content/107/14/6477.full) (the data was retrieved from study [232](https://qiita.ucsd.edu/study/description/232) in [Qiita](https://qiita.ucsd.edu), remember you need to be logged in to access the study). # # Specifically, here we will reproduce *Figure 1 A*. # In[ ]: mf = load_mf('keyboard/mapping-file.txt') res = OrdinationResults.read('keyboard/unweighted-unifrac.even1000.txt') # If you want to share your notebook via GitHub use `remote=True` and make sure you share your notebook using nbviewer. # In[ ]: viz = Emperor(res, mf, remote=False) # In[ ]: viz