Predict leaf traits by uploading a .csv file that contains leaf spectra.
SpecTraits provides two ways for predicting leaf traits: i) by importing PLSR coefficients, and ii) by using radiative transfer models (RTM).
The spectra file most contain wavelengths (nm) as columns and samples as rows, a first column should be named ID.
For PLRS coefficients predictions, both the spectra and coefficients files should share the same columns name. For RTM predictions, the spectra file should contain columns between 400 and 2400 nm at 1 nm spacing.
Predicted traits can be validate by uploading a .csv file that contains columns of leaf traits and the exact number of samples as the spectra file.
An example of files containing leaf spectra and traits can be downloaded here.
Build PLSR models by uploading .csv files that contains leaf spectra and leaf trait.
The spectra file most contain wavelengths (nm) as columns and samples as rows. The first column should be named ID.
The leaf trait file most contain traits as columns and samples as rows, The first column should also be named ID.
SpecTraits provide a way to estimate the optimal number of components using machine learning frameworks.
SpecTraits also provide a way to build and export PLSR models while assessing their performance.
An example of files containing leaf spectra and traits can be downloaded here
Upload a spectra file and select a preprocessing method to apply.
The spectra file (.csv) must contain wavelengths (nm) as columns and samples as rows, with a first column named ID.
Define the target spectral spacing and range for FWHM-based resampling
Spectra will be resampled using a Gaussian model that uses the Full Width at Half Maximum (FWHM) of the instrument bands (spectrolab; Meireles et al. 2022).
Define parameters for Savitzky-Golay smoothing filter
The filter smooths spectra using a polynomial fit within a moving window.
Select a transformation to apply to the spectra
Apply FWHM-based spectral resampling
Apply Savitzky-Golay smoothing filter to spectra
Apply spectral transformation
Version 0.1 |
GitHub
Leaf spectroscopy has emerged as a powerful tool for the rapid, non-destructive estimation of leaf traits. However, deriving trait information from spectral data is often not standardized across research studies and can be technically demanding, creating substantial barriers for users without expertise.
SpecTraits was developed to bridge this gap by providing an integrated, user-friendly platform that consolidates tools for deriving leaf traits from spectral data. Our goal is to make leaf spectroscopy more accessible to researchers and plant scientists who use leaves for phenotyping (e.g., ecologists, agronomists, and evolutionary biologists), enabling them to fully leverage the potential of spectroscopy to advance the understanding of plant evolution and function.
If you use SpecTraits in your research, please cite:
@software{SpecTraits,
author = {Guzmán, J. Antonio and Cavender-Bares, Jeannine},
title = {SpecTraits: A Shiny Application for Leaf Trait Prediction Using Spectroscopy},
year = {2026},
version = {0.1},
url = {https://github.com/ASCEND-BII/SpecTraits}
}
The development of SpecTraits was supported by:
NSF DBI: 2021898
For questions, bug reports, or feature requests, please visit our GitHub Issues page or contact the development team.
Last updated: 2026-04-01