Metadata-Version: 2.1
Name: itaxotools-fitchi
Version: 1.3.0
Summary: Haplotype genealogies based on Fitch distances
Author-email: Michael Matschiner <michael.matschiner@nhm.uio.no>, Stefanos Patmanidis <stefanpatman91@gmail.com>
Project-URL: Homepage, https://itaxotools.org/
Project-URL: Source, https://github.com/iTaxoTools/Fitchi
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: <4,>=3.10.2
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: scipy
Provides-Extra: all
Requires-Dist: pygraphviz ; extra == 'all'
Requires-Dist: biopython ; extra == 'all'
Provides-Extra: dev
Requires-Dist: setuptools-scm ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'

# Fitchi

[![PyPI - Version](https://img.shields.io/pypi/v/itaxotools-fitchi?color=tomato)](
    https://pypi.org/project/itaxotools-fitchi)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/itaxotools-fitchi)](
    https://pypi.org/project/itaxotools-fitchi)
[![GitHub - Tests](https://img.shields.io/github/actions/workflow/status/iTaxoTools/Fitchi/test.yml?label=tests)](
    https://github.com/iTaxoTools/Fitchi/actions/workflows/test.yml)

Haplotype genealogies based on Fitch distances.

This is a Python package for [Fitchi](https://github.com/mmatschiner/Fitchi). For more information on the original, see [here](https://evoinformatics.group/fitchi.html).

[![Genealogy](https://raw.githubusercontent.com/iTaxoTools/Fitchi/main/images/genealogy.png)](
    https://itaxotools.github.io/Fitchi/examples/example.html)

[*Click for a comprehensive output example*](
    https://itaxotools.github.io/Fitchi/examples/example.html)

## Installation

Fitchi is available on PyPI. You can install it through `pip`:

```
pip install itaxotools-fitchi
```

## Usage

The original command-line tool is included as part of the installation. It produces HTML files from Nexus files, as demonstrated with the [example input and output files](https://github.com/iTaxoTools/Fitchi/tree/main/examples). For information about the available options, you may refer to the [original documentation](https://evoinformatics.group/fitchi.html).

Note that you will need *all* dependencies in order to run Fitchi this way:

```
fitchi examples/example.nex examples/example.html -m 3 -p pop1 pop2
start examples/example.html  # browse results on Windows
```

You may also invoke Fitchi from Python using `compute_fitchi_tree()`. This returns a tree in the form of `HaploNode` objects, which can be used for downstream analysis or visualization. Only scipy is required in this case.

See the [scripts](https://github.com/iTaxoTools/Fitchi/tree/main/scripts) folder for some usage examples.

## Dependencies

Fitchi requires [scipy](https://pypi.org/project/scipy/).
Extra statistics require [biopython](https://pypi.org/project/biopython/).
Visualization requires [pygraphviz](https://pypi.org/project/pygraphviz/).

To install pygraphviz, please follow [these](https://pygraphviz.github.io/documentation/stable/install.html) instructions from the pygraphviz documentation.
For example, to install pygraphviz on Windows, first install [Graphviz](https://graphviz.org/download/) to the default location, then execute the following command in PowerShell:
```
pip install pygraphviz --config-setting build_ext^="^--include-dir=C:\Program Files\Graphviz\include" --config-setting build_ext^="^--library-dir=C:\Program Files\Graphviz\lib"
```

## Citation

*Matschiner M (2015) Fitchi: Haplotype genealogy graphs based on the Fitch algorithm. Bioinformatics, 32:1250-252.*
