Skip to main content

Statistical Analysis and Simulations for Plant Breeding Experiments

Project description

License: MIT Python CI codecov PyPI version

dgNova (Designs Nova)

Logo

A Python library for Statistical Analysis and Simulations of Plant Breeding Experiments, designed specifically for researchers and students who are new to programming but want to understand field design concepts through practical implementation.

sample

Overview

dgNova ("Designs Nova") makes it easy to:

  • Simulate field experiments with realistic spatial patterns
  • Analyze unreplicated field trials using moving grid methods
  • Visualize spatial patterns and adjustments
  • Learn experimental design concepts through interactive simulations

Dependencies

dgNova is built using robust scientific Python libraries:

  • NumPy: For efficient numerical computations and array operations
  • Pandas: For data manipulation and analysis
  • Matplotlib: For creating static visualizations and plots
  • Seaborn: For enhanced statistical visualizations
  • Pillow: For image processing and animation support

These dependencies are automatically installed when you install dgNova using pip.

Current Status

The library is in active development. Currently implemented:

  • Moving Grid Design (fully functional)
  • Unreplicated Trial Analysis (UNREP class)

Future implementations will include:

  • RCBD (Randomized Complete Block Design)
  • Alpha-Lattice Design
  • Augmented Design
  • Split-Plot Design
  • Mating Design
  • Fieldbook Generation
  • Spatial Analysis

Installation

pip install dgNova

Quick Start: Moving Grid Analysis

Example 1: Using Real Data

from dgNova import UNREP

# Load and analyze real field data
unrep = UNREP(
    data='test_data/UNREP_Triticale_Unreplicated_Trial_Moving_Grids.csv',
    response='Yield',        # yield measurements
    row='Row',              # row positions
    column='Column',        # column positions
    genotype='Genotype',    # genotype labels
    plot='Plot',            # plot identifiers
    design='moving_grid'    # analysis method
)

# Run analysis
results = unrep.analyze()

Example 2: Simulation Study

# Simulate a field experiment
unrep_sim = UNREP(
    row=15,              # field dimensions
    column=20,
    heterogeneity=0.8,   # spatial trend intensity (0-1)
    mean=5.3,            # base yield level
    sd=0,                # random variation
    ne=1,                # neighbor effects (0-1)
    design='moving_grid'
)

# Analyze simulated data
unrep_sim.analyze()

Key Features of UNREP Class

Initialization Parameters

  • data: CSV file, DataFrame, or None (for simulation)
  • response: Name of response variable column
  • row, column: Field dimensions or column names
  • genotype: Genotype identifier column
  • plot: Plot identifier column
  • design: Analysis method (currently 'moving_grid')

Simulation Parameters

  • heterogeneity: Spatial trend intensity (0-1)
  • mean: Base response level
  • sd: Random variation
  • ne: Neighbor effects strength (0-1)

Analysis Methods

  1. analyze(): Performs moving grid analysis

    • Adjusts for spatial trends
    • Calculates efficiency metrics
    • Returns adjusted values and statistics
  2. Visualization Methods:

    # Plot spatial distribution
    unrep_sim.plot_spatial_analysis()
    
    # Animate adjustment process
    unrep_sim.animate(frames=100, interval=100)
    
    # Show detailed regions
    unrep_sim.plot_zoomed_regions()
    

Output Statistics

  • Mean response
  • Standard deviation
  • Regression coefficient
  • CV% (Adjusted)
  • Relative efficiency
  • Error variance
  • LSD (5%)

Example Output

Using the Triticale trial data:

unrep = UNREP(data='UNREP_Triticale_Unreplicated_Trial_Moving_Grids.csv')
results = unrep.analyze()

# Sample output:
# Mean: 3.89
# Std: 1.14
# CV% (Adjusted): 29.37
# Relative Efficiency: 1.07
# Error Variance: 1.3040
# LSD (5%): 2.49

Understanding Moving Grid Design

The moving grid method adjusts plot values based on local spatial patterns by:

  1. Analyzing neighboring plots
  2. Detecting systematic field trends
  3. Adjusting values to account for spatial variation
  4. Providing more accurate genotype estimates

Visualization Tools

  1. Spatial Analysis Plot:

    unrep.plot_spatial_analysis(use_adjusted=True)
    
    • Shows raw vs adjusted values
    • Highlights spatial patterns
    • Displays adjustment effects
  2. Animation of Adjustment Process:

    unrep.animate(frames=100, interval=100)
    
    • Visualizes gradual transformation
    • Helps understand adjustment mechanism

Contributing

dgNova is in active development. Contributions are welcome! Areas of focus:

  1. Additional design implementations
  2. Enhanced visualization options
  3. Documentation improvements
  4. Test cases and examples

License

MIT License

Contact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dgnova-1.2.12.tar.gz (47.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dgNova-1.2.12-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

Details for the file dgnova-1.2.12.tar.gz.

File metadata

  • Download URL: dgnova-1.2.12.tar.gz
  • Upload date:
  • Size: 47.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for dgnova-1.2.12.tar.gz
Algorithm Hash digest
SHA256 7e2c705c6e5fe2c669d9a52564348dcce9b5404c82e2128f6c72622732a7805e
MD5 a397eb1227f4bc834f5584112ec8bf47
BLAKE2b-256 f6ad7e07e179b2d6f6268cf27a7d6f35a83e7e320a5727b3570b4c446dfd17fe

See more details on using hashes here.

File details

Details for the file dgNova-1.2.12-py3-none-any.whl.

File metadata

  • Download URL: dgNova-1.2.12-py3-none-any.whl
  • Upload date:
  • Size: 55.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for dgNova-1.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 800bec8847dd7f8f7cd0e8fd565150278ceb3cfcc69b6bb41de0651f148b0ce7
MD5 d54678ce8d13b903f1cf2d215b06805c
BLAKE2b-256 e39ee7711eb01b6df88e4592e411df2b81a6d0438d0c7c2e598e51d6fb9768ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page