|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_PLACEMENT_FORMATS_NEWICK_WRITER_H_
2 #define GENESIS_PLACEMENT_FORMATS_NEWICK_WRITER_H_
78 return enable_edge_nums_;
83 enable_edge_nums_ = value;
88 return enable_placement_counts_;
93 enable_placement_counts_ = value;
99 placement_counts_.resize( place_map.size(), 0 );
101 for(
size_t edge_i = 0; edge_i < place_map.size(); ++edge_i ) {
102 placement_counts_[ edge_i ] = place_map[ edge_i ].size();
112 if (enable_edge_nums_) {
117 if (enable_placement_counts_) {
138 bool enable_edge_nums_ =
true;
139 bool enable_placement_counts_ =
false;
141 std::vector<size_t> placement_counts_;
161 CommonTreeNewickWriterPlugin::register_with( *
this );
169 #endif // include guard
void register_with(tree::NewickWriter &writer) const
void edge_to_element(tree::TreeEdge const &edge, tree::NewickBrokerElement &element) const
void prepare_sample(Sample const &smp)
PlacementTreeNewickWriterPlugin()=default
std::vector< std::string > comments
Arbitrary strings that can be attached to a node, e.g. in Newick format via "[]".
PlacementTreeNewickWriterPlugin & operator=(PlacementTreeNewickWriterPlugin const &)=default
EdgeNumType edge_num() const
Return the edge_num of this edge. This value is defined by the jplace standard.
Write a Tree to Newick format.
Manage a set of Pqueries along with the PlacementTree where the PqueryPlacements are placed on.
size_t index() const
Return the index of this Edge.
std::string to_string(GenomeLocus const &locus)
Data class for PlacementTreeEdges. Stores the branch length of the edge, and the edge_num,...
void enable_placement_counts(bool value)
std::vector< edge_to_element_function > edge_to_element_plugins
Collect all functions to be called for each TreeEdge in order to translate it to a Newick representat...
std::vector< std::string > tags
Arbitrary strings that can be attached to a node, e.g. in Newick format via "{}".
virtual ~PlacementTreeNewickWriterPlugin()=default
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
bool enable_placement_counts() const
Provide a set of plugin functions for NewickWriter to write a CommonTree.
bool enable_edge_nums() const
std::vector< std::vector< PqueryPlacement const * > > placements_per_edge(Sample const &smp, bool only_max_lwr_placements)
Return a mapping from each PlacementTreeEdges to the PqueryPlacements that are placed on that edge.
Store the information for one element of a Newick tree.
PlacementTreeNewickWriter()
void enable_edge_nums(bool value)