Skip to content

MAINT: rename piqtree2 to piqtree #135

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

Merged
merged 1 commit into from
Dec 13, 2024
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
2 changes: 1 addition & 1 deletion .github/actions/build-iqtree/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
id: cache
with:
key: libiqtree-${{ inputs.os }}-${{ steps.iqtree2-sha.outputs.iqtree2-sha }}
path: src/piqtree2/_libiqtree/libiqtree2.a
path: src/piqtree/_libiqtree/libiqtree2.a
lookup-only: true

- name: Build IQ-TREE
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-piqtree/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ runs:
- uses: actions/cache/restore@v4
with:
key: ${{ inputs.cache-key }}
path: src/piqtree2/_libiqtree/libiqtree2.a
path: src/piqtree/_libiqtree/libiqtree2.a
fail-on-cache-miss: true
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*.mldist
*.treefile

# piqtree2 specific ignores
src/piqtree2/_libiqtree/**/*.a
# piqtree specific ignores
src/piqtree/_libiqtree/**/*.a

# docs
data
Expand Down
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# piqtree2
# piqtree

[![PyPI Version](https://img.shields.io/pypi/v/piqtree2)](https://pypi.org/project/piqtree2/)
[![Python Version](https://img.shields.io/pypi/pyversions/piqtree2)](https://pypi.org/project/piqtree2/)
[![License](https://img.shields.io/github/license/iqtree/piqtree2)](https://github.com/iqtree/piqtree2/blob/main/LICENSE)
[![PyPI Version](https://img.shields.io/pypi/v/piqtree)](https://pypi.org/project/piqtree/)
[![Python Version](https://img.shields.io/pypi/pyversions/piqtree)](https://pypi.org/project/piqtree/)
[![License](https://img.shields.io/github/license/iqtree/piqtree)](https://github.com/iqtree/piqtree/blob/main/LICENSE)

[![CI](https://github.com/iqtree/piqtree2/workflows/CI/badge.svg)](https://github.com/iqtree/piqtree2/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/iqtree/piqtree2/badge.svg?branch=main)](https://coveralls.io/github/iqtree/piqtree2?branch=main)
[![Documentation Status](https://readthedocs.org/projects/piqtree2/badge/?version=latest)](https://piqtree2.readthedocs.io/en/latest/?badge=latest)
[![CI](https://github.com/iqtree/piqtree/workflows/CI/badge.svg)](https://github.com/iqtree/piqtree/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/iqtree/piqtree/badge.svg?branch=main)](https://coveralls.io/github/iqtree/piqtree?branch=main)
[![Documentation Status](https://readthedocs.org/projects/piqtree/badge/?version=latest)](https://piqtree.readthedocs.io/en/latest/?badge=latest)

`piqtree2` is a library which allows you use IQ-TREE directly from Python! The interface with python is through [cogent3](https://cogent3.org) objects.
For usage, please refer to the [documentation](https://piqtree2.readthedocs.io/) or the examples below.
`piqtree` is a library which allows you use IQ-TREE directly from Python! The interface with python is through [cogent3](https://cogent3.org) objects.
For usage, please refer to the [documentation](https://piqtree.readthedocs.io/) or the examples below.

If you encounter any problems or have any feature requests feel free to raise an [issue](https://github.com/iqtree/piqtree2/issues)!
If you encounter any problems or have any feature requests feel free to raise an [issue](https://github.com/iqtree/piqtree/issues)!

## Examples

### Phylogenetic Reconstruction

```python
from piqtree2 import build_tree
from piqtree2.model import Model
from cogent3 import load_aligned_seqs # Included with piqtree2!
from piqtree import build_tree
from piqtree.model import Model
from cogent3 import load_aligned_seqs # Included with piqtree!

# Load Sequences
aln = load_aligned_seqs("tests/data/example.fasta", moltype="dna")
Expand All @@ -40,9 +40,9 @@ print("Log-likelihood:", tree.params["lnL"])
### Fit Branch Lengths to Tree Topology

```python
from piqtree2 import fit_tree
from piqtree2.model import Model
from cogent3 import load_aligned_seqs, make_tree # Included with piqtree2!
from piqtree import fit_tree
from piqtree.model import Model
from cogent3 import load_aligned_seqs, make_tree # Included with piqtree!

# Load Sequences
aln = load_aligned_seqs("tests/data/example.fasta", moltype="dna")
Expand All @@ -61,7 +61,7 @@ print("Log-likelihood:", tree.params["lnL"])
### Create a Collection of Random Trees

```python
from piqtree2 import TreeGenMode, random_trees
from piqtree import TreeGenMode, random_trees

num_trees = 3
num_taxa = 5
Expand All @@ -78,8 +78,8 @@ print(trees) # A tuple of 3 trees with 5 taxa each.
### Pairwise Robinson-Foulds Distance between Trees

```python
from piqtree2 import robinson_foulds
from cogent3 import make_tree # Included with piqtree2!
from piqtree import robinson_foulds
from cogent3 import make_tree # Included with piqtree!

# Construct trees
tree1 = make_tree("(a,b,(c,(d,e)));")
Expand Down
2 changes: 1 addition & 1 deletion build_tools/build_iqtree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ else
fi

cd ../..
mv iqtree2/build/libiqtree2.a src/piqtree2/_libiqtree/
mv iqtree2/build/libiqtree2.a src/piqtree/_libiqtree/
2 changes: 1 addition & 1 deletion docs/api/genetic_distance/jc_distances.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# jc_distances

::: piqtree2.jc_distances
::: piqtree.jc_distances

## Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/api/model/FreqType.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FreqType

::: piqtree2.model.FreqType
::: piqtree.model.FreqType
options:
show_if_no_docstring: true

Expand Down
2 changes: 1 addition & 1 deletion docs/api/model/Model.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Model

::: piqtree2.Model
::: piqtree.Model

## Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/api/model/RateModel.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# RateModel

::: piqtree2.model.DiscreteGammaModel
::: piqtree.model.DiscreteGammaModel

::: piqtree2.model.FreeRateModel
::: piqtree.model.FreeRateModel

## Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/api/model/SubstitutionModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Enums for available DNA and amino acid models. Strings may be used instead of the enums.

::: piqtree2.model.DnaModel
::: piqtree.model.DnaModel
options:
show_if_no_docstring: true

::: piqtree2.model.AaModel
::: piqtree.model.AaModel
options:
show_if_no_docstring: true

Expand Down
2 changes: 1 addition & 1 deletion docs/api/model/model_finder.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# model_finder

::: piqtree2.model_finder
::: piqtree.model_finder
2 changes: 1 addition & 1 deletion docs/api/tree/build_tree.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# build_tree

::: piqtree2.build_tree
::: piqtree.build_tree

## Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/api/tree/fit_tree.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# fit_tree

::: piqtree2.fit_tree
::: piqtree.fit_tree

## Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/api/tree/nj_tree.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nj_tree

::: piqtree2.nj_tree
::: piqtree.nj_tree

## Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/api/tree/random_trees.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# random_trees

::: piqtree2.random_trees
::: piqtree.random_trees

::: piqtree2.TreeGenMode
::: piqtree.TreeGenMode
options:
show_if_no_docstring: true

Expand Down
2 changes: 1 addition & 1 deletion docs/api/tree_distance/robinson_foulds.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# robinson_foulds

::: piqtree2.robinson_foulds
::: piqtree.robinson_foulds

## Usage

Expand Down
6 changes: 3 additions & 3 deletions docs/apps/app_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# %% [markdown]
# ## Building workflows using `piqtree2` apps
# ## Building workflows using `piqtree` apps
# > **WARNING**
# > This page is under construction!
#
# We can combine `piqtree2` apps with other cogent3 apps to develop a pipeline. There are multiple concepts involved here, particularly data stores, composed apps, parallel execution, log files etc... See the cogent3 [app documentation](https://cogent3.org/doc/app/index.html) for more details.
# We can combine `piqtree` apps with other cogent3 apps to develop a pipeline. There are multiple concepts involved here, particularly data stores, composed apps, parallel execution, log files etc... See the cogent3 [app documentation](https://cogent3.org/doc/app/index.html) for more details.
#
# To develop a pipeline efficiently we only need a subset of the sequences in an alignment. We will use the [diverse-seq](https://pypi.org/project/diverse-seq/) plugin for that purpose. This allows selecting a specified subset of sequences that capture the diversity in an alignment.
#
# But first, we need the data.
# %%
from piqtree2 import download_dataset
from piqtree import download_dataset

alns_path = download_dataset("mammal-orths.zip", dest_dir="data", inflate_zip=False)

Expand Down
2 changes: 1 addition & 1 deletion docs/apps/available_help.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# %% [markdown]
# To see the apps that `piqtree2` makes available, use the cogent3 function `available_apps()` as follows.
# To see the apps that `piqtree` makes available, use the cogent3 function `available_apps()` as follows.

# %%
from cogent3 import available_apps
Expand Down
2 changes: 1 addition & 1 deletion docs/apps/fit_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# %%
import cogent3

from piqtree2 import download_dataset
from piqtree import download_dataset

aln_path = download_dataset("example.phy.gz", dest_dir="data")
aln = cogent3.load_aligned_seqs(aln_path, moltype="dna", format="phylip")
Expand Down
2 changes: 1 addition & 1 deletion docs/apps/model_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# %%
from cogent3 import app_help, get_app, load_aligned_seqs

from piqtree2 import download_dataset
from piqtree import download_dataset

aln_path = download_dataset("example.phy.gz", dest_dir="data")
# format argument not required after cogent3 2024.11 release
Expand Down
6 changes: 3 additions & 3 deletions docs/apps/nj.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# %% [markdown]
# The Neighbour-Joining method uses genetic distances to build a phylogenetic tree. `piqtree2` provides only `piqtree_jc_dists` for this. `cogent3` includes many more methods. The results of either can be used to build a tree. For divergent sequences we will use Lake's paralinear measure as it accomodates divergent sequence compositions.
# The Neighbour-Joining method uses genetic distances to build a phylogenetic tree. `piqtree` provides only `piqtree_jc_dists` for this. `cogent3` includes many more methods. The results of either can be used to build a tree. For divergent sequences we will use Lake's paralinear measure as it accomodates divergent sequence compositions.

# %%
import cogent3

from piqtree2 import download_dataset
from piqtree import download_dataset

aln_path = download_dataset("example.phy.gz", dest_dir="data")
aln = cogent3.load_aligned_seqs(aln_path, moltype="dna", format="phylip")
Expand Down Expand Up @@ -32,7 +32,7 @@

# %% [markdown]
# > **Warning**
# > Branch lengths can be negative in the piqtree2 NJ tree. This manifests as branches going backwards!
# > Branch lengths can be negative in the piqtree NJ tree. This manifests as branches going backwards!

# %%
tree.get_figure().show()
Expand Down
6 changes: 3 additions & 3 deletions docs/apps/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


# %%
from piqtree2 import available_rate_type
from piqtree import available_rate_type

available_rate_type()

Expand All @@ -12,7 +12,7 @@

# %% tags=hide_code

from piqtree2 import available_freq_type
from piqtree import available_freq_type

available_freq_type()

Expand All @@ -25,6 +25,6 @@


# %%
from piqtree2 import available_models
from piqtree import available_models

available_models()
2 changes: 1 addition & 1 deletion docs/apps/pairwise_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# %%
import cogent3

from piqtree2 import download_dataset
from piqtree import download_dataset

aln_path = download_dataset("example.phy.gz", dest_dir="data")
aln = cogent3.load_aligned_seqs(aln_path, moltype="dna", format="phylip")
Expand Down
2 changes: 1 addition & 1 deletion docs/apps/phylo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# %%
import cogent3

from piqtree2 import download_dataset
from piqtree import download_dataset

aln_path = download_dataset("example.phy.gz", dest_dir="data")
aln = cogent3.load_aligned_seqs(aln_path, moltype="dna", format="phylip")
Expand Down
4 changes: 2 additions & 2 deletions docs/citation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Citation

Please cite piqtree2 as follows:
Please cite piqtree as follows:

Bui Quang Minh, Heiko A Schmidt, Olga Chernomor, Dominik Schrempf, Michael D Woodhams, Arndt von Haeseler, Robert Lanfear, IQ-TREE 2: New Models and Efficient Methods for Phylogenetic Inference in the Genomic Era, Molecular Biology and Evolution, Volume 37, Issue 5, May 2020, Pages 1530–1534, [10.1093/molbev/msaa015](https://doi.org/10.1093/molbev/msaa015)

Expand Down Expand Up @@ -30,4 +30,4 @@ Huttley, G. (2021). cogent3: comparative genomics toolkit (2020.12.21). [10.5281
}
```

<!-- ::: piqtree2 -->
<!-- ::: piqtree -->
20 changes: 10 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# piqtree2 documentation
# piqtree documentation

## Overview

`piqtree2` is a Python package that exposes selected [IQ-TREE 2](http://www.iqtree.org) capabilities within Python, using the [cogent3](https://cogent3.org) library as the interface.
`piqtree` is a Python package that exposes selected [IQ-TREE 2](http://www.iqtree.org) capabilities within Python, using the [cogent3](https://cogent3.org) library as the interface.

`piqtree2` is implemented with the goals of:
`piqtree` is implemented with the goals of:

- making the individual high-performance components of IQ-TREE 2 available within Python, enabling the community to take advantage of these routines.
- facilitating exploratory analyses by leveraging cogent3's capabilities to provide a rich user experience in interactive Jupyter notebooks, e.g. trivial parallelisation across collections of alignments.
- code using piqtree2 apps should be easy to understand.
- code using piqtree apps should be easy to understand.

In addition to the functions provided, `piqtree2` provides mini-applications in the form of [cogent3 apps](https://cogent3.org/doc/app/index.html). These can interplay with other such apps, e.g. the [cogent3-ete3](https://pypi.org/project/cogent3-ete3/) tree conversion plugin, the [diverse-seqs](https://pypi.org/project/diverse-seq/) sequence subsampling plugin.
In addition to the functions provided, `piqtree` provides mini-applications in the form of [cogent3 apps](https://cogent3.org/doc/app/index.html). These can interplay with other such apps, e.g. the [cogent3-ete3](https://pypi.org/project/cogent3-ete3/) tree conversion plugin, the [diverse-seqs](https://pypi.org/project/diverse-seq/) sequence subsampling plugin.

> **Note**
> `piqtree2` does not implement all of the capabilities of IQ-TREE 2!
> `piqtree` does not implement all of the capabilities of IQ-TREE 2!

## Installation

You get the vanilla version of `piqtree2` by running the following command.
You get the vanilla version of `piqtree` by running the following command.

```bash
pip install piqtree2
pip install piqtree
```

To get visualisation support with plotly, use the `[extra]` option.

```bash
pip install "piqtree2[extra]"
pip install "piqtree[extra]"
```

## Supported platforms

At present we do not provide native binaries for Windows. Windows users can run `piqtree2` using the Windows Subsystem for Linux (WSL) which can installed via the Windows Store.
At present we do not provide native binaries for Windows. Windows users can run `piqtree` using the Windows Subsystem for Linux (WSL) which can installed via the Windows Store.
4 changes: 2 additions & 2 deletions docs/quickstart/calculate_jc_distances.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Construct a `cogent3` alignment object, then calculate the pairwise JC distance

```python
from cogent3 import load_aligned_seqs
from piqtree2 import jc_distances
from piqtree import jc_distances

aln = load_aligned_seqs("my_alignment.fasta", moltype="dna")

Expand All @@ -28,7 +28,7 @@ The number of threads to be used may be specified. By default, or if 0 is specif

```python
from cogent3 import load_aligned_seqs
from piqtree2 import jc_distances
from piqtree import jc_distances

aln = load_aligned_seqs("my_alignment.fasta", moltype="dna")

Expand Down
Loading
Loading