Getting Started with grayleafspotr

What is grayleafspotr?

grayleafspotr automates the quantitative phenotyping of gray leaf spot (Cercospora zeae-maydis) fungal colonies grown on petri dishes. Given a folder of plate photographs, the package:

  • segments each colony with a bundled SmallUNet deep-learning model,
  • extracts area, shape, texture, and crack-coverage features for each image,
  • returns a tidy data frame ready for plotting and statistical analysis.

Python dependencies are handled automatically by basilisk — no manual setup is needed.


Quick start with bundled data

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()

View the feature table

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

Template plots

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)

Convert to a plain data frame

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>, …

Analyze your own images

Point grayleafspot_run() at a folder of plate photographs. The pipeline runs automatically — no Python configuration required.

res <- grayleafspot_run(
  input_dir  = "path/to/images",   # folder of JPEG/PNG/TIFF plate photos
  output_dir = "outputs",
  run_name   = "my_experiment"
)

# Per-image feature table
res$results

# Run manifest (paths, timestamp)
res$run

For plotting support, use grayleafspot_analyze() instead:

run <- grayleafspot_analyze(
  input_dir  = "path/to/images",
  output_dir = "outputs"
)
plot_colony_expansion(run)

Reload saved results

Outputs are written to a timestamped folder and can be reloaded later:

run <- read_grayleafspot_results("outputs/20260427T120000Z_localunet")
plot_colony_expansion(run)

Next steps

See the grayleafspotr Workflow vignette for:

  • a detailed description of all features extracted by the pipeline,
  • a complete gallery of template plots with biological interpretation,
  • guidance on image naming conventions and folder structure,
  • instructions for saving publication-quality figures.
vignette("grayleafspotr-workflow", package = "grayleafspotr")