morphops


Namemorphops JSON
Version 0.1.13 PyPI version JSON
download
home_pagehttps://github.com/vaipatel/morphops
SummaryGeometric Morphometrics operations in Python
upload_time2021-10-10 08:44:52
maintainer
docs_urlNone
authorVaibhav Patel
requires_python>=3.5.1
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Welcome to Morphops!
====================

Morphops implements common operations and algorithms for Geometric
Morphometrics, in Python 3.

.. GitHub Actions
.. image:: https://github.com/vaipatel/morphops/actions/workflows/build.yml/badge.svg
    :target: https://github.com/vaipatel/morphops/actions/workflows/build.yml
    :alt: Build status

.. Read the Docs
.. image:: https://readthedocs.org/projects/morphops/badge/?version=latest
    :target: https://morphops.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. PyPI version
.. image:: https://img.shields.io/pypi/v/morphops
    :target: https://pypi.org/project/morphops
    :alt: PyPI version

Features
========

Some high-level operations in the current version are

* Centering, rescaling data:
* Rigid Rotation, Ordinary and Generalized Procrustes alignment:
* Thin-plate spline warping:
* Reading from and writing to \*.dta files:

Dependencies
------------

* numpy

Installation
------------

:code:`pip install morphops`

Usage Examples
--------------

.. code-block:: python

   import morphops as mops
   
   # Create 3 landmark sets, each having 5 landmarks in 2 dimensions.
   A = [[0,0],[2,0],[2,2],[1,3],[0,2]]
   B = [[0.1,-0.1],[2,0],[2.3,1.8],[1,3],[0.4,2]]
   C = [[-0.1,-0.1],[2.1,0],[2,1.8],[0.9,3.1],[-0.4,2.1]]

   # Perform Generalized Procrustes alignment to align A, B, C.
   res = mops.gpa([A, B, C])
   # res['aligned'] contains the aligned A, B, C. res['mean'] is their mean.

   # Create a Thin-plate Spline warp from A to B and warp C.
   warped_C = mops.tps_warp(A, B, C)
   # warped_C contains the image of the pts in C under the TPS warp.


What is Geometric Morphometrics?
================================

Geometric Morphometrics is a statistical toolkit for quantifying and studying
shapes of forms that are represented by homologous landmark sets.

"Shape" has a specific notion here. For a given landmark set, its shape refers
to the spatial information that survives after discarding its absolute
position, scale and rotation. So two landmark sets have the same shape if they
can be brought in perfect alignment by only changing their positions, scales
and rotations.

Common Operations and Algorithms in Studies
-------------------------------------------

Geometric Morphometrics is often used when pursuing statistical questions
involving the morphology of biological forms, like `do corvid species that 
frequently probe have longer bills and more to-the-side orbits than corvid species that frequently peck
<https://frontiersinzoology.biomedcentral.com/articles/10.1186/1742-9994-6-2>`_.
It helps inform the Data Collection, Preprocessing and Analysis
steps of such statistical studies with sound theoretical or practical justifications.

Data Collection
^^^^^^^^^^^^^^^

The most prevalent form of Data Collection involves picking homologous
landmarks on each form. For curving forms with few homologous points but
well-understood homologous regions, there is a notion of semilandmarks which
can "slide" to minimize equidistant sampling artifacts.

A common file format for saving landmarks for a set of specimens is the `*.dta`
format used by the IDAV Landmark Editor software.

Preprocessing
^^^^^^^^^^^^^

As discussed before, a central idea in Geometric Morphometrics is extracting
the "shapes" of the landmark sets. One way to achieve this is to use the
Generalized Procrustes Alignment algorithm or GPA. GPA aligns all the landmark
sets by modifying their locations, orientations and sizes so as to minimize
their collective interlandmark distances.

After this step, the aligned shapes all lie in a high-dimensional non-linear 
manifold. For example, if the orignal landmark sets were a set of triangles,
the aligned shapes lie on a sphere. Moreover, for naturally arising datasets,
the shapes likely lie very close to each other and are distributed around a
mean shape. This usually makes it permissible to project all the shapes into
the tangent space at the mean shape, and this way the final shape vectors lie
in a linear space.

Analysis
^^^^^^^^

With the shapes lying in a high-dimensional linear space after preprocessing,
they can now be submitted to various commonly used statistical procedures like
Principal Components Analysis and various kinds of regression for further
analysis.

