grayleafspotr automates the quantitative phenotyping of gray leaf spot
(Magnaporthe oryzae) fungal colonies grown on petri dishes. Given a
folder of plate photographs, the package:
basilisk handles Python dependencies automatically, so you do not need to
set up Python yourself. For visual quality control, plot_grayleafspot_overlay()
uses the Bioconductor EBImage package to draw the detected dish boundary, colony
outline, and crack segments directly on the source photograph, so automated
segmentation results can be checked against the original image rather than
trusted as an opaque summary statistic.
The package ships pre-computed results from three example images. Load them
with example_grayleafspot_results() to try the plotting functions
immediately:
run <- example_grayleafspot_results()
run$results[, c("filename", "day", "area_mm2", "diameter_mm",
"circularity", "crack_coverage_pct", "qc_status")]
## # A tibble: 2 × 7
## filename day area_mm2 diameter_mm circularity crack_coverage_pct qc_status
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
## 1 demo_day1… 1 12 3.9 0.8 0 pass
## 2 demo_day2… 2 18 4.78 0.77 2.5 pass
plot_colony_expansion(run)
plot_growth_roughness(run)
plot_stress_remodeling(run)
plot_texture_organization(run)
plot_shape_vs_stress(run)
plot_feature_heatmap(run)
df <- as_grayleafspot_growth_data(run)
df
## # A tibble: 2 × 34
## id filename day area_mm2 radius_mm diameter_mm perimeter_mm circularity
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 demo-1 demo_day… 1 12 1.95 3.9 8 0.8
## 2 demo-2 demo_day… 2 18 2.39 4.78 9.1 0.77
## # ℹ 26 more variables: eccentricity <dbl>, edge_roughness <dbl>,
## # contrast <dbl>, correlation <dbl>, energy <dbl>, homogeneity <dbl>,
## # entropy <dbl>, center_edge_delta <dbl>, density_index <dbl>, core <dbl>,
## # middle <dbl>, outer <dbl>, crack_count <dbl>, crack_length_mm <dbl>,
## # crack_coverage_pct <dbl>, proportional_crack_coverage_pct <dbl>,
## # radial_velocity_mm_per_day <dbl>, area_growth_rate_mm2_per_day <dbl>,
## # relative_growth_rate_per_day <dbl>, radial_acceleration <dbl>, …
Point grayleafspot_run() at a folder of plate photographs. The pipeline
uses the basilisk-managed Python environment. The chunks below run
the real pipeline against the three bundled 06FEB test images
(inst/extdata/testdata/06FEB/) so this vignette demonstrates the full,
working code path rather than a snippet you can’t execute.
img_dir <- system.file("extdata", "testdata", "06FEB", package = "grayleafspotr")
out_dir <- file.path(tempdir(), "grayleafspotr-run-demo")
res <- grayleafspot_run(input_dir = img_dir, output_dir = out_dir, run_name = "demo")
# Per-image feature table
res$results
# Run manifest (paths, timestamp)
res$run
For plotting support, use grayleafspot_analyze() instead:
run_own <- grayleafspot_analyze(
input_dir = img_dir, output_dir = out_dir,
run_name = "demo-analyze", verbose = FALSE
)
plot_colony_expansion(run_own)
plot_grayleafspot_overlay() draws the detected dish boundary (yellow),
colony outline (red), and crack segments (cyan) on top of the original
image, using EBImage:
image_file <- list.files(img_dir, full.names = TRUE)[1]
plot_grayleafspot_overlay(run_own, image_path = image_file)
Outputs are written to a timestamped folder and can be reloaded later:
saved_dir <- run_own$run$output_dir
reloaded <- read_grayleafspot_results(saved_dir)
plot_colony_expansion(reloaded)
See the grayleafspotr Workflow vignette for:
vignette("grayleafspotr-workflow", package = "grayleafspotr")
sessionInfo()
## R version 4.6.1 (2026-06-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.5 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.24-bioc/R/lib/libRblas.so
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0 LAPACK version 3.12.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_GB LC_COLLATE=C
## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
##
## time zone: America/New_York
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] grayleafspotr_0.99.14 BiocStyle_2.41.0
##
## loaded via a namespace (and not attached):
## [1] sass_0.4.10 utf8_1.2.6 generics_0.1.4
## [4] lattice_0.23-1 hms_1.1.4 digest_0.6.39
## [7] magrittr_2.0.5 evaluate_1.0.5 grid_4.6.1
## [10] RColorBrewer_1.1-3 bookdown_0.48 fastmap_1.2.0
## [13] jsonlite_2.0.0 Matrix_1.7-6 tinytex_0.61
## [16] BiocManager_1.30.27 scales_1.4.0 jquerylib_0.1.4
## [19] cli_3.6.6 rlang_1.3.0 crayon_1.5.3
## [22] bit64_4.8.6 withr_3.0.3 cachem_1.1.0
## [25] yaml_2.3.12 otel_0.2.0 tools_4.6.1
## [28] dir.expiry_1.21.0 parallel_4.6.1 tzdb_0.5.0
## [31] dplyr_1.2.1 ggplot2_4.0.3 filelock_1.0.3
## [34] basilisk_1.25.0 reticulate_1.47.0 vctrs_0.7.3
## [37] R6_2.6.1 png_0.1-9 magick_2.9.1
## [40] lifecycle_1.0.5 bit_4.6.0 vroom_1.7.1
## [43] pkgconfig_2.0.3 pillar_1.11.1 bslib_0.12.0
## [46] gtable_0.3.6 glue_1.8.1 Rcpp_1.1.2
## [49] xfun_0.61 tibble_3.3.1 tidyselect_1.2.1
## [52] knitr_1.52 dichromat_2.0-1 farver_2.1.2
## [55] htmltools_0.5.9 labeling_0.4.3 rmarkdown_2.32
## [58] readr_2.2.0 compiler_4.6.1 S7_0.2.2