Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GenomicSelection

License: MIT

Forward-simulation breeding programs for genomic selection (GS) in soybean, investigating long-term genetic gain and genetic erosion under different GS models, selection strategies, and selection intensities.

Based on the paper: "Impact of genomic prediction model, selection intensity and breeding strategy on the long-term genetic gain and genetic erosion in soybean breeding."

Installation

# Install from local directory
devtools::install_local('.')

Usage

library(GenomicSelection)

# 1. Build default model presets (Random baseline included; external models added below)
models <- default_models()

# 2. Add external GS models (from bWGR or custom fitting functions)
#    models$GBLUP  <- function(y, gen, ...) bWGR::emML(y, gen, ...)
#    models$BayesA <- function(y, gen, ...) bWGR::emBA(y, gen, ...)

# 3. Configure simulation parameters
params <- list(
    Number_of_runs          = 2L,
    Number_of_generations   = 5L,
    Intensity               = c(0.025, 0.10),     # 2.5%, 10%
    FS                      = list('1' = c(30L, 20L)),
    POPBestIntensity        = 0.3,
    NCgs                    = 3L,
    nCores                  = 4L,                 # local parallel workers
    models                 = models
)

# 4. Run simulation
results <- run_simulation(params)
print(results)

# 5. Analyze results (from saved CSVs)
analyze_results(
    results_dir   = 'output/',
    generations   = c(2L, 3L, 5L),
    output_prefix = 'ALL'
)

Package Functions

Function Description
run_simulation(params) Run the forward-simulation breeding program
default_models() Return default model presets (Random baseline)
analyze_results() Read CSV outputs, compute metrics, generate plots

Simulation Parameters

Parameter Default Description
Number_of_runs 2 Replicated scenarios
Number_of_generations 5 Breeding cycles
Intensity c(0.025, 0.10) Selection intensity (proportion)
FS list('1'=c(30L, 20L)) F1 and F2 family sizes
POPBestIntensity 0.3 Pre-selected family proportion (WPSF)
NCgs 3L Breeding cycles in estimation set
Ne 106L Effective population size
segSites 1000L Segregating sites per chromosome
nInd 200L Founding individuals
nSnpPerChr 300L SNPs per chromosome
mean_ 60 Trait mean (SoyNAN yield)
var_ 77 Trait genetic variance
varGxE 77 GxE interaction variance
varEnv 200 Environmental variance
nCores NULL (auto) Local parallel workers (macOS, Linux without a PBS/Lambda cluster, and Windows). Defaults to 2 local workers, or 6 on Windows

Selection Strategies

  • AF (Across Family): Select best individuals across all families
  • WF (Within Family): Select best individuals within each family
  • WPSF (Within Pre-Selected Families): Pre-select top 30% best families, then select within those families

Model Fitting Functions

Model fitting functions are user-supplied. Each takes a phenotype vector y, genotype matrix gen, and optional args, returning list(hat = fitted_values).

Model Fitting Function Source
Random Built-in baseline (noise sample) Package default
GBLUP bWGR::emML(...) External (bWGR)
BayesA bWGR::emBA(...) External (bWGR)

Dependencies

  • AlphaSimR — Population simulation and breeding operations
  • bWGR — Genomic selection model fitting (external dependency)
  • ggplot2 — Visualization
  • plyr / reshape2 — Data reshaping
  • ScottKnott — Statistical clustering tests
  • verification — CRPS accuracy metrics

Acknowledgements

  • Eder Silva — Primary author
  • Alencar Xavier — Co-developer
  • Marcos Ventura Farias — Collaborator

About

Impact of genomic prediction model, selection intensity and breeding strategy on the long-term genetic gain and genetic erosion in soybean breeding

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages