30#ifndef TTRAIT_WITH_MAP_H
31#define TTRAIT_WITH_MAP_H
149 unsigned int addTrait (
trait_t trait,
unsigned int nChrm,
unsigned int nLoc,
unsigned int* nLocChrm,
150 double resolution,
unsigned int* locPositions);
242 static void recombine (
unsigned long indID);
244 virtual void reset ();
GeneticMap.
Definition: ttrait_with_map.h:46
void setLookupTable(unsigned int idx)
Bbuilds the lookup table for each trait.
Definition: ttrait_with_map.cc:933
void reset_tables()
Definition: ttrait_with_map.cc:1172
vector< unsigned int > _numLociPerTrait
Vector of number of loci for each trait.
Definition: ttrait_with_map.h:65
vector< unsigned int * > _lociLookupTable
A list of tables that map the map position (cM) to a locus, for each trait.
Definition: ttrait_with_map.h:61
unsigned int _nTrait
Number of traits registered in the map.
Definition: ttrait_with_map.h:56
unsigned int _recombLength
Definition: ttrait_with_map.h:88
double setResolution(double val)
Definition: ttrait_with_map.h:108
double _recombinationRate
Definition: ttrait_with_map.h:92
vector< unsigned int > _numChrsmPerTrait
Vector of number of chromosomes for each trait.
Definition: ttrait_with_map.h:63
vector< bool > _chrsmFirstRecombPosition[2]
Two vectors holding the starting copy of each chromosome to use when creating the two gametes that ar...
Definition: ttrait_with_map.h:79
vector< unsigned int > & getRecLoci(sex_t SEX, unsigned int trait)
Returns a vector of the loci where crossing-overs take place.
Definition: ttrait_with_map.h:157
double _totRecombEventsMean
Definition: ttrait_with_map.h:91
unsigned int addTrait(trait_t trait, unsigned int nChrm, unsigned int nLoc, unsigned int *nLocChrm, double resolution, unsigned int *locPositions)
Returns the table index for the registered trait.
Definition: ttrait_with_map.cc:655
unsigned int * _chrsmFirstLocusPosition
Definition: ttrait_with_map.h:86
void recombine(sex_t SEX)
Called by TTProtoWithMap::recombine twice to create the two gametes necessary for the creation of a n...
Definition: ttrait_with_map.cc:1048
unsigned int _totalLength
Definition: ttrait_with_map.h:87
vector< unsigned int * > _locPositionsPerTrait
Vector containing the table of map position for the loci of each trait.
Definition: ttrait_with_map.h:70
vector< vector< unsigned int > > _recPositions[2]
Vector of tables containing, for each trait, the locus number at which x-overs happen.
Definition: ttrait_with_map.h:75
unsigned int * _perChrsmLength
Definition: ttrait_with_map.h:85
vector< unsigned int * > _numLociPerChrsmPerTrait
Vector containing a table of number of loci per chromosome for each trait.
Definition: ttrait_with_map.h:67
bool getGeneticMap(trait_t trait, double **table, unsigned int table_length)
Definition: ttrait_with_map.cc:874
GeneticMap()
Definition: ttrait_with_map.h:97
~GeneticMap()
Definition: ttrait_with_map.h:102
unsigned int _numChromosome
Definition: ttrait_with_map.h:84
unsigned int _totalNumLoci
Definition: ttrait_with_map.h:89
double _resolution
Definition: ttrait_with_map.h:90
void unregisterTrait(trait_t trait)
Definition: ttrait_with_map.cc:623
void clear()
Definition: ttrait_with_map.cc:646
unsigned int * getLocusPositionTable(trait_t trait)
Definition: ttrait_with_map.h:166
unsigned long _currentIndividual
Definition: ttrait_with_map.h:50
double getResolution()
Definition: ttrait_with_map.h:106
vector< unsigned int > _junctions
A vector to store the position of the recombination events.
Definition: ttrait_with_map.h:82
map< trait_t, unsigned int > _traits
Table mapping trait type to its position index in the following tables.
Definition: ttrait_with_map.h:53
bool registerIndForRecombine(unsigned long ID)
Called by TTProtoWithMap::recombine with individual ID passed down from Individual::recombine.
Definition: ttrait_with_map.h:141
vector< bool > & getFirstRecPosition(sex_t SEX)
Returns the vector of the first chromosome position for recombination, used for all traits.
Definition: ttrait_with_map.h:163
void rescaleMap(double val)
Definition: ttrait_with_map.cc:904
TTProtoWithMap.
Definition: ttrait_with_map.h:176
double _mapResolution
Definition: ttrait_with_map.h:188
static GeneticMap _map
Definition: ttrait_with_map.h:201
bool setNumLociPerChromosome(string param_name)
Definition: ttrait_with_map.cc:297
void unregisterFromGeneticMap()
Definition: ttrait_with_map.cc:583
unsigned int * _lociMapPositions
Definition: ttrait_with_map.h:194
string _paramPrefix
Definition: ttrait_with_map.h:178
bool setRecombinationMapFixed()
Definition: ttrait_with_map.cc:388
void recordRandomMap()
Definition: ttrait_with_map.cc:532
bool areGeneticMapParamSet(string prefix)
Definition: ttrait_with_map.cc:88
unsigned int * _chrsmLength
Definition: ttrait_with_map.h:193
double _recombRate
Definition: ttrait_with_map.h:187
double * _recombRatePerChrmsm
Definition: ttrait_with_map.h:191
unsigned int _numLoci
Definition: ttrait_with_map.h:190
TTProtoWithMap()
Definition: ttrait_with_map.h:204
unsigned int getMapIndex()
Definition: ttrait_with_map.h:216
double _totRecombEventsMean
Definition: ttrait_with_map.h:186
unsigned int _numChromosome
Definition: ttrait_with_map.h:189
bool isRecombinationFree(string prefix)
Definition: ttrait_with_map.cc:98
virtual void reset()
Definition: ttrait_with_map.cc:611
bool _isRegistered
Definition: ttrait_with_map.h:180
unsigned int * _numLociPerChrmsm
Definition: ttrait_with_map.h:192
void reset_recombination_pointers()
Definition: ttrait_with_map.cc:601
void registerGeneticMap()
Definition: ttrait_with_map.cc:574
void addGeneticMapParameters(string prefix)
Definition: ttrait_with_map.cc:77
unsigned int _mapIndex
Definition: ttrait_with_map.h:185
void setMapIndex(unsigned int idx)
Definition: ttrait_with_map.h:214
bool setRecombinationMapNonRandom(vector< vector< double > > *lociPositions)
Definition: ttrait_with_map.cc:364
bool setGeneticMapParameters(string prefix)
Definition: ttrait_with_map.cc:125
virtual ~TTProtoWithMap()
Definition: ttrait_with_map.cc:70
static void recombine(unsigned long indID)
Definition: ttrait_with_map.cc:591
bool setRecombinationMapRandom()
Definition: ttrait_with_map.cc:437
TTraitWithMap.
Definition: ttrait_with_map.h:254
TTProtoWithMap * _myProto
Definition: ttrait_with_map.h:258
virtual ~TTraitWithMap()
Definition: ttrait_with_map.h:264
TTraitWithMap()
Definition: ttrait_with_map.h:262
Interface for all trait types, declares all basic trait operations.
Definition: ttrait.h:46
TTrait setter.
Definition: ttrait.h:125
std::string trait_t
Trait types.
Definition: types.h:63
sex_t
Sex types, males are always 0 and females 1!!
Definition: types.h:36