Example #1
0
def test_db(tmp_path):
    manifest = load_qiime_manifest(db)
    tax = md.test_taxonomy()
    manifest.file = tax.file[0]
    built = build_database(manifest, str(tmp_path), rank="species")
    assert built.shape[0] == 3
    for fi in built.file:
        assert (tmp_path / fi).exists()
    built = build_database(manifest, str(tmp_path / "db.zip"))
    assert (tmp_path / "db.zip").exists()
Example #2
0
def test_qiime_model():
    manifest = qf.load_qiime_manifest(models)
    assert "sample_id" in manifest.columns
    for i in manifest.sample_id:
        com = qf.load_qiime_model(models, i)
        assert len(com.abundances) == 3
        assert com.optimize().growth_rate == approx(0.874, 0.001)
    with raises(ValueError):
        qf.load_qiime_model(models, "blub")
    with raises(ValueError):
        qf.load_qiime_model(db, "blub")
Example #3
0
def test_bad_manifest():
    with raises(ValueError):
        manifest = qf.load_qiime_manifest(medium)
Example #4
0
def test_good_manifest(arti):
    manifest = qf.load_qiime_manifest(arti)
    assert "file" in manifest.columns