Genetic Variability and Quantitative Inheritance Parameters Estimation Engine
estimate_variability.RdThe `estimate_variability` function calculates comprehensive biometric genetic profiles from replication-based agricultural trial datasets. It partitions phenotypic variance into Genotypic Variance (Vg), Phenotypic Variance (Vp), and Environmental Variance (Ve), and computes critical breeding metrics including Genotypic Coefficient of Variation (GCV), Phenotypic Coefficient of Variation (PCV), Broad-Sense Heritability (H2), Genetic Advance (GA), and Genetic Advance as
Arguments
- anova_results
A structured
listreturned by either theanova_rcbdoranova_crdanalysis pipelines within this package.- total_replications
An integer specifying the total number of replications/blocks used in the experimental trial layout.
- reporting_level
An integer flag defining console output details:
0for silent,1for summary parameter tables, and2for comprehensive descriptive logs. Defaults to2.
Value
A structured named list containing calculated genetic variability components:
- genotypic_variance
Estimated genotypic variance component (\(V_g\)).
- phenotypic_variance
Total phenotypic variance component (\(V_p\)).
- environmental_variance
Environmental variance/Error Mean Square (\(V_e\)).
- gcv
Genotypic Coefficient of Variation percentage (GCV%).
- pcv
Phenotypic Coefficient of Variation percentage (PCV%).
- heritability_percentage
Broad-Sense Heritability percentage (\(H^2 \%\)).
- genetic_advance
Expected Genetic Advance (GA) at 5% selection intensity (\(k = 2.06\)).
- gam_percentage
Genetic Advance as a percentage of the Grand Mean (GAM%).
Details
In quantitative genetics, phenotypic variance must be dissected into its components to determine the role of genetic factors versus environmental noise. This function extracts the Error Mean Square (EMS) and Genotypic Mean Square (GMS) directly from completed ANOVA matrices: $$V_g = \frac{GMS - EMS}{r}$$ $$V_p = V_g + EMS$$ $$H^2 = \frac{V_g}{V_p}$$ Where \(r\) represents the total absolute replication or block count.
If high environmental variations cause the computed Genotypic Variance to become negative,
the system automatically applies a mathematical lower boundary floor at 0.0001 to preserve
downstream pipeline integrity and issues a detailed structural warning message.
Examples
if (interactive()) {
# Execute complete genetic variability partitioning
rcbd_out <- anova_rcbd(data = gv_data, trait = "PH", reporting_level = 0)
var_metrics <- estimate_variability(anova_results = rcbd_out, total_replications = 3)
print(var_metrics$heritability_percentage)
}