picea


Namepicea JSON
Version 0.0.14 PyPI version JSON
download
home_pagehttps://github.com/holmrenser/picea
SummaryA lightweight python library for working with trees and biological sequence collections
upload_time2020-07-10 14:12:06
maintainer
docs_urlNone
authorRens Holmer
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            _picea_
=======

Lightweight python library for working with trees and sequence collections

![tests](https://github.com/holmrenser/picea/workflows/tests/badge.svg)
![docs](https://github.com/holmrenser/picea/workflows/docs/badge.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/holmrenser/picea/badge.svg?branch=master)](https://coveralls.io/github/holmrenser/picea?branch=master)
[![PyPI version](https://badge.fury.io/py/picea.svg)](https://badge.fury.io/py/picea)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/picea.svg)](https://pypi.python.org/pypi/ansicolortags/)
[![PyPI status](https://img.shields.io/pypi/status/picea.svg)](https://pypi.python.org/pypi/ansicolortags/)



```
pip install picea
```

![example figure](https://github.com/holmrenser/picea/raw/master/docs/example1.png)

The above figure can be generated with the following code

```python
from picea import Tree
import matplotlib.pyplot as plt

newick = '(((a,b),(c,d)),e)'
tree = Tree.from_newick(newick)

fig, (ax1, ax2) = plt.subplots(ncols = 2, figsize = (10, 4))

#left-to-right layout with direct links
tree.layout(ltr = True)
for node1, node2 in tree.links:
    ax1.plot(
        (node1.x, node2.x),
        (node1.y, node2.y),
        c = 'k'
    )
for leaf in tree.leaves:
    ax1.text(
        leaf.x + .1, 
        leaf.y - .1, 
        leaf.name,
        fontsize = 18
    )

#right-to-left layout with square links
tree.layout(ltr = False)
for node1, node2 in tree.links:
    ax2.plot(
        (node1.x, node1.x),
        (node1.y, node2.y)
    )
    ax2.plot(
        (node1.x, node2.x),
        (node2.y, node2.y)
    )

#clean up plots
ax1.set_xlim((-.5, 3.5))
ax2.set_xlim((-3.5, .5))
for ax in (ax1,ax2):
    ax.set_xticks([],[])
    ax.set_yticks([],[])
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/holmrenser/picea",
    "name": "picea",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Rens Holmer",
    "author_email": "rens.holmer@wur.nl",
    "download_url": "https://files.pythonhosted.org/packages/42/e2/9a2932b10b94428fa084e61961736d329a4b614ab23203faf06fe5abaad9/picea-0.0.14.tar.gz",
    "platform": "Windows",
    "description": "_picea_\n=======\n\nLightweight python library for working with trees and sequence collections\n\n![tests](https://github.com/holmrenser/picea/workflows/tests/badge.svg)\n![docs](https://github.com/holmrenser/picea/workflows/docs/badge.svg?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/holmrenser/picea/badge.svg?branch=master)](https://coveralls.io/github/holmrenser/picea?branch=master)\n[![PyPI version](https://badge.fury.io/py/picea.svg)](https://badge.fury.io/py/picea)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/picea.svg)](https://pypi.python.org/pypi/ansicolortags/)\n[![PyPI status](https://img.shields.io/pypi/status/picea.svg)](https://pypi.python.org/pypi/ansicolortags/)\n\n\n\n```\npip install picea\n```\n\n![example figure](https://github.com/holmrenser/picea/raw/master/docs/example1.png)\n\nThe above figure can be generated with the following code\n\n```python\nfrom picea import Tree\nimport matplotlib.pyplot as plt\n\nnewick = '(((a,b),(c,d)),e)'\ntree = Tree.from_newick(newick)\n\nfig, (ax1, ax2) = plt.subplots(ncols = 2, figsize = (10, 4))\n\n#left-to-right layout with direct links\ntree.layout(ltr = True)\nfor node1, node2 in tree.links:\n    ax1.plot(\n        (node1.x, node2.x),\n        (node1.y, node2.y),\n        c = 'k'\n    )\nfor leaf in tree.leaves:\n    ax1.text(\n        leaf.x + .1, \n        leaf.y - .1, \n        leaf.name,\n        fontsize = 18\n    )\n\n#right-to-left layout with square links\ntree.layout(ltr = False)\nfor node1, node2 in tree.links:\n    ax2.plot(\n        (node1.x, node1.x),\n        (node1.y, node2.y)\n    )\n    ax2.plot(\n        (node1.x, node2.x),\n        (node2.y, node2.y)\n    )\n\n#clean up plots\nax1.set_xlim((-.5, 3.5))\nax2.set_xlim((-3.5, .5))\nfor ax in (ax1,ax2):\n    ax.set_xticks([],[])\n    ax.set_yticks([],[])\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A lightweight python library for working with trees and biological sequence collections",
    "version": "0.0.14",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "51f8a2f374ebb46b3792b85ad8f790a4",
                "sha256": "a8a84b4b66dc88f31fc0c81d5bb2597d47acc8cff50e21983fd4a53d46c365be"
            },
            "downloads": -1,
            "filename": "picea-0.0.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "51f8a2f374ebb46b3792b85ad8f790a4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13532,
            "upload_time": "2020-07-10T14:12:03",
            "upload_time_iso_8601": "2020-07-10T14:12:03.765111Z",
            "url": "https://files.pythonhosted.org/packages/f3/79/9205c7e4fc86fd866fd0e279d73c64310cb89e9d3667656a1f7e666194ed/picea-0.0.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "617803e20a5d5fbdca779a96e1f60003",
                "sha256": "18445ca9463307f4d208d2da24f69c5449483a9c406790f6fb061203622c27b6"
            },
            "downloads": -1,
            "filename": "picea-0.0.14.tar.gz",
            "has_sig": false,
            "md5_digest": "617803e20a5d5fbdca779a96e1f60003",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 245822,
            "upload_time": "2020-07-10T14:12:06",
            "upload_time_iso_8601": "2020-07-10T14:12:06.125490Z",
            "url": "https://files.pythonhosted.org/packages/42/e2/9a2932b10b94428fa084e61961736d329a4b614ab23203faf06fe5abaad9/picea-0.0.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-07-10 14:12:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "holmrenser",
    "error": "Could not fetch GitHub repository",
    "lcname": "picea"
}
        
Elapsed time: 0.15216s