Tools to parse the JPLACE files
Project description
JplaceParser
Python tools to parse and manipulate JPlace files, the format of Evolutionary Placement results.
JplaceParser allows not only reading Jplace files as python dictionaries but also manipulating field values and exporting back to jplace files. It contains a number of filters to remove placements that do not satisfy quality criteria. Currently, placements can be filtered by three criteria involving the pendant and distal placement length as well as the phylogenetic tree diameter:
- Filter by maximum pendant length
- Filter by maximum pendant to distal length ratio
- Filter by maximum pendant to tree diameter ratio
This is an ongoing project!
Installation
pip install jplaceparser
or
-
Git clone project to local directory.
In terminal navigate to directory and enter:
python setup.py install
from jplaceparser import JplaceParser
jplace = JplaceParser.fromJplaceFile("examples/example.jplace")
jplace
| Number of Placements | 19 |
| Fields | edge_num, likelihood, like_weight_ratio, distal_length, pendant_length |
| JplaceParser version | 0.0.1 |
| Author | Semidán Robaina Estévez, 2022 |
filtered_jplace = jplace.filterByMaxPendantToTreeDiameterRatio(
max_pendant_ratio=0.001
)
filtered_jplace.writeToFile("examples/filtered_example.jplace")
filtered_jplace
Filtering placements for tree diameter: 4.519636416
| Number of Placements | 9 |
| Fields | edge_num, likelihood, like_weight_ratio, distal_length, pendant_length |
| JplaceParser version | 0.0.1 |
| Author | Semidán Robaina Estévez, 2022 |
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jplaceparser-0.0.2-py3.10.egg.
File metadata
- Download URL: jplaceparser-0.0.2-py3.10.egg
- Upload date:
- Size: 8.5 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9ce1b466faac51f95c01d01ff76a30b471d77ed5ab67d490fbb9faafc8ef82c
|
|
| MD5 |
e01559b49de9e19c6e3b9a731ab56a31
|
|
| BLAKE2b-256 |
990d4171524c6a6bce97056926233451bd0d9c29ec69651afd44074a02527896
|