INNER CODE UNIT · Python
diversity
antigenomics/vdjtools · python/vdjtools/cli/__init__.py:455
def diversity(
samples: Optional[list[Path]] = _SAMPLES, metadata: Optional[Path] = _META,
base_dir: Optional[Path] = _BASE, sample_col: str = _SCOL, file_template: str = _TMPL,
fmt: str = _FMT, threads: int = _THREADS, cohort: Optional[Path] = _COHORT,
on_duplicate: str = _ONDUP, out: Optional[Path] = _OUT,
) -> None:
"""Per-sample diversity (observed richness, Chao, Efron-Thisted, Shannon, Simpson, d50)."""
import functools
from vdjtools.io.batch import map_samples
from vdjtools.stats.diversity import diversity_cohort, diversity_stats
if cohort is not None:
from vdjtools.io.cohort import scan_cohort
_write(diversity_cohort(scan_cohort(cohort, join_metadata=False),
on_duplicate=on_duplicate), out)
return
items = _sample_items(samples, metadata, base_dir, sample_col, file_template)