Phylogemetric

Phylogemetric: A Python library for calculating phylogenetic network metrics - Published in JOSS (2016)

https://github.com/simongreenhill/phylogemetric

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 9 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

phylogenetics
Last synced: 6 months ago · JSON representation

Repository

Python library for calculating the delta score (Holland et al. 2002) and Q-Residual (Gray et al. 2010)

Basic Info
  • Host: GitHub
  • Owner: SimonGreenhill
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 202 KB
Statistics
  • Stars: 5
  • Watchers: 2
  • Forks: 2
  • Open Issues: 0
  • Releases: 1
Topics
phylogenetics
Created almost 11 years ago · Last pushed 12 months ago
Metadata Files
Readme Contributing License Codemeta

README.md

phylogemetric

A python library for calculating delta score (Holland et al. 2002) and Q-Residual (Gray et al. 2010) for phylogenetic data.

Build Status Coverage Status DOI License JOSS

Installation:

Installation is only a pip install away:

shell pip install phylogemetric

Usage: Command line

Basic usage:

```shell

phylogemetric

usage: phylogemetric [-h] method filename ```

Calculate delta score for filename example.nex:

```shell

phylogemetric delta example.nex

taxon1 0.2453 taxon2 0.2404 taxon3 0.2954 ... ```

Calculate qresidual score for filename example.nex:

```shell

phylogemetric qresidual example.nex

taxon1 0.0030 taxon2 0.0037 taxon3 0.0063 ... ```

Note: to save the results to a file use shell piping e.g.:

```shell

phylogemetric qresidual example.nex > qresidual.txt ```

Speeding things up by using multiple processes.

You can tell phylogemetric to use multiple cores with the -w/--workers argument:

```shell

phylogemetric -w 4 qresidual example.nex ```

Usage: Library

Calculate scores:

```python from nexus import NexusReader from phylogemetric import DeltaScoreMetric from phylogemetric import QResidualMetric

load data from a nexus file:

nex = NexusReader("filename.nex") qres = QResidualMetric(nex.data.matrix)

Or construct a data matrix directly:

matrix = { 'A': [ '1', '1', '1', '1', '0', '0', '1', '1', '1', '0', '1', '1', '1', '1', '0', '0', '1', '1', '1', '0' ], 'B': [ '1', '1', '1', '1', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1' ], 'C': [ '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '0', '0', '0', '0', '1', '0', '1', '1', '1' ], 'D': [ '1', '0', '0', '0', '0', '1', '0', '1', '1', '1', '1', '0', '0', '0', '0', '1', '0', '1', '1', '1' ], 'E': [ '1', '0', '0', '0', '0', '1', '0', '1', '0', '1', '1', '0', '0', '0', '0', '1', '1', '1', '1', '1' ], }

delta = DeltaScoreMetric(matrix) ```

Class Methods:

```python

m = DeltaScoreMetric(matrix)

calculates the number of quartets in the data:

m.nquartets()

returns the distance between two sequences:

m.dist(['1', '1', '0'], ['0', '1', '0'])

gets a dictionary of metric scores:

m.score() m.score(workers=4) # with multiple processes.

pretty prints the metric scores:

m.pprint()

```

Requirements:

  • python-nexus >= 1.1

Performance Notes:

Currently phylogemetric is implemented in python, and the Delta/Q-Residual algorithms are O(n). This means that performance is not optimal, and it may take a while to calculate these metrics for datasets with more than 100 taxa or so. To help speed this up, use the multiple processes argument -w/--workers at the command line or by passing workers=n to the score function.

I hope to improve performance in the near future, but in the meantime, if this is an issue for you then try using the implementations available in SplitsTree.

Citation:

If you use phylogemetric, please cite:

Greenhill, SJ. 2016. Phylogemetric: A Python library for calculating phylogenetic network metrics. Journal of Open Source Software. http://dx.doi.org/10.21105/joss.00028

Changelog:

  • 1.2.2: performance improvements
  • 1.2.1: bug fix
  • 1.2.0: performance improvements
  • 1.1.0:
  • Added support for multiple processes.
  • Removed python 2 support.

Acknowledgements:

  • Thanks to David Bryant for clarifying the Q-Residual code.
  • Thanks to Kristian Rother for code quality suggestions.

Owner

  • Name: Simon J Greenhill
  • Login: SimonGreenhill
  • Kind: user
  • Location: Jena, Canberra, Auckland
  • Company: @shh-dlce @eva-dlce

I study how languages and cultures evolve. Scientist at the University of Auckland, and the Max Planck Institute for Evolutionary Anthropology

JOSS Publication

Phylogemetric: A Python library for calculating phylogenetic network metrics
Published
June 20, 2016
Volume 1, Issue 2, Page 28
Authors
Simon J. Greenhill ORCID
ARC Centre of Excellence for the Dynamics of Language, Australian National University
Editor
Arfon Smith ORCID
Tags
phylogenetic language evolution cultural evolution network metrics

CodeMeta (codemeta.json)

{
  "@context": "https://raw.githubusercontent.com/mbjones/codemeta/master/codemeta.jsonld",
  "@type": "Code",
  "author": [
    {
      "@id": "http://orcid.org/0000-0001-7832-6156",
      "@type": "Person",
      "email": "simon@simon.net.nz",
      "name": "Simon J. Greenhill",
      "affiliation": "ARC Centre of Excellence for the Dynamics of Language, Australian National University"
    }
  ],
  "identifier": "http://dx.doi.org/10.5281/zenodo.55663",
  "codeRepository": "https://github.com/SimonGreenhill/phylogemetric",
  "datePublished": "2016-06-15",
  "dateModified": "2016-06-15",
  "dateCreated": "2016-06-15",
  "description": "A Python library for calculating the delta score (Holland et al. 2002) and Q-Residual (Gray et al. 2010)",
  "keywords": "phylogenetic, language evolution, cultural evolution, network metrics",
  "license": "BSD",
  "title": "phylogemetric",
  "version": "v1.0.0"
}

GitHub Events

Total
  • Watch event: 2
  • Push event: 1
Last Year
  • Watch event: 2
  • Push event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 107
  • Total Committers: 2
  • Avg Commits per committer: 53.5
  • Development Distribution Score (DDS): 0.009
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
SimonGreenhill s****n@s****z 106
Kristian Rother k****r@r****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 2
  • Average time to close issues: 4 minutes
  • Average time to close pull requests: 2 days
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • pyup-bot (1)
Pull Request Authors
  • krother (1)
  • SimonGreenhill (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 26 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 3
  • Total versions: 11
  • Total maintainers: 1
pypi.org: phylogemetric

A python library for calculating the delta score (Holland et al. 2002) and Q-Residual (Gray et al. 2010)

  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 3
  • Downloads: 26 Last month
Rankings
Dependent repos count: 9.0%
Dependent packages count: 10.0%
Average: 17.6%
Forks count: 19.1%
Downloads: 24.8%
Stargazers count: 25.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • python-nexus >=1.1
  • pythran >=0.10.0
setup.py pypi
  • numpy *
  • python-nexus *
  • pythran *