Computational Models

Principles of resilient coding for plant ecophysiologists

Tired: Remembering if ‘ACi_sol_C_1.xlsx’ or ‘ACi_sol_D_v3.xlsx’ has correct parameter estimates. Wired: Using reproducible, scalable code to analyse data.
You can listen to this page as an audio file.

Computer coding is becoming an increasingly important skill in biological research. Custom scripts written in computer programming languages are enabling plant ecophysiologists to model plant processes and fit models to data using advanced statistical techniques. Coding allows for consistent, reproducible, transparent and scalable analyses of scientific data, while at the same time minimising human work hours compared to using pre-packaged software. However, many ecophysiologists lack formal programming education. As a result, most published ecophysiological analyses still rely upon spreadsheet-based methods rather than computer code. These are often time consuming, subjective and error prone. For example, cryptic changes in the spreadsheets can occur over time without a record of the changes, potentially leading to compounding errors. Furthermore, spreadsheet tools often break, requiring a fresh, unaltered spreadsheet to be used for each analysis.

The {photosynthesis} R package was created by Stinziano et al. following their eight principles of resilient coding. Image credit: Stinziano et al.

In their new Editor’s Choice article published in AoBP, Stinziano et al. identify eight principles to help plant ecophysiologists without much programming experience write resilient code. These principles are illustrated using a new R software package called {photosynthesis}. The goal of these principles is to advance scientific discovery in plant ecophysiology by making it easier to use code for simulation and data analysis, reproduce results and rapidly incorporate new biological understanding and analytical tools.

Stinziano et al.’s principles of resilient coding cover (i) standardized nomenclature, (ii) consistency in style, (iii) increased modularity/extensibility for easier editing and understanding, (iv) code scalability for application to large data sets, (v) documented contingencies for code maintenance, (vi) documentation to facilitate user understanding, (vii) extensive tutorials and (viii) unit testing and benchmarking. The {photosynthesis} package implements these principles for gas exchange and hydraulic curve fitting and modelling. The authors highlight that adopting some or all of their principles will improve code reproducibility and help advance scientific discovery, without rigidly prescribing how plant ecophysiologists should do their work. Going forward as a community, Stinziano et al. argue that we should adopt a set of coding principles and guidelines to create code as flexible as the biology we study. They state, “it will be easier for new trainees and beginner coders to learn, understand and write code for the community; and it will be easier to tailor existing code to our projects.”

For more information on the {photosynthesis} R package please visit the package GitHub repository.


Stinziano, J.R., Roback, C., Sargent, D., Murphy, B.K., Hudson, P.J., Muir, C.D., 2021. Principles of resilient coding for plant ecophysiologists. AoB PLANTS.

%d bloggers like this: