drift: Drift of positive allele calculation

View source: R/utlis.R

driftR Documentation

Drift of positive allele calculation

Description

This function takes a population and the simulation parameters from a .Pop class and calculates the current frequencies of the positive alleles for each trait.

Usage

drift(pop, simParam, solution=NULL, traits=1)

Arguments

pop

an object of class "Pop"

simParam

the simulation parameters stored in the evolaMod object.

solution

an alternative RRBLUP solution so the frequencies of positive alleles are calculated for a given SNP chip. If NULL the frequencies are calculated for the real QTLs.

traits

traits considered.

Details

A simple apply function to get all the QTLs, segregation sites, positive alleles and frecuency of the positive allele for each trait in a population.

Value

$res

a matrix

References

Giovanny Covarrubias-Pazaran (2024). evola: a simple evolutionary algorithm for complex problems. To be submitted to Bioinformatics.

See Also

evolafit – the core function of the package

Examples



#Create founder haplotypes
founderPop = quickHaplo(nInd=10, nChr=1, segSites=30)

#Set simulation parameters
SP = SimParam$new(founderPop)

SP$addTraitA(10)
SP$setVarE(h2=0.5)
SP$addSnpChip(15)

#Create population
pop = newPop(founderPop, simParam=SP)

# drift for QTLs
drift(pop, simParam = SP ) 

ans = RRBLUP(pop, simParam=SP)

# drift for average allelic effects
drift(pop, simParam = SP, solution = ans)


evola documentation built on Aug. 8, 2025, 7:54 p.m.