Skip to main content

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

  1. pip install jplaceparser

or

  1. 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 Placements19
Fieldsedge_num, likelihood, like_weight_ratio, distal_length, pendant_length
JplaceParser version0.0.1
AuthorSemidá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 Placements9
Fieldsedge_num, likelihood, like_weight_ratio, distal_length, pendant_length
JplaceParser version0.0.1
AuthorSemidán Robaina Estévez, 2022

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

jplaceparser-0.0.2-py3.10.egg (8.5 kB view hashes)

Uploaded Source

Supported by

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