237 return error(
"parameter \"files_genotyper_format\" is missing\n");
240 return error(
"parameter \"files_genotyper_logtime\" is missing\n");
244 vector<unsigned int> trait_index;
248 for(
unsigned int i = 0; i < traits.size(); i++) {
253 return error(
"Genotyper::cannot find trait \"%s\" among successfully initialized traits.\n", traits[i].c_str());
256 return error(
"Genotyper::cannot add the non-mappable trait \"%s\" to the joint genotype output file\n", traits[i].c_str());
258 trait_index.push_back(Tproto->
get_index());
265 if(format.find_last_of(
"s") == format.size()-1)
266 format = format.substr(0, format.size()-1);
268 if( format !=
"genotype" && format !=
"snp_genotype" && format !=
"snp_id")
269 return error(
"Genotyper::file format \"%s\" is not a valid option. Check the manual.\n", format.c_str());
274 for(
unsigned int i = 0; i < traits.size(); i++) {
280 if( !is2all && format.find(
"snp") != string::npos) {
281 return error(
"Genotyper:: not all traits have di-allelic loci as requested by the output format \"%s\"\n", format.c_str());
295 if(doTrimFixedLoci) {
298 warning(
"Genotyper::option \"files_genotyper_trim_maf\" is set but loci are not di-allelic. Not trimming.\n");
299 doTrimFixedLoci =
false;
302 if(format ==
"genotype") {
303 warning(
"Genotyper::option \"files_genotyper_trim_maf\" is set but data recorded is allele values (format option \"genotype\"). Not trimming.\n");
304 doTrimFixedLoci =
false;
310 warning(
"Genotyper::value %f for option \"files_genotyper_trim_maf\" cannot be used for trimming di-allelic loci.\n",trim_maf);
311 doTrimFixedLoci =
false;
334 if (format==
"genotype")
336 else if (format==
"snp_genotype")
338 else if (format==
"snp_id")
virtual void set(bool rpl_per, bool gen_per, int rpl_occ, int gen_occ, int rank, string path, LCE *event)
Definition: filehandler.h:276
void set_extension(const char *ext)
Definition: filehandler.h:149
virtual void set_multi(bool rpl_per, bool gen_per, int rpl_occ, TMatrix *Occ, string path)
Definition: filehandler.h:201
FileHandler to write joint genotype files for multiple mappable traits.
Definition: servicenotifiers.h:110
void set_trimFixedLoci(bool test, double maf)
Definition: servicenotifiers.h:138
void setTraits(vector< trait_t > &traits)
Definition: servicenotifiers.cc:385
void setFormat(string format)
Definition: servicenotifiers.h:132
void setTraitIndex(vector< unsigned int > &indices)
Definition: servicenotifiers.cc:392
void set_isDiallelic(bool test)
Definition: servicenotifiers.h:136
TraitPrototype * getTraitPrototype(trait_t type)
Accessor to a TraitPrototype.
Definition: indfactory.cc:140
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:81
This structure stores one parameter, its definition and its string argument.
Definition: param.h:54
double getValue()
Returns the argument value according to its type.
Definition: param.cc:368
bool isMatrix()
Checks if the argument is of matrix type.
Definition: param.h:172
string getArg()
Definition: param.h:138
void getMatrix(TMatrix *mat)
Sets the matrix from the argument string if the parameter is set and of matrix type.
Definition: param.cc:378
vector< string > getMultiArgs()
Definition: param.cc:120
bool isSet()
Definition: param.h:140
virtual double get_parameter_value(std::string name)
Param value getter.
Definition: simcomponent.h:143
virtual Param * get_parameter(std::string name)
Param getter.
Definition: simcomponent.h:139
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:50
TTrait setter.
Definition: ttrait.h:131
virtual int get_allele_number()=0
Returns the number of allele per locus.
virtual int get_index()
Index getter.
Definition: ttrait.h:152
virtual bool is_mappable()=0
Checks if the trait is mappable, i.e., if the loci can be placed on a genetic map.
int error(const char *str,...)
Definition: output.cc:79
void warning(const char *str,...)
Definition: output.cc:58