Creative morphometrics

Using R and python for colorful research of biological shape

Adventurous Software

Computational power and availability provided by both R and python are tremenduous. Shape analysis requires acessible and versatile software for performing statistical procedures and matrix algebra, so both of the languages are a good choice, since the main data structure in both of them is the matrix or a multidimensional matrix. Both R and python have a great collection of libraries that enable all of the required analyses. Also, online (and offline) community of users is enormous so any problem can be solved easily, in the cloud.

In R, there are several libraries that implement procedures for the biological analysis of shape, mainly landmark data, but also outline data. There are four packages for performing geometric morphometrics in R and they are maintained actively by their authors, who are also willing to help with their usage.

  1. geomorph
  2. shapes
  3. Morpho
  4. Momocs

Apart from the packages there is a wonderful book about doing morphometric analyses in R, conveniently named Morphometrics in R, from Julien Claude, written in 2008. This book is one of the best starting points for R in general, morphometric theory and practical usage of all GM analyses.

Python is a general-purpose programming language that has unbelievably large user base but there are no specific packages for geometric morphometrics, yet. On the other hand, python offers some of the most powerfull linear algebra libraries numpy and scipy. Also, there are other libraries commonly used in scientific data analysis such as pandas for flexible data manipulation and uniterrupted workflow and matplotlib that offers great visualizations. The best thing about scientific python usage is the availability of the language distributions budled with all the libraries needed for scientific data analysis. This is commonly known as scipy stack that is easily installed on all major operating systems (Linux, Windows and OSX). The overview of scientific python distributions is given here.

Finally, both R and python rely on command line interface for all analytic steps. R comes with the basic Tcl/Tk command line interface that offers basic functionality for controlling the workflow. Python has IDLE, command line interface that is very similar to basic R. Fortunately, both languages have superb IDEs (Integrated Development Environments) that enable flexible and versatile coding practice. For R there is R studio and for Python there is PyCharm community edition. Scientific python distributions also pack with the fenomenal IPython enhanced console that offers much flexibility in entering commands and esspecially for generating nicely formatted HTML reports, neatly organized. R Studio also has great report generation sytstem through the knitr package and its own markdown system.