TTNeutralGenes_bitstring : diallelic neutral loci encoded as bitstrings.
More...
#include <ttneutralgenes_bitstring.h>
TTNeutralGenes_bitstring : diallelic neutral loci encoded as bitstrings.
◆ TTNeutralGenes_bitstring() [1/2]
| TTNeutralGenes_bitstring::TTNeutralGenes_bitstring |
( |
| ) |
|
|
inline |
bitstring * _sequence
Definition: ttneutralgenes_bitstring.h:84
bool _free_recombination
Definition: ttneutralgenes_bitstring.h:85
TTNeutralGenes()
Definition: ttneutralgenes.h:63
Referenced by clone().
◆ TTNeutralGenes_bitstring() [2/2]
◆ ~TTNeutralGenes_bitstring()
| virtual TTNeutralGenes_bitstring::~TTNeutralGenes_bitstring |
( |
| ) |
|
|
inlinevirtual |
virtual void reset()
Definition: ttneutralgenes_bitstring.cc:85
References reset().
◆ clone()
◆ get_allele()
| unsigned int TTNeutralGenes_bitstring::get_allele |
( |
int |
loc, |
|
|
int |
all |
|
) |
| const |
|
virtual |
◆ get_allele_value()
| double TTNeutralGenes_bitstring::get_allele_value |
( |
int |
loc, |
|
|
int |
all |
|
) |
| const |
|
virtual |
◆ get_bit_sequence()
| const bitstring& TTNeutralGenes_bitstring::get_bit_sequence |
( |
bool |
chromosome | ) |
const |
|
inline |
◆ get_sequence()
| virtual void** TTNeutralGenes_bitstring::get_sequence |
( |
| ) |
const |
|
inlinevirtual |
Implements TTNeutralGenes.
61 error(
"calling TTNeutralGenes_bitstring::get_sequence()\n");
int error(const char *str,...)
Definition: output.cc:78
References error().
◆ inherit()
| void TTNeutralGenes_bitstring::inherit |
( |
const TTrait * |
mother, |
|
|
const TTrait * |
father |
|
) |
| |
|
virtual |
Implements TTNeutralGenes.
169 for (
size_t w = 0; w < nwords; w++) {
181 for (
size_t w = 0; w < nwords; w++) {
static unsigned long RandULong()
Return a random unsigned long, from uniform distribution.
Definition: Uniform.h:191
static bool RandBool()
Returns a random boolean.
Definition: Uniform.h:164
TTNeutralGenes_bitstring : diallelic neutral loci encoded as bitstrings.
Definition: ttneutralgenes_bitstring.h:39
const bitstring & get_bit_sequence(bool chromosome) const
Definition: ttneutralgenes_bitstring.h:51
void inherit_low(sex_t SEX, const TTNeutralGenes_bitstring *parent)
Definition: ttneutralgenes_bitstring.cc:201
Non-template and faster implementation of std::bitset.
Definition: bitstring.h:56
unsigned long _ul
Definition: bitstring.h:60
_ul * getword_atIdx(size_t index) const
Definition: bitstring.h:158
size_t nb_words() const
Definition: bitstring.h:163
@ FEM
Definition: types.h:36
@ MAL
Definition: types.h:36
References _sequence, FEM, get_bit_sequence(), bitstring::getword_atIdx(), MAL, bitstring::nb_words(), RAND::RandBool(), and RAND::RandULong().
◆ inherit_low()
203 vector< pair<unsigned int, unsigned int> > recTable =
206 unsigned int prevLoc = 0;
208 vector< pair<unsigned int, unsigned int> >::const_iterator xover = recTable.begin();
210 while(xover != recTable.end()) {
212 if(xover->first > prevLoc) {
217 prevLoc = xover->first;
vector< pair< unsigned int, unsigned int > > reduceJunctions(sex_t SEX, unsigned int trait_idx)
Remove multiple x-over at the same locus when traits differ in number of loci.
Definition: ttrait_with_map.cc:1209
TProtoNeutralGenes * _myProto
Definition: ttneutralgenes.h:58
static GeneticMap & getGeneticMapRef()
Definition: ttrait_with_map.h:235
unsigned int getMapIndex()
Definition: ttrait_with_map.h:233
void copy(const bitstring &b)
Unchecked copy, assumes we have sames sizes.
Definition: bitstring.h:360
References bitstring::copy(), get_bit_sequence(), TTProtoWithMap::getGeneticMapRef(), and GeneticMap::reduceJunctions().
◆ init()
| void TTNeutralGenes_bitstring::init |
( |
| ) |
|
|
virtual |
Implements TTNeutralGenes.
41 fatal(
"TTNeutralGenes_bitstring::init::_sequence is not NULL !\n");
unsigned int get_locus_num()
Definition: ttneutralgenes.h:199
double getRecombRate() const
Definition: ttrait_with_map.h:237
void reset(size_t length)
Definition: bitstring.h:139
void fatal(const char *str,...)
Definition: output.cc:99
References fatal(), and bitstring::reset().
◆ init_sequence()
| void TTNeutralGenes_bitstring::init_sequence |
( |
| ) |
|
|
virtual |
Implements TTNeutralGenes.
64 for(
unsigned int i = 0; i < nloc; ++i) {
unsigned int get_init_model()
Definition: ttneutralgenes.h:204
virtual void mutate()
Definition: ttneutralgenes_bitstring.cc:142
References RAND::RandBool(), and bitstring::reset().
◆ mutate()
| void TTNeutralGenes_bitstring::mutate |
( |
| ) |
|
|
virtual |
Implements TTNeutralGenes.
146 for( ; NbMut > 0; NbMut--) {
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:126
unsigned int get_num_mutations()
Definition: ttneutralgenes.h:203
void flip(size_t n)
Flip the bit at n.
Definition: bitstring.h:346
References RAND::RandBool(), and RAND::Uniform().
◆ operator=()
◆ reset()
| void TTNeutralGenes_bitstring::reset |
( |
| ) |
|
|
virtual |
◆ retrieve_data()
Implements TTNeutralGenes.
262 reader->
read(srce, bytes);
265 reader->
read(srce, bytes);
void read(void *out, unsigned int nb_bytes)
Definition: binarystoragebuffer.h:220
void set_data(_ul *srce, size_t nbwrd)
Copy bits from an array of unsigned long words.
Definition: bitstring.h:349
References BinaryStorageBuffer::read().
◆ set_allele_value()
| void TTNeutralGenes_bitstring::set_allele_value |
( |
unsigned int |
locus, |
|
|
unsigned int |
allele, |
|
|
double |
value |
|
) |
| |
|
virtual |
Implements TTNeutralGenes.
void set(size_t n)
Set a bit to 1.
Definition: bitstring.h:335
◆ set_sequence()
| void TTNeutralGenes_bitstring::set_sequence |
( |
void ** |
seq | ) |
|
|
virtual |
Implements TTNeutralGenes.
137 error(
"calling TTNeutralGenes_bitstring::set_sequence(void**), use set_allele_value() instead\n");
References error().
◆ show_up()
| void TTNeutralGenes_bitstring::show_up |
( |
| ) |
|
|
virtual |
Implements TTNeutralGenes.
227 unsigned int show = (nloc > 10 ? 10 : nloc);
229 message(
"\n Trait's type: ntrl (bitstring)\n\
234 for(
unsigned int i = 0; i < show; i++)
236 if(nloc > 10)
message(
"\n ...");
void message(const char *message,...)
Definition: output.cc:39
References message().
◆ store_data()
Implements TTNeutralGenes.
247 for(
size_t i = 0; i < wnb; i++)
250 for(
size_t i = 0; i < wnb; i++)
void store(void *stream, unsigned int nb_bytes)
Definition: binarystoragebuffer.cc:37
References BinaryStorageBuffer::store().
◆ _free_recombination
| bool TTNeutralGenes_bitstring::_free_recombination |
|
protected |
◆ _sequence
| bitstring* TTNeutralGenes_bitstring::_sequence |
|
protected |
The documentation for this class was generated from the following files: