|
Nemo
2.4.0b
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
|
FileHandler to write joint genotype files for multiple mappable traits. More...
#include <servicenotifiers.h>
Inheritance diagram for GenotyperFH:
Collaboration diagram for GenotyperFH:Public Member Functions | |
| GenotyperFH (LCE_FileServicesNotifier *event) | |
| virtual | ~GenotyperFH () |
| virtual void | FHwrite () |
| virtual void | FHread (string &filename) |
| void | setTraits (vector< trait_t > &traits) |
| void | setTraitIndex (vector< unsigned int > &indices) |
| void | setFormat (string format) |
| void | setLogtime (string logtime) |
| void | set_isDiallelic (bool test) |
| void | set_trimFixedLoci (bool test, double maf) |
| void | prepare_data_table (map< unsigned int, vector< unsigned int > > &trait_locus, vector< string > &col_names) |
| void | collate_trait_map_positions (vector< unsigned int > &positions, map< unsigned int, vector< unsigned int > > &table) |
| void | print_genotypes (ofstream &FH, map< unsigned int, vector< unsigned int > > &table) |
| void | print_snp_genotypes (ofstream &FH, map< unsigned int, vector< unsigned int > > &table) |
| void | print_snp_id (ofstream &FH, map< unsigned int, vector< unsigned int > > &table) |
| void | print_map_positions (ofstream &FH, vector< unsigned int > &positions, vector< string > &col_names) |
Public Member Functions inherited from EventFileHandler< LCE_FileServicesNotifier > | |
| EventFileHandler (LCE_FileServicesNotifier *event, const char *ext) | |
| virtual | ~EventFileHandler () |
| virtual void | FHread (string &filename)=0 |
| virtual void | set (bool rpl_per, bool gen_per, int rpl_occ, int gen_occ, int rank, string path, LCE_FileServicesNotifier *event) |
Public Member Functions inherited from FileHandler | |
| FileHandler (const char *ext) | |
| virtual | ~FileHandler () |
| virtual void | init () |
| Called by notifier during simulation setup, performs file checking. More... | |
| virtual vector< string > | ifExist () |
| Checks if any file associated with the current file name already exists on disk. More... | |
| virtual void | set (bool rpl_per, bool gen_per, int rpl_occ, int gen_occ, int rank, string path) |
| Sets the hanlder parameters. More... | |
| virtual void | set_multi (bool rpl_per, bool gen_per, int rpl_occ, TMatrix *Occ, string path) |
| virtual void | update () |
| Updates the inner replicate and generation counters and calls FHwrite if needed by the the periodicity of the file. More... | |
| Metapop * | get_pop_ptr () |
| Returns the pointer to the current metapop through the FileServices interface. More... | |
| void | set_pop_ptr (Metapop *pop_ptr) |
| FileServices * | get_service () |
| Returns pointer to the FileServices. More... | |
| void | set_service (FileServices *srv) |
| std::string & | get_path () |
| void | set_path () |
| std::string & | get_extension () |
| void | set_extension (const char *ext) |
| std::string & | get_filename () |
| Builds and returns the current file name depending on the periodicity of the file. More... | |
| bool | get_isInputHandler () |
| void | set_isInputHandler (bool val) |
| bool | get_isReplicatePeriodic () |
| void | set_isReplicatePeriodic (bool val) |
| unsigned int | get_ReplicateOccurrence () |
| void | set_ReplicateOccurrence (unsigned int val) |
| bool | get_isGenerationPeriodic () |
| void | set_isGenerationPeriodic (bool val) |
| unsigned int | get_GenerationOccurrence () |
| void | set_GenerationOccurrence (unsigned int val) |
| unsigned int | get_ExecRank () |
| unused yet... More... | |
| void | set_ExecRank (int val) |
| TMatrix * | get_OccMatrix () |
| void | set_OccMatrix (TMatrix *occ) |
| bool | get_isMasterExec () |
| void | set_isMasterExec (bool is) |
Public Member Functions inherited from Handler | |
| virtual | ~Handler () |
Private Attributes | |
| vector< trait_t > | _traits |
| vector< unsigned int > | _trait_index |
| string | _format |
| string | _logtime |
| bool | _is_diallelic |
| bool | _trim_loci |
| double | _trim_maf |
Additional Inherited Members | |
Protected Attributes inherited from EventFileHandler< LCE_FileServicesNotifier > | |
| LCE_FileServicesNotifier * | _FHLinkedEvent |
Protected Attributes inherited from FileHandler | |
| Metapop * | _pop |
| Pointer to the current metapop, set during initialization within the init function. More... | |
FileHandler to write joint genotype files for multiple mappable traits.
|
inline |
| void GenotyperFH::collate_trait_map_positions | ( | vector< unsigned int > & | positions, |
| map< unsigned int, vector< unsigned int > > & | table | ||
| ) |
References _traits, fatal(), TraitPrototype::get_index(), TraitPrototype::get_locus_map_positions(), SimRunner::get_pop(), IndFactory::getTraitPrototype(), and SIMenv::MainSim.
Referenced by FHwrite().
|
inlinevirtual |
Implements FileHandler.
|
virtual |
Implements EventFileHandler< LCE_FileServicesNotifier >.
References _format, FileHandler::_pop, collate_trait_map_positions(), fatal(), FileHandler::get_filename(), FileHandler::get_path(), FileServices::get_pop_ptr(), FileHandler::get_service(), FileServices::getGenerationReplicateFileName(), FileServices::getSampledPop(), Metapop::isAlive(), prepare_data_table(), print_genotypes(), print_snp_genotypes(), and print_snp_id().
| void GenotyperFH::prepare_data_table | ( | map< unsigned int, vector< unsigned int > > & | trait_locus, |
| vector< string > & | col_names | ||
| ) |
References _format, FileHandler::_pop, _traits, _trim_maf, ADLTx, fatal(), Patch::get(), TTrait::get_allele(), TraitPrototype::get_index(), TraitPrototype::get_locus_number(), SimRunner::get_pop(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getTrait(), IndFactory::getTraitPrototype(), SIMenv::MainSim, OFFSx, Metapop::size(), and Patch::size().
Referenced by FHwrite().
| void GenotyperFH::print_genotypes | ( | ofstream & | FH, |
| map< unsigned int, vector< unsigned int > > & | table | ||
| ) |
References FileHandler::_pop, _trait_index, ADLTx, FEM, Patch::get(), TTrait::get_allele_value(), Individual::getAge(), Individual::getID(), Patch::getID(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getSex(), Individual::getTrait(), MAL, OFFSx, and Patch::size().
Referenced by FHwrite().
| void GenotyperFH::print_map_positions | ( | ofstream & | FH, |
| vector< unsigned int > & | positions, | ||
| vector< string > & | col_names | ||
| ) |
| void GenotyperFH::print_snp_genotypes | ( | ofstream & | FH, |
| map< unsigned int, vector< unsigned int > > & | table | ||
| ) |
References FileHandler::_pop, _trait_index, ADLTx, FEM, Patch::get(), TTrait::get_allele(), Individual::getAge(), Individual::getID(), Patch::getID(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getSex(), Individual::getTrait(), MAL, OFFSx, and Patch::size().
Referenced by FHwrite().
| void GenotyperFH::print_snp_id | ( | ofstream & | FH, |
| map< unsigned int, vector< unsigned int > > & | table | ||
| ) |
References FileHandler::_pop, _trait_index, ADLTx, FEM, Patch::get(), TTrait::get_allele(), Individual::getAge(), Individual::getID(), Patch::getID(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getSex(), Individual::getTrait(), MAL, OFFSx, and Patch::size().
Referenced by FHwrite().
|
inline |
|
inline |
References _trim_loci, and _trim_maf.
Referenced by LCE_FileServicesNotifier::setGenotyperParameters().
|
inline |
|
inline |
References _logtime.
| void GenotyperFH::setTraitIndex | ( | vector< unsigned int > & | indices | ) |
References _trait_index.
Referenced by LCE_FileServicesNotifier::setGenotyperParameters().
| void GenotyperFH::setTraits | ( | vector< trait_t > & | traits | ) |
References _traits.
Referenced by LCE_FileServicesNotifier::setGenotyperParameters().
|
private |
Referenced by FHwrite(), prepare_data_table(), and setFormat().
|
private |
Referenced by set_isDiallelic().
|
private |
Referenced by setLogtime().
|
private |
Referenced by print_genotypes(), print_snp_genotypes(), print_snp_id(), and setTraitIndex().
|
private |
Referenced by collate_trait_map_positions(), prepare_data_table(), and setTraits().
|
private |
Referenced by set_trimFixedLoci().
|
private |
Referenced by prepare_data_table(), and set_trimFixedLoci().
1.9.1 -- Nemo is hosted on