Skip to main content

A small package to aid in morphometric analysis

Project description

morphostuff

coverage version MIT License

A small python package to aid morphometric analysis. Automates allometric correction and principal component analysis.

Table of Contents

Installation

morphostuff is not in PyPI yet, but I plan to add it in soon. In the meantime, it can be downloaded from GitHub using pip.

python -m pip install morphostuff@git+https://github.com/holsfastagz/morphostuff.git

Execution / Usage

Importing

You can import morphostuff into a Python script like so:

import morphostuff as mstuff

allom Function

Ensure your data are in the proper format. The first column (index 0) should consist of the species name or other identifying information. The second column (index 1) should consist of a standard body length measurement such as SVL. The following columns (indices 2:) should consist of other measurements.

The allom function only requires a data frame as input. A Polars data frame is recommended, but it can also take a Pandas data frame as input. Example:

morph_data = pl.read_csv('morph_data.csv')

allom_data = mstuff.allom(morph_data)

This function outputs a table of allometrically corrected features.

Use help(mstuff.allom) for more information.

morph_pca Function

The input of this function should be a data frame of allometrically corrected characters (i.e., the output of allom). It should follow the same structure as the allom inputs.

morpho_data = mstuff.morph_pca(allom_data)

This function outputs a table containing allometric size corrections, a table containing PCA results, and a PCA biplot.

Use help(mstuff.morpho_data) for more information.

significant_features Function

This function will determine how many principal components account for at least 90% of explained variance and which characters weigh heavily on each PC according to the following formula:

$$ \sqrt{\frac{1} {\mathrm{no. \ of\ characters}}} $$

The input of this function should be the data frame generated as output of morph_pca.

significant_features = mstuff.significant_features(morpho_data)

This function outputs a scree plot, barplots for each PC, a table of loadings of the significant PCS, and a table of significance of each character by PC. These outputs are all written to the disk.

Use help(mstuff.significant_features) for more information.

Technologies

morphostuff uses the following technologies and tools:

Contributing

To contribute to the development of morphostuff, follow the steps below:

  1. Fork morphostuff from https://github.com/holsfastagz/morphostuff/fork
  2. Create your feature branch (git checkout -b feature-new)
  3. Make your changes
  4. Commit your changes (git commit -am 'Add some new feature')
  5. Push to the branch (git push origin feature-new)
  6. Create a new pull request

Author

Holsen B. Moore - @h0ls.bsky.social - holsenmoore@utexas.edu

Change Log

  • 0.1
    • First working version.

License

morphostuff is distributed under the MIT license. See LICENSE for more details.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

morphostuff-0.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

morphostuff-0.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file morphostuff-0.1.tar.gz.

File metadata

  • Download URL: morphostuff-0.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for morphostuff-0.1.tar.gz
Algorithm Hash digest
SHA256 6e285b64a208cd3fbd665d2d6623d858918355c980fbca7bd3b093a61a075ad4
MD5 1d1c38f5c4d936e8c6a2e93830b9164a
BLAKE2b-256 8ac4589cc875845f885792529ff2d1e925c503bed3c4acc8b864c9865f74f9da

See more details on using hashes here.

File details

Details for the file morphostuff-0.1-py3-none-any.whl.

File metadata

  • Download URL: morphostuff-0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for morphostuff-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7cb5fb956a43798021870d6f5a809d75dc672147ed3066f1c3f08efa44378f79
MD5 df1d5558b438e2c58f988b9a6b6ee9dc
BLAKE2b-256 36a16ebc6c9a08116505fe90ad0625f06b83d64a60ebfceec2bdfbd68b417c7c

See more details on using hashes here.

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