Skip to main content

package for reconstructing semi-directed phylogenetic level-1 networks from four-leaved networks and sequence alignments

Project description

physquirrel

physquirrel is a Python package for phylogenetic network analysis, with a focus on reconstructing semi-directed phylogenetic level-1 networks from quarnets and/or sequence alignments. The package provides tools to build and visualize phylogenetic networks, leveraging the Squirrel algorithm for efficient network reconstruction.

List of important features

  • $\delta$-heuristic to construct quarnets (4-leaf subnetworks) from a multiple sequence alignment (in .fasta or .nexus format)
  • Squirrel algorithm to construct semi-directed phylogenetic level-1 networks from quarnets
  • Basic visualization of networks
  • Exporting phylogenetic trees and networks in eNewick format
  • Methods to extract information from a network (e.g. its set of splits, its displayed quarnets)

Installation

If you have an up-to-date version of Python installed on your device, the standard package manager pip should come pre-installed. Then, you can install physquirrel from PyPI by simply using the following command in a terminal:

python -m pip install physquirrel

Example usage

Importing the package

To get started with physquirrel, open a Python shell and import the package with:

import physquirrel as psq

Creating a set of quarnets

Use the $\delta$-heuristic to create a dense set of tf-quarnets from a multiple sequence alignment as follows:

msa = psq.MSA('path/to/msa/file.fasta')
Q = msa.delta_heuristic()

Alternatively, the dense set of tf-quarnets can also be loaded directly from a .txt file as follows:

Q = psq.DenseQuarnetSet('path/to/quarnet/file.txt')

This method assumes that the .txt file contains one line per tf-quarnet. The quarnets need to be one of the following two types:

  1. SQ: a b c d for a quarnet on leaves ${a,b,c,d}$ with a split $ab|cd$.
  2. 4C: a b c d for a quarnet on leaves ${a,b,c,d}$ with a four-cycle $a,b,c,d$ and the leaf $a$ below the reticulation.

Reconstructing a network

To create a semi-directed network from the dense set of tf-quarnets, run the Squirrel algorithm:

N = Q.squirrel()

To view the semi-directed network and print its eNewick string (with an arbitrary rooting), run:

N.visualize()
eNewick = N.create_enewick()
print(eNewick)

For a complete overview of different methods and extra parameter options, please check the method descriptions in the source code of physquirrel.

Citation

If you use physquirrel, please cite the corresponding paper:

Squirrel: Reconstructing semi-directed phylogenetic level-1 networks from four-leaved networks and sequence alignments by Niels Holtgrefe, Katharina T. Huber, Leo van Iersel, Mark Jones, Samuel Martin, and Vincent Moulton.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

physquirrel-1.0.5.tar.gz (39.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

physquirrel-1.0.5-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file physquirrel-1.0.5.tar.gz.

File metadata

  • Download URL: physquirrel-1.0.5.tar.gz
  • Upload date:
  • Size: 39.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for physquirrel-1.0.5.tar.gz
Algorithm Hash digest
SHA256 76176f8280ad8dd7407fadec8e6e62a5696325d63df36d3d600762ea7d805d21
MD5 7a5bc305bdfced91834a2d1eb80c7f30
BLAKE2b-256 3d6c4261e6f5142dd90d2e0c704d8a0be6781f881746fa0bd461d21f92eb5999

See more details on using hashes here.

File details

Details for the file physquirrel-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: physquirrel-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for physquirrel-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d69c4653aea23c8607f713a36a408e16cbbff6f5589e38825f5b5da0dff097ec
MD5 1f8270595ce4a4d1305a6a698654c713
BLAKE2b-256 c2ed4df8caeec0b67e59dff3ac2f1fe3427e6acd7b55bd874314c873dadfb022

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page