A library for working with phylogenetic and population genetic data.
v0.32.0
function/sample_set.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_PLACEMENT_FUNCTION_SAMPLE_SET_H_
2 #define GENESIS_PLACEMENT_FUNCTION_SAMPLE_SET_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2017 Lucas Czech
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lucas.czech@h-its.org>
23  Exelixis Lab, Heidelberg Institute for Theoretical Studies
24  Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
25 */
26 
37 
38 #include <iosfwd>
39 #include <string>
40 
41 namespace genesis {
42 namespace placement {
43 
44 // =================================================================================================
45 // Sample Set Functions
46 // =================================================================================================
47 
51 Sample * find_sample( SampleSet & sample_set, std::string const& name );
52 
56 Sample const* find_sample( SampleSet const& sample_set, std::string const& name );
57 
65 Sample merge_all( SampleSet const& sample_set );
66 
70 size_t total_pquery_count( SampleSet const& sample_set );
71 
72 // =================================================================================================
73 // Tree Functions
74 // =================================================================================================
75 
80 tree::Tree average_branch_length_tree( SampleSet const& sample_set );
81 
88 bool all_identical_trees( SampleSet const& sample_set );
89 
93 tree::TreeSet tree_set( SampleSet const& sample_set );
94 
104 void adjust_branch_lengths( SampleSet& sample_set, tree::Tree const& source );
105 
114 void adjust_to_average_branch_lengths( SampleSet& sample_set );
115 
116 // =================================================================================================
117 // Output
118 // =================================================================================================
119 
120 std::ostream& operator << ( std::ostream& out, SampleSet const& sample_set );
121 
122 } // namespace placement
123 } // namespace genesis
124 
125 #endif // include guard
genesis::placement::tree_set
tree::TreeSet tree_set(SampleSet const &sample_set)
Return a TreeSet containing all the trees of the SampleSet.
Definition: sample_set.cpp:156
tree_set.hpp
sample_set.hpp
genesis::placement::find_sample
Sample * find_sample(SampleSet &sample_set, std::string const &name)
Get the first Sample in a SampleSet that has a given name, or nullptr if not found.
Definition: sample_set.cpp:48
genesis
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Definition: placement/formats/edge_color.cpp:42
genesis::placement::merge_all
Sample merge_all(SampleSet const &sample_set)
Returns a Sample where all Samples of a SampleSet have been merged into.
Definition: sample_set.cpp:68
genesis::placement::average_branch_length_tree
tree::Tree average_branch_length_tree(SampleSet const &sample_set)
Return the Tree that has edges with the average branch length of the respective edges of the Trees in...
Definition: sample_set.cpp:120
genesis::placement::total_pquery_count
size_t total_pquery_count(SampleSet const &sample_set)
Return the total number of Pqueries in the Samples of the SampleSet.
Definition: sample_set.cpp:107
sample.hpp
genesis::placement::adjust_to_average_branch_lengths
void adjust_to_average_branch_lengths(SampleSet &sample_set)
Set the branch lengths of all Samples in the sample_set to the respecitve average branch length of th...
Definition: sample_set.cpp:172
genesis::placement::adjust_branch_lengths
void adjust_branch_lengths(Sample &sample, tree::Tree const &source)
Take the branch lengths of the source Tree and use them as the new branch lengths of the sample.
Definition: placement/function/functions.cpp:178
genesis::placement::all_identical_trees
bool all_identical_trees(SampleSet const &sample_set)
Returns true iff all Trees of the Samples in the set are identical.
Definition: sample_set.cpp:125
genesis::placement::operator<<
std::ostream & operator<<(std::ostream &out, Sample const &smp)
Print a table of all Pqueries with their Placements and Names to the stream.
Definition: placement/function/operators.cpp:238