Skip to content

cjGO/ChewC

Repository files navigation

ChewC

In short, this will be a GPU-enabled stochastic simulation for breeding programs with an emphasis on cost-benefit-analysis for novel breeding tools and creating a suitable interface for RL agents.


We will also incorporate an emphasis on budget and costs associated with each action to manage long-term breeding budgets. As well as model theoretical tools in the plant breeder’s toolbox. e.g.

a treatment which increases crossover rates

a treatment which reduces flowering time

a treatment which enables gene drive at select loci

Each treatment will cost $$ ultimately helping guide the implementation in real-world breeding programs.

Install

pip install chewc

Phenotype Animation For Basic Truncation Selection

How to use

First, define the genome of your crop

ploidy = 2
n_chr = 10
n_loci = 1000
n_Ind = 100
g = Genome(ploidy, n_chr, n_loci)
population = Population()
population.create_random_founder_population(g, n_founders=n_Ind)
init_pop = population.get_dosages().float()  # gets allele dosage for calculating trait values

# multi_traits
target_means = torch.tensor([0, 5, 20])
target_vars = torch.tensor([1, 1, 0.5])  # Note: I'm assuming you want a variance of 1 for the second trait
correlation_matrix = [
        [1.0, 0.2, 0.58],
        [0.2, 1.0, -0.37],
        [0.58, -0.37, 1.0],
    ]
correlation_matrix = torch.tensor(correlation_matrix)
Created genetic map
random_crosses(g, population, n_crosses= 10, reps = 1).shape
torch.Size([10, 1, 2, 10, 1000])