6327 Patch* current_patch;
6335 unsigned int BIT = _isAsymmetrical;
6336 unsigned int loc, rec;
6354 for(
int i = 0; i < patchNbr; i++)
6355 for(
unsigned int k = 0; k < nb_trait; k++) {
6360 REC<<i+1<<
" "<<k+1<<
" "<<LOCUS+1<<
" "<<snp_allele.
get( LOCUS, BIT );
6380 message(
"TTQFreqExtractor::compute allele frequencies\n");
6385 vector<double> snp_tab(seqLength, 0.0);
6388 for(
int i = 0; i < patchNbr; i++) {
6392 snp_tab.
assign(seqLength, 0.0);
6395 for(
unsigned int s = 0; s < 2; ++s) {
6397 for(
unsigned int j = 0, size = current_patch->
size(
sex_t(s),
ADLTx); j < size; ++j) {
6404 for(
unsigned int i = 0; i < seqLength; ++i) {
6411 double inv2N = 1.0 / double(2*current_patch->
size(
ADLTx));
6414 for(
unsigned int k = 0; k < nb_trait; k++) {
6436 std::ofstream FILE ;
6439 FILE.open(filename.c_str(), ios::out);
6440 std::ios_base::sync_with_stdio(
false);
6443 message(
"TTQFreqExtractor::FHwrite (%s)\n",filename.c_str());
6446 if(!FILE)
fatal(
"Trait quanti could not open output file: \"%s\"\n",filename.c_str());
6448 for(
unsigned int i = 0; i <
_records.size(); ++i)
6453 std::ios_base::sync_with_stdio(
true);
std::string & get_path()
Definition: filehandler.h:141
FileServices * get_service()
Returns pointer to the FileServices.
Definition: filehandler.h:137
std::string & get_extension()
Definition: filehandler.h:145
string & getReplicateFileName()
Accessor to the current replicate file name.
Definition: fileservices.cc:456
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:47
TTrait * getTrait(IDX T)
Trait accessor.
Definition: individual.h:275
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:430
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:496
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:532
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:559
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:48
double get(unsigned int i, unsigned int j) const
Accessor to element at row i and column j.
Definition: tmatrix.h:191
const TMatrix & get_diallele_values()
Definition: ttquanti.h:433
unsigned int get_locus_ID(unsigned int locus, unsigned int trait)
Definition: ttquanti.h:453
unsigned int get_allele_model()
Definition: ttquanti.h:432
unsigned int get_locus_seq_pos(unsigned int loc, unsigned int trait)
Definition: ttquanti.h:451
unsigned int get_num_locus()
Definition: ttquanti.h:422
unsigned int get_seq_length()
Definition: ttquanti.h:425
unsigned int get_num_traits()
Definition: ttquanti.h:421
TTQuanti.
Definition: ttquanti.h:59
virtual bool get_allele_bit(unsigned int position, unsigned int allele) const =0
int _FHLinkedTraitIndex
Definition: filehandler.h:222
TProtoQuanti * _FHLinkedTrait
Definition: filehandler.h:221
static string int2str(const int i)
Writes an integer value into a string.
Definition: tstring.h:93
static string dble2str(const double d)
Writes a floating-point value into a string.
Definition: tstring.h:113
void fatal(const char *str,...)
Definition: output.cc:98
void message(const char *message,...)
Definition: output.cc:38
sex_t
Sex types, males are always 0 and females 1!!
Definition: types.h:34
@ ADLTx
Definition: types.h:40