tek2
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
tek::Haploid Class Reference

Haploid class. More...

#include <haploid.hpp>

Public Types

using param_type = HaploidParams
 Alias.
 
using URBG = wtl::sfmt19937_64
 random number generator class
 
using position_t = int32_t
 unsigned integer type for TE position
 

Public Member Functions

 Haploid ()=default
 default constructor
 
 Haploid (size_t)
 constructor for recombination test
 
 Haploid (const Haploid &)=default
 default copy constructor
 
 Haploid (Haploid &&other)=default
 default move constructor
 
Haploidoperator= (Haploid &&)=default
 default move assignment operator
 
Haploid gametogenesis (const Haploid &other, URBG &engine) const
 return a Haploid object after recombination
 
void transpose_mutate (Haploid &other, URBG &engine)
 mutation process within an individual
 
bool hyperactivate ()
 introduce a hyperactivating mutation
 
double fitness (const Haploid &) const
 evaluate and return fitness More...
 
std::vector< std::string > summarize () const
 return vector of Transposon summaries
 
std::ostream & write_fasta (std::ostream &) const
 write sequence with address as name
 
bool empty () const
 shortcut of sites_.empty()
 
auto begin () const
 shortcut of sites_.begin()
 
auto end () const
 shortcut of sites_.end()
 

Static Public Member Functions

static Haploid copy_founder ()
 return a Haploid with an ORIGINAL_TE_ on the same site
 
static void initialize (size_t popsize, double theta, double rho)
 set static member variables
 
static void insert_coefs_gp (size_t)
 testing function to check distribution of SELECTION_COEFS_GP_
 
static const std::unordered_map< position_t, double > & SELECTION_COEFS_GP ()
 getter of SELECTION_COEFS_GP_
 
static void param (const param_type &p)
 Set PARAM_.
 
static const param_typeparam ()
 Get PARAM_.
 

Private Member Functions

Haploidoperator= (const Haploid &)=default
 default copy assignment operator (private)
 
std::vector< std::shared_ptr< Transposon > > transpose (URBG &)
 return TEs to be transposed
 
void mutate (URBG &)
 make point mutation, indel, and speciation
 
double prod_1_zs () const
 calculate genome position component of fitness More...
 

Static Private Member Functions

static position_t SELECTION_COEFS_GP_emplace (URBG &)
 insert an element into SELECTION_COEFS_GP_ and return its key
 
static std::set< position_tsample_chiasmata (URBG &)
 sample integers for recombination
 

Private Attributes

std::map< position_t, std::shared_ptr< Transposon > > sites_
 position => shptr to transposon
 

Static Private Attributes

static param_type PARAM_
 Parameters shared among instances.
 
static constexpr double INDEL_RATIO_ = 0.2
 \(\phi\), relative rate of indels to point mutation
 
static constexpr double TAU_ = 1.5
 \(\tau\), constant for the intensity of copy number selection
 
static constexpr double PROP_FUNCTIONAL_SITES_ = 0.75
 \(p\), proportion of non-neutral sites
 
static double MUTATION_RATE_ = 0.0
 \(L\mu = L\theta / 4N\), mutation rate per TE
 
static double INDEL_RATE_ = 0.0
 \(L\phi\mu\), absolute indel rate per TE
 
static double RECOMBINATION_RATE_ = 0.0
 \(c = \rho / 4N\), recombination rate per genome
 
static std::unordered_map< position_t, double > SELECTION_COEFS_GP_
 \(s_{GP}\) : coefficient of GP selection
 
static std::shared_ptr< TransposonORIGINAL_TE_ = std::make_shared<Transposon>()
 original TE with no mutation and complete activity
 
static std::shared_timed_mutex MTX_
 readers-writer lock for SELECTION_COEFS_GP_
 

Friends

std::ostream & operator<< (std::ostream &, const Haploid &)
 write Haploid.sites_
 

Detailed Description

Haploid class.

Member Function Documentation

◆ fitness()

double tek::Haploid::fitness ( const Haploid other) const

evaluate and return fitness

\[\begin{split} w_k &= w_{GP,k} w_{CN,k} \\ w_{CN,k} &= \prod _{x \in F} \prod _{y \in F} \left(1 - I(d _{xy}) \xi n _{x,k} ^{\frac \tau 2} n _{y,k} ^{\frac \tau 2} \right) \\ \end{split}\]

◆ prod_1_zs()

double tek::Haploid::prod_1_zs ( ) const
private

calculate genome position component of fitness

\[ w_{k,GP} = \prod _j^T (1 - z_j s_{GP,j}) \]


The documentation for this class was generated from the following files: