Skip to main content

Python wrapper for TNT (Tree analysis using New Technology) implied weighting with clades support

Project description

Installation

  1. Pip:

$ pip install pyiwe
  1. conda:

$ conda install -c anaconda -c conda-forge -c alexander-pv pyiwe

The package file from PyPi or conda does not include terminal TNT. To install it, open python in terminal mode and import pyiwe package.

$ python
$ >>> import pyiwe
  1. From source:

$ git clone git@github.com:alexander-pv/pyiwe.git && cd pyiwe
$ pip install .

Terminal TNT will be installed automatically.

Tutorial

  • implied_weighting_theory.ipynb, theory behind implied weighting with fitting functions plots to play;

  • pyiwe_example.ipynb, examples of reading TNT trees, plotting trees, getting branch supports and concavity values distributions for each clade in a tree based on TNT feature matrices;

  • pyiwe_runner.py, terminal-based example for a quick start;

Run pyiwe_runner.py to see arguments help:

$ cd ./pyiwe/tutorials && python pyiwe_runner.py -h
Argument parser for pyiwe_runner.py

positional arguments:
  feat_matrix           str, path to the feature matrix for TNT

optional arguments:
  -h, --help            show this help message and exit
  -k_start k_start      float, minimum value in a linear scale or a degree in a logarithmic scale, default=1e-2
  -k_stop k_stop        float, maximum value in a linear scale or a degree in a logarithmic scale, default=1.5
  -k_num k_num          int, number of samples to generate, default=100
  -k_scale k_scale      str, scale of concavity values, `log` or `linear`, default=`log`
  -n_runs n_runs        int, the number of repeated IW runs, default=3
  -cutoff cutoff        float, cutoff value between 0.0 and 1.0 for a final majority rule tree, default=0.5
  -xmult_hits xmult_hits
                        int, produce N hits to the best length and stop, default=5
  -xmult_level xmult_level
                        int, set level of search (0-10). Use 0-2 for easy data, default=3
  -xmult_drift xmult_drift
                        int, cycles of drifting;, default=5
  -hold hold            int, a tree buffer to keep up to specified number of trees, default=500
  -output_folder output_folder
                        str, path to store data, default=./output
  -log_base log_base    float, base for calculating a log space for concavity constants, default=10.0
  -float_prec float_prec
                        int, Floating point calculations precision, default=5
  -tnt_seed tnt_seed    str, random seed properties for TNT, default=`1`
  -seed seed            str, random seed for Python numpy, default=42
  -tnt_echo tnt_echo    str, `=`, echo each command, `-`, don`t echo, default=`-`
  -memory memory        float, Memory to be used by macro language, in KB, default=10240
  -c                    bool, clear temp *.tre files in output folder after processing
  -v                    bool, add processing verbosity

Basic example:

$ cd ./pyiwe/tutorials
$ python pyiwe_runner.py ../pyiwe/tests/testdata/bryocorini/SI_4_Bryocorinae_matrix.tnt -c

References

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pyiwe-0.0.7-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file pyiwe-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: pyiwe-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for pyiwe-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 775241089ee71e0c8ee4f6436154917d5e5f97056fe3dd93e84c62d75f79ca9d
MD5 6e539e042a22866e146081925906a6bb
BLAKE2b-256 82b4897b24d46dafb1331a40c09dd25f674ef2ca39ee0e37c9f899c43eaeeb80

See more details on using hashes here.

Supported by

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