dynamicTreeCut


NamedynamicTreeCut JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/kylessmith/dynamicTreeCut
SummaryDynamic Tree Cut
upload_time2021-09-17 12:01:37
maintainer
docs_urlNone
authorKyle S. Smith
requires_python
licenseGPL-3 Licenses
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |Stars| |PyPIDownloads| |PyPI| |Build Status| |Coffee|

.. |Stars| image:: https://img.shields.io/github/stars/kylessmith/dynamicTreeCut?logo=GitHub&color=yellow
   :target: https://github.com/kylessmith/dynamicTreeCut/stargazers
.. |PyPIDownloads| image:: https://pepy.tech/badge/dynamicTreeCut
   :target: https://pepy.tech/project/dynamicTreeCut
.. |PyPI| image:: https://img.shields.io/pypi/v/dynamicTreeCut.svg
   :target: https://pypi.org/project/dynamicTreeCut
.. |Build Status| image:: https://travis-ci.org/kylessmith/dynamicTreeCut.svg?branch=master
   :target: https://travis-ci.org/kylessmith/dynamicTreeCut
.. |Coffee| image:: https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee&color=ff69b4
   :target: https://www.buymeacoffee.com/kylessmith


Python translation of the hybrid dynamicTreeCut method created by Peter Langfelder and Bin Zhang.

dynamicTreeCut was originally published by in *Bioinformatics*:
	Langfelder P, Zhang B, Horvath S (2007) Defining clusters from a hierarchical cluster tree:
	the Dynamic Tree Cut package for R. Bioinformatics 2008 24(5):719-720

dynamicTreeCut R code is distributed under the GPL-3 License and
original sources should be cited.


dynamicTreeCut contains methods for detection of clusters in hierarchical clustering dendrograms.
*NOTE: though the clusters match the R output, the cluster names are shuffled*

Installing
==========

To install, it's best to create an environment after installing and downloading the
`Anaconda Python Distribution <https://www.continuum.io/downloads>`__

    conda env create --file environment.yml

PyPI install, presuming you have all its requirements (numpy and scipy) installed::

	pip install dynamicTreeCut

	