**(This file was autogenerated from README_for_docs.rst by running `make README_for_gh` in the docs directory)**



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vaipatel/morphops",
    "name": "morphops",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5.1",
    "maintainer_email": "",
    "keywords": "",
    "author": "Vaibhav Patel",
    "author_email": "vai.pateln@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bb/af/b98a7956956f382f30a39399277d633d17ff54cb395b64093676470e6bab/morphops-0.1.13.tar.gz",
    "platform": "",
    "description": "Welcome to Morphops!\n====================\n\nMorphops implements common operations and algorithms for Geometric\nMorphometrics, in Python 3.\n\n.. GitHub Actions\n.. image:: https://github.com/vaipatel/morphops/actions/workflows/build.yml/badge.svg\n    :target: https://github.com/vaipatel/morphops/actions/workflows/build.yml\n    :alt: Build status\n\n.. Read the Docs\n.. image:: https://readthedocs.org/projects/morphops/badge/?version=latest\n    :target: https://morphops.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. PyPI version\n.. image:: https://img.shields.io/pypi/v/morphops\n    :target: https://pypi.org/project/morphops\n    :alt: PyPI version\n\nFeatures\n========\n\nSome high-level operations in the current version are\n\n* Centering, rescaling data:\n* Rigid Rotation, Ordinary and Generalized Procrustes alignment:\n* Thin-plate spline warping:\n* Reading from and writing to \\*.dta files:\n\nDependencies\n------------\n\n* numpy\n\nInstallation\n------------\n\n:code:`pip install morphops`\n\nUsage Examples\n--------------\n\n.. code-block:: python\n\n   import morphops as mops\n   \n   # Create 3 landmark sets, each having 5 landmarks in 2 dimensions.\n   A = [[0,0],[2,0],[2,2],[1,3],[0,2]]\n   B = [[0.1,-0.1],[2,0],[2.3,1.8],[1,3],[0.4,2]]\n   C = [[-0.1,-0.1],[2.1,0],[2,1.8],[0.9,3.1],[-0.4,2.1]]\n\n   # Perform Generalized Procrustes alignment to align A, B, C.\n   res = mops.gpa([A, B, C])\n   # res['aligned'] contains the aligned A, B, C. res['mean'] is their mean.\n\n   # Create a Thin-plate Spline warp from A to B and warp C.\n   warped_C = mops.tps_warp(A, B, C)\n   # warped_C contains the image of the pts in C under the TPS warp.\n\n\nWhat is Geometric Morphometrics?\n================================\n\nGeometric Morphometrics is a statistical toolkit for quantifying and studying\nshapes of forms that are represented by homologous landmark sets.\n\n\"Shape\" has a specific notion here. For a given landmark set, its shape refers\nto the spatial information that survives after discarding its absolute\nposition, scale and rotation. So two landmark sets have the same shape if they\ncan be brought in perfect alignment by only changing their positions, scales\nand rotations.\n\nCommon Operations and Algorithms in Studies\n-------------------------------------------\n\nGeometric Morphometrics is often used when pursuing statistical questions\ninvolving the morphology of biological forms, like `do corvid species that \nfrequently probe have longer bills and more to-the-side orbits than corvid species that frequently peck\n<https://frontiersinzoology.biomedcentral.com/articles/10.1186/1742-9994-6-2>`_.\nIt helps inform the Data Collection, Preprocessing and Analysis\nsteps of such statistical studies with sound theoretical or practical justifications.\n\nData Collection\n^^^^^^^^^^^^^^^\n\nThe most prevalent form of Data Collection involves picking homologous\nlandmarks on each form. For curving forms with few homologous points but\nwell-understood homologous regions, there is a notion of semilandmarks which\ncan \"slide\" to minimize equidistant sampling artifacts.\n\nA common file format for saving landmarks for a set of specimens is the `*.dta`\nformat used by the IDAV Landmark Editor software.\n\nPreprocessing\n^^^^^^^^^^^^^\n\nAs discussed before, a central idea in Geometric Morphometrics is extracting\nthe \"shapes\" of the landmark sets. One way to achieve this is to use the\nGeneralized Procrustes Alignment algorithm or GPA. GPA aligns all the landmark\nsets by modifying their locations, orientations and sizes so as to minimize\ntheir collective interlandmark distances.\n\nAfter this step, the aligned shapes all lie in a high-dimensional non-linear \nmanifold. For example, if the orignal landmark sets were a set of triangles,\nthe aligned shapes lie on a sphere. Moreover, for naturally arising datasets,\nthe shapes likely lie very close to each other and are distributed around a\nmean shape. This usually makes it permissible to project all the shapes into\nthe tangent space at the mean shape, and this way the final shape vectors lie\nin a linear space.\n\nAnalysis\n^^^^^^^^\n\nWith the shapes lying in a high-dimensional linear space after preprocessing,\nthey can now be submitted to various commonly used statistical procedures like\nPrincipal Components Analysis and various kinds of regression for further\nanalysis.\n\n**(This file was autogenerated from README_for_docs.rst by running `make README_for_gh` in the docs directory)**\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Geometric Morphometrics operations in Python",
    "version": "0.1.13",
    "project_urls": {
        "Homepage": "https://github.com/vaipatel/morphops"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "762857eda16adfba5dd18260cbe6605c4cc4e94caef4f74dc06621d2de6acb1f",
                "md5": "bff349aa5d4251dcec1d45c1d09f27d4",
                "sha256": "3e3f5472e842281dd55e1d17ded34bb42877e3440af87ce1bec29f57d6bf447f"
            },
            "downloads": -1,
            "filename": "morphops-0.1.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bff349aa5d4251dcec1d45c1d09f27d4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5.1",
            "size": 23639,
            "upload_time": "2021-10-10T08:44:50",
            "upload_time_iso_8601": "2021-10-10T08:44:50.146938Z",
            "url": "https://files.pythonhosted.org/packages/76/28/57eda16adfba5dd18260cbe6605c4cc4e94caef4f74dc06621d2de6acb1f/morphops-0.1.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bbafb98a7956956f382f30a39399277d633d17ff54cb395b64093676470e6bab",
                "md5": "c4c2c64ad9a61faa8b103784d531e541",
                "sha256": "0ed12193d59bbbdefb1871a9147ff90a4d87b331b53130789bd7acedbc47a09f"
            },
            "downloads": -1,
            "filename": "morphops-0.1.13.tar.gz",
            "has_sig": false,
            "md5_digest": "c4c2c64ad9a61faa8b103784d531e541",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5.1",
            "size": 22283,
            "upload_time": "2021-10-10T08:44:52",
            "upload_time_iso_8601": "2021-10-10T08:44:52.346383Z",
            "url": "https://files.pythonhosted.org/packages/bb/af/b98a7956956f382f30a39399277d633d17ff54cb395b64093676470e6bab/morphops-0.1.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-10-10 08:44:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vaipatel",
    "github_project": "morphops",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "morphops"
}
        
Elapsed time: 0.11456s