Metadata-Version: 2.4
Name: metacooc
Version: 0.1.1
Summary: Tool for co-occurrence analysis of microorganisms in metagenomes
Author-email: Benjamin Coltman <benjamin.coltman@univie.ac.at>, Daan Speth <daan.speth@univie.ac.at>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/bcoltman/metacooc
Project-URL: Documentation, https://metacooc.readthedocs.io
Project-URL: Source, https://github.com/bcoltman/metacooc
Project-URL: Tracker, https://github.com/bcoltman/metacooc/issues
Keywords: metagenomics,co-occurrence,bioinformatics
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: adjustText
Requires-Dist: requests
Requires-Dist: pyarrow
Requires-Dist: platformdirs
Requires-Dist: tqdm
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Provides-Extra: docs
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-argparse; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Dynamic: license-file

# MetaCoOc

MetaCoOc is a Python package for co-occurrence, association, and community-structure analysis of microorganisms in shotgun metagenomes.

It can:

- define cohorts from taxa, metadata terms, or biome labels;
- compare a cohort with an explicit null/background population;
- calculate directed taxon–taxon co-occurrence and taxon–cohort association;
- quantify C-score, mean Jaccard, and NODF structure; and
- write compact summary tables alongside detailed results and plots.

## Install

MetaCoOc requires Python 3.10 or newer:

```bash
python -m pip install metacooc
```

## Quick start

Download a pinned published Ingredients release and run a first biome association:

```bash
metacooc download --data_release R226_globdb_rev1
metacooc association \
  --data_release R226_globdb_rev1 \
  --search_mode biome \
  --search_string soil \
  --output_dir results/soil-association
```

Start with `global_association_summary.tsv`, then use the detailed TSV and plot when you need the full result. Metadata searches require the optional metadata download; the command-line guide explains the difference between cohort and null/background selection.

## Documentation

Read the full guide at [metacooc.readthedocs.io](https://metacooc.readthedocs.io), including:

- [installation and quick setup](https://metacooc.readthedocs.io/en/latest/quickstart.html);
- the [recommended FE-first workflow](https://metacooc.readthedocs.io/en/latest/workflow.html);
- advanced guidance on releases, search grammar, null models, outputs, and plotting; and
- worked examples for association, co-occurrence, structure, biome distribution, and custom data.

The generated [CLI reference](https://metacooc.readthedocs.io/en/latest/cli.html) lists the current options and defaults.

## Development

```bash
uv sync --extra dev
uv run pytest -q
```

Build the documentation with `uv sync --extra docs` followed by the command in `docs/local_build.md`.

## License

MetaCoOc is released under the GNU General Public License v3.0 or later.