Importation
===========
::

	>>> from dynamicTreeCut import cutreeHybrid
	>>> from scipy.spatial.distance import pdist
	>>> import numpy as np
	>>> from scipy.cluster.hierarchy import linkage
	>>> d = np.transpose(np.arange(1,10001).reshape(100,100))
	>>> distances = pdist(d, "euclidean")
	>>> link = linkage(distances, "average")
	>>> clusters = cutreeHybrid(link, distances)
	..cutHeight not given, setting it to 495.1  ===>  99% of the (truncated) height range in dendro.
	..done.
	>>> clusters["labels"]
	[2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3
 	 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1
 	 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
	
	
Compared to R::

	> library(dynamicTreeCut)
	> d = matrix(1:10000, 100)
	> distances <- dist(d, method="euclidean")
	> dendro <- hclust(distances, method="average")
	> clusters <- cutreeDynamic(dendro, distM=as.matrix(distances))
	  ..cutHeight not given, setting it to 495  ===>  99% of the (truncated) height range in dendro.
	  ..done.
	> clusters
	  [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3
 	  [38] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1
 	  [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Installation
============

If you dont already have numpy and scipy installed, it is best to download
`Anaconda`, a python distribution that has them included.  

    https://continuum.io/downloads

Dependencies can be installed by::

    pip install -r requirements.txt


License
=======

dynamicTreeCut is available under the GPL-3 License
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kylessmith/dynamicTreeCut",
    "name": "dynamicTreeCut",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Kyle S. Smith",
    "author_email": "kyle.smith@stjude.org",
    "download_url": "https://files.pythonhosted.org/packages/e2/f9/07241f0d25fe0e00a2e545142241a9cf81482b4054789e0cd590b0016623/dynamicTreeCut-0.1.1.tar.gz",
    "platform": "",
    "description": "|Stars| |PyPIDownloads| |PyPI| |Build Status| |Coffee|\n\n.. |Stars| image:: https://img.shields.io/github/stars/kylessmith/dynamicTreeCut?logo=GitHub&color=yellow\n   :target: https://github.com/kylessmith/dynamicTreeCut/stargazers\n.. |PyPIDownloads| image:: https://pepy.tech/badge/dynamicTreeCut\n   :target: https://pepy.tech/project/dynamicTreeCut\n.. |PyPI| image:: https://img.shields.io/pypi/v/dynamicTreeCut.svg\n   :target: https://pypi.org/project/dynamicTreeCut\n.. |Build Status| image:: https://travis-ci.org/kylessmith/dynamicTreeCut.svg?branch=master\n   :target: https://travis-ci.org/kylessmith/dynamicTreeCut\n.. |Coffee| image:: https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee&color=ff69b4\n   :target: https://www.buymeacoffee.com/kylessmith\n\n\nPython translation of the hybrid dynamicTreeCut method created by Peter Langfelder and Bin Zhang.\n\ndynamicTreeCut was originally published by in *Bioinformatics*:\n\tLangfelder P, Zhang B, Horvath S (2007) Defining clusters from a hierarchical cluster tree:\n\tthe Dynamic Tree Cut package for R. Bioinformatics 2008 24(5):719-720\n\ndynamicTreeCut R code is distributed under the GPL-3 License and\noriginal sources should be cited.\n\n\ndynamicTreeCut contains methods for detection of clusters in hierarchical clustering dendrograms.\n*NOTE: though the clusters match the R output, the cluster names are shuffled*\n\nInstalling\n==========\n\nTo install, it's best to create an environment after installing and downloading the\n`Anaconda Python Distribution <https://www.continuum.io/downloads>`__\n\n    conda env create --file environment.yml\n\nPyPI install, presuming you have all its requirements (numpy and scipy) installed::\n\n\tpip install dynamicTreeCut\n\n\t\nImportation\n===========\n::\n\n\t>>> from dynamicTreeCut import cutreeHybrid\n\t>>> from scipy.spatial.distance import pdist\n\t>>> import numpy as np\n\t>>> from scipy.cluster.hierarchy import linkage\n\t>>> d = np.transpose(np.arange(1,10001).reshape(100,100))\n\t>>> distances = pdist(d, \"euclidean\")\n\t>>> link = linkage(distances, \"average\")\n\t>>> clusters = cutreeHybrid(link, distances)\n\t..cutHeight not given, setting it to 495.1  ===>  99% of the (truncated) height range in dendro.\n\t..done.\n\t>>> clusters[\"labels\"]\n\t[2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3\n \t 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1\n \t 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]\n\t\n\t\nCompared to R::\n\n\t> library(dynamicTreeCut)\n\t> d = matrix(1:10000, 100)\n\t> distances <- dist(d, method=\"euclidean\")\n\t> dendro <- hclust(distances, method=\"average\")\n\t> clusters <- cutreeDynamic(dendro, distM=as.matrix(distances))\n\t  ..cutHeight not given, setting it to 495  ===>  99% of the (truncated) height range in dendro.\n\t  ..done.\n\t> clusters\n\t  [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3\n \t  [38] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1\n \t  [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n\nInstallation\n============\n\nIf you dont already have numpy and scipy installed, it is best to download\n`Anaconda`, a python distribution that has them included.  \n\n    https://continuum.io/downloads\n\nDependencies can be installed by::\n\n    pip install -r requirements.txt\n\n\nLicense\n=======\n\ndynamicTreeCut is available under the GPL-3 License",
    "bugtrack_url": null,
    "license": "GPL-3 Licenses",
    "summary": "Dynamic Tree Cut",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/kylessmith/dynamicTreeCut"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2f907241f0d25fe0e00a2e545142241a9cf81482b4054789e0cd590b0016623",
                "md5": "13666611df7ac09261ed0fbe35a20dae",
                "sha256": "8ad78e78867a17c9c5fb448e8481adf99db403d0a879a36d7d288fd4953e602b"
            },
            "downloads": -1,
            "filename": "dynamicTreeCut-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "13666611df7ac09261ed0fbe35a20dae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13238,
            "upload_time": "2021-09-17T12:01:37",
            "upload_time_iso_8601": "2021-09-17T12:01:37.126800Z",
            "url": "https://files.pythonhosted.org/packages/e2/f9/07241f0d25fe0e00a2e545142241a9cf81482b4054789e0cd590b0016623/dynamicTreeCut-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-09-17 12:01:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kylessmith",
    "github_project": "dynamicTreeCut",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "dynamictreecut"
}
        
Elapsed time: 0.18636s