BioCro is a model that predicts plant growth over time given crop-specific parameters and environmental data as input.
It uses models of key physiological and biophysical processes underlying plant growth (Humphries and Long, 1995), and has previously been used for predicting biomass yield and leaf area index of switchgrass and miscanthus (Miguez et al., 2009). In 2022, BioCro was reorganized to take a truly modular approach to modeling (Lochocki et al., 2022) and a new soybean model was developed (Matthews et al., 2022).
BioCro has also been integrated into a suite of tools that link the model directly to crop trait and yield data (LeBauer et al., 2013). The Predictive Ecosystem Analyzer (PEcAn) couples BioCro to the Biofuel Ecophysiological Traits and Yields database.
See References below for a full list of scientific publications using the BioCro framework.
The run_biocro() function accepts initial values, parameters, climate
variables, and sets of modules to run. It returns the results in a data frame.
library(BioCro)
library(lattice)
result <- with(soybean, {run_biocro(
initial_values,
parameters,
soybean_weather$'2002',
direct_modules,
differential_modules,
ode_solver
)})
xyplot(Stem + Leaf ~ TTc, data = result, type='l', auto = TRUE)
There are parameters and modules for soybean (Glycine max), miscanthus (Miscanthus x giganteus), and willow (Saliceae salix).
BioCro is available on CRAN, so it can be installed from R as follows:
install.packages('BioCro')
git clone https://github.com/biocro/biocro The repository
contains a Git submodule, so you will need to take the additional step of
running git submodule update --init to obtain it.cd path_to_source_code_parent_directory
R CMD INSTALL biocro
setwd('path_to_source_code_parent_directory')
install.packages('biocro', repos=NULL, type='SOURCE')
Please see the contribution guidelines before submitting changes. These may be found in Chapter One of the Developer's Manual on the public BioCro Documentation web site.
Command line instructions are provided as quick-reference. See the developer's manual for additional details and for instructions on running these steps inside an R session.
These instructions assume that the source files are in a directory named biocro residing
in a parent directory dir. Open a terminal to dir.
R CMD check will fail without.--preclean forces recompilation
of all C++ code.R CMD INSTALL biocro --preclean
tests directory in BioCro's source code,
then run the testthat.R script.cd biocro/tests
Rscript --vanilla testthat.R
cd ../..
R CMD build to build the BioCro tarball and then R CMD check on the tarball (optional):R CMD build --compact-vignettes=both biocro
R CMD check --as-cran BioCro_X.Y.Z.tar.gz
where X.Y.Z is the version number. Flags --compact-vignettes=both and --as-cran
are recommended (but optional). If skipped, this check is also performed after a PR is submitted via
Github actions, but faster to run locally.
5. Submit pull request. Pull requests should merge to the branch develop
and not main, except for hotfixes or patches of main.
See the public BioCro Documentation web site. There will be found not only the usual package documentation, but also documentation of the C++ code, including notes on the biological models used in BioCro and their implementation. Also included is documentation for BioCro package developers and maintainers.
There is also a separate page that documents all of the quantities used by the Standard BioCro Module Library.
The BioCro R package is licensed under the MIT license, while the BioCro C++
framework is licensed under version 3 or greater of the GNU Lesser General
Public License (LGPL). This scheme allows people to freely develop models for
any use (public or private) under the MIT license, but any changes to the
framework that assembles and solves models must make source code changes
available to all users under the LGPL. See LICENSE.note for more details.
Appropriate references for BioCro are
Miguez et al. (2009) and
Lochocki et al. (2022), with details given below. To
cite the package itself, use citation('BioCro') in R to get details for the
current installed version.