Metadata-Version: 2.4
Name: epitest
Version: 0.1
Summary: Tests for detecting such epidemic aspects as contact-tracing, incubation and superspreading in transmission trees.
Home-page: https://github.com/modpath/epitest
Author: Anna Zhukova
Author-email: anna.zhukova@pasteur.fr
Keywords: phylogenetics,birth-death model,incubation,contact tracing,superspreading,non-parametric test
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: six
Requires-Dist: ete3
Requires-Dist: numpy==2.0.2
Requires-Dist: scipy==1.14.1
Requires-Dist: biopython
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# epitest

Quick non-parametric tests for detecting if such aspects as contact tracing, incubation, superspreading 
or transmission/detection rate changes over time are present in an epidemic represented 
by a time-scaled phylogenetic trees. 


[![GitHub release](https://img.shields.io/github/v/release/modpath/epitest.svg)](https://github.com/modpath/epitest/releases)
[![PyPI version](https://badge.fury.io/py/epitest.svg)](https://pypi.org/project/epitest/)
[![PyPI downloads](https://shields.io/pypi/dm/epitest)](https://pypi.org/project/epitest/)
[![Docker pulls](https://img.shields.io/docker/pulls/modpath/epitest)](https://hub.docker.com/r/modpath/epitest/tags)


## Input data
One needs to supply a time-scaled phylogenetic tree in newick format, or a collection of trees (one per line in the newick file), 
which will be treated as all belonging to the same epidemic. 

## Installation

There are 4 alternative ways to run __epitest__ on your computer: 
with [docker](https://www.docker.com/community-edition), 
[apptainer](https://apptainer.org/),
in Python3, or via command line (requires installation with Python3).



### Run in python3 or command-line (for linux systems, recommended Ubuntu 21 or newer versions)

You could either install python (version 3.10 or higher) system-wide and then install epitest via pip:
```bash
sudo apt install -y python3 python3-pip python3-setuptools python3-distutils
pip3 install epitest
```

or alternatively, you could install python (version 3.10 or higher) and epitest via [conda](https://conda.io/docs/) (make sure that conda is installed first). 
Here we will create a conda environment called _epitestenv_:
```bash
conda create --name epitestenv python=3.10
conda activate epitestenv
pip install epitest
```


#### Basic usage in a command line
If you installed __epitest__ in a conda environment (here named _epitestenv_), do not forget to first activate it, e.g.

```bash
conda activate epitestenv
```

Run the following commands to check for the presence of contact tracing, superspreading, incubation, 
and changes in transmission and detection patterns over time in a given tree.
Here we will use an early SARS-CoV-2 tree [real_data/covid.resolved.nwk](real_data/covid.resolved.nwk) as an example.
The command will produce a tab-separated file covid.resolved.epitest.tsv, containing the results of the tests 
(can be viewed with a text editor, Excel or Libre Office Calc). The results are presented as p-values, 
where the values lower than a certain threshold (e.g., 0.05) 
suggest the presence of the epidemic aspect in question (e.g., incubation).
```bash
epitest --nwk covid.resolved.nwk --log covid.resolved.epitest.tsv
```

#### Help

To see detailed options, run:
```bash
epitest --help
```


### Run with docker

#### Basic usage
Once [docker](https://www.docker.com/community-edition) is installed, 
run the following command to to check for the presence of contact tracing, superspreading, incubation, 
and changes in transmission and detection patterns over time in a given tree:
```bash
docker run -v <path_to_the_folder_containing_the_tree>:/data:rw -t modpath/epitest --nwk /data/<tree_file>.nwk --log /data/<test_results>.tsv
```
This will produce a tab-separated file in the <path_to_the_folder_containing_the_tree> folder,
 containing the test results (can be viewed with a text editor, Excel or Libre Office Calc).

#### Help

To see advanced options, run
```bash
docker run -t modpath/epitest -h
```



### Run with apptainer

#### Basic usage
Once [apptainer](https://apptainer.org/docs/user/latest/quick_start.html#installation) is installed, 
run the following command to to check for the presence of contact tracing, superspreading, incubation, 
and changes in transmission and detection patterns over time in a given tree:
```bash
apptainer run docker://modpath/epitest --nwk <tree_file>.nwk --log <test_results>.tsv
```

This will produce a tab-separated file,
 containing the test results (can be viewed with a text editor, Excel or Libre Office Calc).

#### Help

To see advanced options, run
```bash
apptainer run docker://modpath/epitest -h
```


