Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with new databases #25

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions q2_micom/_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import biom
import os
import micom.workflows as mw
from micom.taxonomy import build_from_qiime
from micom.taxonomy import build_from_qiime, rank_prefixes
import pandas as pd
from q2_micom._formats_and_types import (
JSONDirectory,
Expand Down Expand Up @@ -39,7 +39,10 @@ def build_spec(
else:
ranks = [rank]

tax = build_from_qiime(abundance, taxonomy, collapse_on=ranks)
no_rank_prefixes = rank_prefixes(model_files).isna().all()
tax = build_from_qiime(
abundance, taxonomy, collapse_on=ranks, trim_rank_prefix=no_rank_prefixes
)
micom_taxonomy = pd.merge(model_files, tax, on=ranks)
micom_taxonomy = micom_taxonomy[micom_taxonomy.relative > cutoff]
del micom_taxonomy["file"]
Expand Down
28 changes: 14 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ long_description = file: README.md
long_description_content_type = text/markdown
license = Apache License 2.0
url = https://github.com/micom-dev/q2-micom
classifiers =
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Science/Research
Topic :: Scientific/Engineering :: Bio-Informatics
License :: OSI Approved :: Apache Software License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
keywords =
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
keywords =
microbiome
modeling
metabolism
Expand All @@ -32,25 +32,25 @@ keywords =
zip_safe = False
packages = find:
python_requires = >=3.6
install_requires =
install_requires =
cobra>=0.18.1
micom>=0.24.0
micom>=0.33.0
jinja2>=2.10.3
qiime2>=2021.2
rich>=6.0
pandas>=1.0
tests_require =
tests_require =
coverage
pytest
pytest-cov
flake8

[options.package_data]
q2_micom =
q2_micom =
citations.bib

[options.entry_points]
qiime2.plugins =
qiime2.plugins =
q2-micom = q2_micom.plugin_setup:plugin

[bumpversion:file:setup.py]
Expand All @@ -62,7 +62,7 @@ search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[tool:pytest]
filterwarnings =
filterwarnings =
ignore::DeprecationWarning
ignore::FutureWarning

Expand All @@ -75,15 +75,15 @@ branch = True
omit = q2_micom/tests/*

[coverage:report]
exclude_lines =
exclude_lines =
pragma: no cover

def __repr__
if self\.debug

raise AssertionError
raise NotImplementedError

if 0:
if __name__ == .__main__.:
ignore_errors = True
Expand Down
Loading