In [7]:
from biom import load_table
from skbio import TreeNode
from io import StringIO
import numpy as np
from skbio.diversity.alpha._base import alpha_diversity, observed_otus, faith_pd
In [13]:
t = load_table('/Users/caporaso/code/q2d2/example-data/keyboard/q191/otu-table.tsv')
d = t.matrix_data.toarray().astype('int').T
tree = TreeNode.read('/Users/caporaso/code/q2d2/example-data/keyboard/q191/rep-set.tre')
In [14]:
%%timeit
alpha_diversity('faith_pd', d, ids=t.ids('sample'), otu_ids=t.ids('observation'), tree=tree)
In [15]:
%%timeit
alpha_diversity(faith_pd, d, ids=t.ids('sample'), otu_ids=t.ids('observation'), tree=tree)
In [16]:
840./9.44
Out[16]:
In [ ]: