ADViewpy is Python Library to visually compare phylogenetic trees
Project description
ADViewpy
Introduction
ADViewpy pip package is a Python port of ADView system, originally developed by Professor Zipeng Liu. ADViewpy aims to provide visual comparison of phylogenetic trees, usually between one reference tree and a collection of hundreds of trees.
- ADView System by Professor Zipeng Liu: GitHub | ADView Website
The alpha version of this tool has been uploaded to PyPI.
Contributors
Wengshan NG
Features
- Visual comparison of phylogenetic trees
- Easy integration with existing Python workflows
Installation
Installation Steps
-
Install ADViewpy package from PyPI:
pip install adviewpy -
Import the ADViewpy package and initialize it in your Python script:
import ADViewpy # Initialize the ADViewpy tool ADViewpy.init()
Usage
1.init(treefile)
Initializes ADViewpy and creates the reference tree.
Parameter:
treefile(str): Path to the reference tree file in Newick format.
Return:
ADViewpyinstance
2.add_tree_collection(treefile,namefile)
Add tree collection to ADViewpy
Parameters:
treefile(str): Path to the tree collection file (each line contains a tree in newick format).nanefile(str): Path to the tree collection's name file, a name of tree each line corresponding to tree collection file.
3.set_outgroup(outgroup_taxon[])
Specify outgroup of phylogenetic tree, ADViewpy will re-root the trees according to outgroup provdied.
Parameter:
outgroup_taxon[](list): List of taxa names in outgroup
4.reference_tree(exact_match_range[],support_value_range[])
Visualization of reference tree, user can find branch with respect to attribute range.
Parameters:
-
exact_match_range[](list): A list to represent node exact match percentage range, for example [80, 100], which represents to find nodes with exact match percentage between 80% and 100%. -
support_value_range(list): A list to represent node support value range, for example [50, 80], which represents to find nodes with support value between 50 and 80.
5.AD(view,scale,context_level,max_ad,ad_interval,tree_id,tree_name,sort,escape_taxa_as_context_block,show_block_proportional,subtree_independent,show_tree_name,filter,differentiate_inexact_match)
Visualization of individual and cluster aggregated dendrograms, to show topological relationships between the selected focal subtree.
Common parameters:
view(str):AD Individualto show individual aggregated dendrograms,AD Clusterto show cluster aggregated dendrograms.scale(foat): Set the scale of aggregated dendrograms, default scale is 0.1.
Parameters in individual view:
context_level(int): Control how many context blocks to show.max_ad(int): Set the maximum number of aggregated dendrograms to display.ad_interval(list): List to represent tree id range, for example [1, 20], which represents to show aggregated dendrograms with tree id between 1 and 20.tree_id(list): Each integer in list represents a tree ID. Only trees matching these IDs will be displayed.tree_name(list): Each str in list represents a tree name. Only trees matching these names will be displayed.sort(str): Specify how to sort the displayed aggregated dendrograms, can choose fromid,name, andrf distance.escape_taxa_as_context_block(Boolean): Determine whether escape taxa should be considered as a context block.show_block_proportional(Boolean): Determine whether to use color coverage to indicate the percentage of highlighted taxa within subtreesubtree_independent(Boolean): Determine whether to merge overlapping subtrees into a single block.show_tree_name(Boolean): Determine whether to show tree id and tree name on top of each aggregated dendrogram.filter(str): Specify whether the conditions are inclusive or exclusive for the following parameters: ad_interval, tree_id,tree_name.
Parameter in cluster view:
differentiate_inexact_match(Boolean): Choose whether to further distinguish exact and inexact matches in cluster
6.pairwise_comparison(compare_tree)
Pairwise compare two trees in detail. Allow to pairwise compare one tree in the collection with the reference tree or compare two trees in tree collection.
To compare a tree in the collection with the reference tree, user can choose a tree from AD()'s output view with mouse click.
Parameter:
compare_tree (int/str/list): Specify the trees for pairwise comparison. A tree can be specified using IDs or names. Providing an ID or name selects a single tree from the tree collection to compare with a reference tree. If a list is provided containing two trees, it indicates comparison between trees within the collection.
7.tree_distribution()
Showing distributions of trees in terms of their agreement and conflicts of leaf memberships for user-selected subtrees.
8.tree_distance()
Display the distances between each trees using a scatter plot.
Return:
Plotlyscatter showing distances between trees computed by the t-SNE dimensionality reduction technique.
9.export_image(view,filename,*args)
Exports generated view as an image
Parameter:
view (str): Selects which view to export. Choices include Reference Tree,AD Individual,AD Cluster,Tree Distribution,Tree Distance,Pairwise Comparison.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ADViewpy-0.7a0.tar.gz.
File metadata
- Download URL: ADViewpy-0.7a0.tar.gz
- Upload date:
- Size: 46.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff6658fee01c7c78e6a19087c62dbb72abf99994bd1d3f0a06ef4ea864dd32b8
|
|
| MD5 |
88cb4f8583a04f5efabae81e7d91cecd
|
|
| BLAKE2b-256 |
dca96f32803f945fded71a05c361d8a8c916500e045b15e5a7f13770ff290eb8
|