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:85
bool _free_recombination
Definition: ttneutralgenes_bitstring.h:86
TTNeutralGenes()
Definition: ttneutralgenes.h:64
Referenced by clone().
◆ TTNeutralGenes_bitstring() [2/2]
◆ ~TTNeutralGenes_bitstring()
| virtual TTNeutralGenes_bitstring::~TTNeutralGenes_bitstring |
( |
| ) |
|
|
inlinevirtual |
virtual void reset()
Definition: ttneutralgenes_bitstring.cc:86
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.
62 error(
"calling TTNeutralGenes_bitstring::get_sequence()\n");
int error(const char *str,...)
Definition: output.cc:79
References error().
◆ inherit()
| void TTNeutralGenes_bitstring::inherit |
( |
const TTrait * |
mother, |
|
|
const TTrait * |
father |
|
) |
| |
|
virtual |
Implements TTNeutralGenes.
170 for (
size_t w = 0; w < nwords; w++) {
182 for (
size_t w = 0; w < nwords; w++) {
static unsigned long RandULong()
Return a random unsigned long, from uniform distribution.
Definition: Uniform.h:194
static bool RandBool()
Returns a random boolean.
Definition: Uniform.h:165
TTNeutralGenes_bitstring : diallelic neutral loci encoded as bitstrings.
Definition: ttneutralgenes_bitstring.h:40
const bitstring & get_bit_sequence(bool chromosome) const
Definition: ttneutralgenes_bitstring.h:52
void inherit_low(sex_t SEX, const TTNeutralGenes_bitstring *parent)
Definition: ttneutralgenes_bitstring.cc:202
Non-template and faster implementation of std::bitset.
Definition: bitstring.h:57
unsigned long _ul
Definition: bitstring.h:61
_ul * getword_atIdx(size_t index) const
Definition: bitstring.h:159
size_t nb_words() const
Definition: bitstring.h:164
@ FEM
Definition: types.h:37
@ MAL
Definition: types.h:37
References _sequence, FEM, get_bit_sequence(), bitstring::getword_atIdx(), MAL, bitstring::nb_words(), RAND::RandBool(), and RAND::RandULong().
◆ inherit_low()
204 vector< pair<unsigned int, unsigned int> > recTable =
207 unsigned int prevLoc = 0;
209 vector< pair<unsigned int, unsigned int> >::const_iterator xover = recTable.begin();
211 while(xover != recTable.end()) {
213 if(xover->first > prevLoc) {
218 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:1205
TProtoNeutralGenes * _myProto
Definition: ttneutralgenes.h:59
static GeneticMap & getGeneticMapRef()
Definition: ttrait_with_map.h:236
unsigned int getMapIndex()
Definition: ttrait_with_map.h:234
void copy(const bitstring &b)
Unchecked copy, assumes we have sames sizes.
Definition: bitstring.h:361
References bitstring::copy(), get_bit_sequence(), TTProtoWithMap::getGeneticMapRef(), and GeneticMap::reduceJunctions().
◆ init()
| void TTNeutralGenes_bitstring::init |
( |
| ) |
|
|
virtual |
Implements TTNeutralGenes.
42 fatal(
"TTNeutralGenes_bitstring::init::_sequence is not NULL !\n");
unsigned int get_locus_num()
Definition: ttneutralgenes.h:200
double getRecombRate() const
Definition: ttrait_with_map.h:238
void reset(size_t length)
Definition: bitstring.h:140
void fatal(const char *str,...)
Definition: output.cc:100
References fatal(), and bitstring::reset().
◆ init_sequence()
| void TTNeutralGenes_bitstring::init_sequence |
( |
| ) |
|
|
virtual |
Implements TTNeutralGenes.
65 for(
unsigned int i = 0; i < nloc; ++i) {
unsigned int get_init_model()
Definition: ttneutralgenes.h:205
virtual void mutate()
Definition: ttneutralgenes_bitstring.cc:143
References RAND::RandBool(), and bitstring::reset().
◆ mutate()
| void TTNeutralGenes_bitstring::mutate |
( |
| ) |
|
|
virtual |
Implements TTNeutralGenes.
147 for( ; NbMut > 0; NbMut--) {
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:127
unsigned int get_num_mutations()
Definition: ttneutralgenes.h:204
void flip(size_t n)
Flip the bit at n.
Definition: bitstring.h:347
References RAND::RandBool(), and RAND::Uniform().
◆ operator=()
◆ reset()
| void TTNeutralGenes_bitstring::reset |
( |
| ) |
|
|
virtual |
◆ retrieve_data()
Implements TTNeutralGenes.
263 reader->
read(srce, bytes);
266 reader->
read(srce, bytes);
void read(void *out, unsigned int nb_bytes)
Definition: binarystoragebuffer.h:162
void set_data(_ul *srce, size_t nbwrd)
Copy bits from an array of unsigned long words.
Definition: bitstring.h:350
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:336
◆ set_sequence()
| void TTNeutralGenes_bitstring::set_sequence |
( |
void ** |
seq | ) |
|
|
virtual |
Implements TTNeutralGenes.
138 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.
228 unsigned int show = (nloc > 10 ? 10 : nloc);
230 message(
"\n Trait's type: ntrl (bitstring)\n\
235 for(
unsigned int i = 0; i < show; i++)
237 if(nloc > 10)
message(
"\n ...");
void message(const char *message,...)
Definition: output.cc:40
References message().
◆ store_data()
Implements TTNeutralGenes.
248 for(
size_t i = 0; i < wnb; i++)
251 for(
size_t i = 0; i < wnb; i++)
void store(void *stream, unsigned int nb_bytes)
Definition: binarystoragebuffer.cc:16
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: