def test_observed_otus(self):
t = biom.Table(np.array([[150, 100, 100], [50, 100, 100]]),
['O1', 'O2'],
['S1', 'S2', 'S3'])
obs = _compute_rarefaction_data(feature_table=t,
min_depth=1,
max_depth=200,
steps=2,
iterations=1,
phylogeny=None,
metrics=['observed_otus'])
exp_ind = pd.MultiIndex.from_product(
[[1, 200], [1]],
names=['depth', 'iter'])
exp = pd.DataFrame(data=[[1, 2], [1, 2], [1, 2]],
columns=exp_ind,
index=['S1', 'S2', 'S3'])
pdt.assert_frame_equal(obs['observed_otus'], exp)
评论列表
文章目录