Observables
List of built-in observables. They take a Population
as the first and often only argument.
GrowthDynamics.Observables.allele_fractions
GrowthDynamics.Observables.allele_size
GrowthDynamics.Observables.allele_spectrum
GrowthDynamics.Observables.common_snps
GrowthDynamics.Observables.counts_on_shells
GrowthDynamics.Observables.explode_into_shells
GrowthDynamics.Observables.ipositions
GrowthDynamics.Observables.living_ancestor
GrowthDynamics.Observables.mean_pairwise
GrowthDynamics.Observables.mrca
GrowthDynamics.Observables.mrca
GrowthDynamics.Observables.npolymorphisms
GrowthDynamics.Observables.pairwise
GrowthDynamics.Observables.pairwise
GrowthDynamics.Observables.polymorphisms
GrowthDynamics.Observables.popsize_on_shells
GrowthDynamics.Observables.population_size
GrowthDynamics.Observables.positions
GrowthDynamics.Observables.sampled_allele_fractions
GrowthDynamics.Observables.tajimasd
GrowthDynamics.Observables.total_population_size
GrowthDynamics.Observables.allele_fractions
— FunctionDictionary of (SNP, freq)
.
GrowthDynamics.Observables.allele_size
— FunctionDictionary (SNP, population count)
GrowthDynamics.Observables.allele_spectrum
— Methodallele_spectrum(state;[ threshold=0.0, read_depth=total_population_size(state)])
Return a DataFrame with count, frequency of every polymorphism. Additionally sample from the population.
GrowthDynamics.Observables.common_snps
— Methodcommon_snps(::Population; filterdead=true)
List polymorphisms that are common to all genotypes.
Optional arguments:
filterdead=true
: exclude unpopulated genotypes?
GrowthDynamics.Observables.counts_on_shells
— Methodcounts_on_shells(state, g, [o, a])
Return a dictionary i=>count
mapping the ith
shell to the number of cells of genotype g
on it.
The "shell number" of a point is the integer closest to |p-o|/a
.
Keyword arguments
o=midpointcoord(state.lattice)
: center of shellsa=spacing(state.lattice)
: spacing of shells
GrowthDynamics.Observables.explode_into_shells
— Methodexplode_into_shells(v, o, a; r0=)
Take a vector of cartesian coordinates v
, center them around the midpoint o
, and return a dictionary radius=>coordinates
where r0<= radius <= max(||v||)
in increments of a
.
GrowthDynamics.Observables.ipositions
— Methodipositions(state, g)
Returns lattice indices of cells of genotype g
.
GrowthDynamics.Observables.living_ancestor
— MethodEarliest living ancestor.
GrowthDynamics.Observables.mean_pairwise
— MethodDiversity (mean pairwise difference of mutations) of a population.
GrowthDynamics.Observables.mrca
— MethodReturn index of the most recent common ancestor between (i,j)
in a phylogeny.
GrowthDynamics.Observables.mrca
— MethodReturn index of the most recent common ancestor in a phylogeny.
GrowthDynamics.Observables.npolymorphisms
— Methodnpolymorphisms(S::Population)
Number of polymrphisms
GrowthDynamics.Observables.pairwise
— Methodpairwise(S::Population, i, j)
Number of pairwise genomic differences between genotype indices i,j
.
GrowthDynamics.Observables.pairwise
— Methodpairwise(S::Population)
Matrix of pairwise differences. filterdead
: Do not include extinct genotypes.
GrowthDynamics.Observables.polymorphisms
— Methodpolymorphisms(S::Population)
Vector of polymorphisms (segregating sites).
GrowthDynamics.Observables.popsize_on_shells
— Methodpopsize_on_shells(T, outer, [o=midpoint(T.lattice)])
Creates a dictionary genotype => trajectory
where trajectory
is a vector of population size. trajectory[r]
is the the population size on a L2-norm shell of radius r
around o
.
r
ranges between 1..outer
in increments of a
(defaults to the lattice spacing).
Set deleteone/zero=false
to keep the wildtype/count empty sites.
GrowthDynamics.Observables.population_size
— MethodDictionary (genotype, population size)
GrowthDynamics.Observables.positions
— Methodpositions(state, g)
Returns coordinates of cells of genotype g
.
GrowthDynamics.Observables.sampled_allele_fractions
— Functionsampled_allele_fractions(S::Population[, t=0, samples=length(S.meta.npops)])
Randomly sample genotypes(!) and calculate frequencies of contained SNPs. Return a dictionary (SNP, freq)
.
GrowthDynamics.Observables.tajimasd
— MethodSee https://en.wikipedia.org/wiki/Tajima%27s_D
GrowthDynamics.Observables.total_population_size
— MethodTotal population size. Duh.