6572 Patch* current_patch;
6580 unsigned int BIT = _isAsymmetrical;
6581 unsigned int loc, rec;
6599 for(
int i = 0; i < patchNbr; i++)
6600 for(
unsigned int k = 0; k < nb_trait; k++) {
6605 REC<<i+1<<
" "<<k+1<<
" "<<LOCUS+1<<
" "<<snp_allele.
get( LOCUS, BIT );
6625 message(
"TTQFreqExtractor::compute allele frequencies\n");
6630 vector<double> snp_tab(seqLength, 0.0);
6633 for(
int i = 0; i < patchNbr; i++) {
6637 snp_tab.
assign(seqLength, 0.0);
6640 for(
unsigned int s = 0; s < 2; ++s) {
6642 for(
unsigned int j = 0, size = current_patch->
size(
sex_t(s),
ADLTx); j < size; ++j) {
6649 for(
unsigned int i = 0; i < seqLength; ++i) {
6656 double inv2N = 1.0 / double(2*current_patch->
size(
ADLTx));
6659 for(
unsigned int k = 0; k < nb_trait; k++) {
6681 std::ofstream FILE ;
6684 FILE.open(filename.c_str(), ios::out);
6687 message(
"TTQFreqExtractor::FHwrite (%s)\n",filename.c_str());
6690 if(!FILE)
fatal(
"Trait quanti could not open output file: \"%s\"\n",filename.c_str());
6692 for(
unsigned int i = 0; i <
_records.size(); ++i)
std::string & get_path()
Definition: filehandler.h:139
FileServices * get_service()
Returns pointer to the FileServices.
Definition: filehandler.h:135
std::string & get_extension()
Definition: filehandler.h:143
string & getReplicateFileName()
Accessor to the current replicate file name.
Definition: fileservices.cc:429
virtual Metapop * get_pop_ptr()
Accessor to the pointer to the main population.
Definition: fileservices.h:111
This class contains traits along with other individual information (sex, pedigree,...
Definition: individual.h:49
TTrait * getTrait(IDX T)
Trait accessor.
Definition: individual.h:277
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:432
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:498
Individual * get(sex_t SEX, age_idx AGE, unsigned int at)
Returns a pointer to the individual sitting at the index passed.
Definition: metapop.h:534
void assign(sex_t SEX, age_idx AGE, size_t n)
Assigns a new container of given size for the sex and age class passed, sets all values to NULL.
Definition: metapop.h:561
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:50
double get(unsigned int i, unsigned int j) const
Accessor to element at row i and column j.
Definition: tmatrix.h:193
const TMatrix & get_diallele_values()
Definition: ttquanti.h:429
unsigned int get_locus_ID(unsigned int locus, unsigned int trait)
Definition: ttquanti.h:442
unsigned int get_allele_model()
Definition: ttquanti.h:428
unsigned int get_locus_seq_pos(unsigned int loc, unsigned int trait)
Definition: ttquanti.h:440
unsigned int get_num_locus()
Definition: ttquanti.h:418
unsigned int get_seq_length()
Definition: ttquanti.h:421
unsigned int get_num_traits()
Definition: ttquanti.h:417
TTQuanti.
Definition: ttquanti.h:59
virtual bool get_allele_bit(unsigned int position, unsigned int allele) const =0
int _FHLinkedTraitIndex
Definition: filehandler.h:220
TProtoQuanti * _FHLinkedTrait
Definition: filehandler.h:219
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:95
static string dble2str(const double d)
Writes a floating-point value into a string.
Definition: tstring.h:115
void fatal(const char *str,...)
Definition: output.cc:96
void message(const char *message,...)
Definition: output.cc:40
sex_t
Sex types, males are always 0 and females 1!!
Definition: types.h:36
@ ADLTx
Definition: types.h:42