5 #ifndef BPP_PHYL_APP_PHYLOGENETICSAPPLICATIONTOOLS_H
6 #define BPP_PHYL_APP_PHYLOGENETICSAPPLICATIONTOOLS_H
8 #include "../Likelihood/ModelScenario.h"
9 #include "../Likelihood/PhyloLikelihoods/PhyloLikelihoodContainer.h"
10 #include "../Likelihood/PhyloLikelihoods/AlignedPhyloLikelihoodSet.h"
11 #include "../Likelihood/PhyloLikelihoods/SingleDataPhyloLikelihood.h"
12 #include "../Likelihood/SequenceEvolution.h"
13 #include "../Likelihood/AutonomousSubstitutionProcess.h"
14 #include "../Likelihood/SubstitutionProcessCollection.h"
15 #include "../Likelihood/SubstitutionProcessCollectionMember.h"
16 #include "../Mapping/SubstitutionCount.h"
17 #include "../Model/MarkovModulatedSubstitutionModel.h"
18 #include "../Model/SubstitutionModel.h"
19 #include "../Tree/PhyloTree.h"
20 #include "../Likelihood/DataFlow/DataFlow.h"
78 static std::unique_ptr<Tree>
getTree(
79 const std::map<std::string, std::string>& params,
80 const std::string& prefix =
"input.",
81 const std::string& suffix =
"",
82 bool suffixIsOptional =
true,
100 static std::vector<std::unique_ptr<Tree>>
getTrees(
101 const std::map<std::string, std::string>& params,
102 const std::string& prefix =
"input.",
103 const std::string& suffix =
"",
104 bool suffixIsOptional =
true,
127 static std::map<size_t, std::shared_ptr<PhyloTree>>
getPhyloTrees(
128 const std::map<std::string, std::string>& params,
129 const std::map<
size_t, std::shared_ptr<const AlignmentDataInterface>>& mSeq,
130 std::map<std::string, std::string>& unparsedParams,
131 const std::string& prefix =
"input.",
132 const std::string& suffix =
"",
133 bool suffixIsOptional =
true,
168 std::shared_ptr<const Alphabet> alphabet,
169 std::shared_ptr<const GeneticCode> gCode,
170 std::shared_ptr<const AlignmentDataInterface> data,
171 const std::map<std::string, std::string>& params,
172 std::map<std::string, std::string>& unparsedparams,
173 const std::string& suffix =
"",
174 bool suffixIsOptional =
true,
208 std::shared_ptr<const Alphabet> alphabet,
209 std::shared_ptr<const GeneticCode> gCode,
210 std::shared_ptr<const AlignmentDataInterface> data,
211 const std::map<std::string, std::string>& params,
212 std::map<std::string, std::string>& unparsedparams,
213 const std::string& suffix =
"",
214 bool suffixIsOptional =
true,
222 static std::map<size_t, std::unique_ptr<BranchModelInterface>>
getBranchModels(
223 std::shared_ptr<const Alphabet> alphabet,
224 std::shared_ptr<const GeneticCode> gCode,
225 const std::map<
size_t, std::shared_ptr<const AlignmentDataInterface>>& mData,
226 const std::map<std::string, std::string>& params,
227 std::map<std::string, std::string>& unparsedparams,
228 const std::string& suffix =
"",
229 bool suffixIsOptional =
true,
259 std::shared_ptr<const Alphabet> alphabet,
260 std::shared_ptr<const GeneticCode> gCode,
261 const std::map<
size_t, std::shared_ptr<const AlignmentDataInterface>>& mData,
263 const std::map<std::string, std::string>& params,
264 std::map<std::string, std::string>& sharedparams,
265 const std::vector<double>& rateFreqs,
266 const std::string& suffix =
"",
267 bool suffixIsOptional =
true,
272 std::shared_ptr<const Alphabet> alphabet,
273 std::shared_ptr<const GeneticCode> gCode,
274 std::shared_ptr<const AlignmentDataInterface> data,
275 const std::map<std::string, std::string>& params,
276 std::map<std::string, std::string>& sharedparams,
277 const std::vector<double>& rateFreqs,
278 const std::string& suffix =
"",
279 bool suffixIsOptional =
true,
283 std::map<size_t, std::shared_ptr<const AlignmentDataInterface>> mData;
286 return getRootFrequencySet(alphabet, gCode, mData, 1, params, sharedparams, rateFreqs, suffix, suffixIsOptional, verbose, warn);
293 std::shared_ptr<const Alphabet> alphabet,
294 std::shared_ptr<const GeneticCode> gCode,
295 const std::map<
size_t, std::shared_ptr<const AlignmentDataInterface>>& mData,
296 const std::map<std::string, std::string>& params,
297 std::map<std::string, std::string>& sharedparams,
298 const std::string& suffix =
"",
299 bool suffixIsOptional =
true,
326 std::shared_ptr<const Alphabet> alphabet,
327 std::shared_ptr<const GeneticCode> gCode,
328 const std::string& freqDescription,
329 std::shared_ptr<const AlignmentDataInterface> data,
330 std::map<std::string, std::string>& sharedParams,
331 const std::vector<double>& rateFreqs,
335 std::map<size_t, std::shared_ptr<const AlignmentDataInterface>> mData;
338 return getFrequencySet(alphabet, gCode, freqDescription, mData, 1, sharedParams, rateFreqs, verbose, warn);
365 std::shared_ptr<const Alphabet> alphabet,
366 std::shared_ptr<const GeneticCode> gCode,
367 const std::string& freqDescription,
368 const std::map<
size_t, std::shared_ptr<const AlignmentDataInterface>>& mData,
370 std::map<std::string, std::string>& sharedParams,
371 const std::vector<double>& rateFreqs,
395 static map<size_t, std::unique_ptr<ModelPath>>
getModelPaths(
396 const std::map<std::string, std::string>& params,
397 const map<
size_t, std::shared_ptr<BranchModelInterface>>& mModel,
398 const string& suffix =
"",
399 bool suffixIsOptional =
true,
421 const std::map<std::string, std::string>& params,
422 const map<
size_t, std::shared_ptr<ModelPath>>& mModelPath,
423 const map<
size_t, std::shared_ptr<BranchModelInterface>>& mModel,
424 const string& suffix =
"",
425 bool suffixIsOptional =
true,
444 const std::string& regTypeDesc,
445 std::shared_ptr<const StateMapInterface> stateMap,
446 std::shared_ptr<const GeneticCode> genCode,
447 std::shared_ptr<AlphabetIndex2>& weights,
448 std::shared_ptr<AlphabetIndex2>& distances,
449 bool verbose =
true);
478 std::shared_ptr<const Alphabet> alphabet,
479 std::shared_ptr<const GeneticCode> gCode,
480 std::shared_ptr<const AlignmentDataInterface> data,
481 const vector<std::shared_ptr<PhyloTree>>& vTree,
482 const std::map<std::string, std::string>& params,
483 const std::string& suffix =
"",
484 bool suffixIsOptional =
true,
511 std::shared_ptr<const Alphabet> alphabet,
512 std::shared_ptr<const GeneticCode> gCode,
513 const map<
size_t, std::shared_ptr<PhyloTree>>& mTree,
514 const map<
size_t, std::shared_ptr<BranchModelInterface>>& mMod,
515 const map<
size_t, std::shared_ptr<FrequencySetInterface>>& mRootFreq,
516 const map<
size_t, std::shared_ptr<DiscreteDistributionInterface>>& mDist,
517 const map<
size_t, std::shared_ptr<ModelScenario>>& mScen,
518 const std::map<std::string, std::string>& params,
519 map<string, string>& unparsedparams,
520 const string& suffix =
"",
521 bool suffixIsOptional =
true,
541 const std::map<std::string, std::string>& params,
551 std::shared_ptr<SubstitutionProcessCollection> SPC,
552 const std::map<std::string, std::string>& params,
553 map<string, string>& unparsedParams,
554 const string& suffix =
"",
555 bool suffixIsOptional =
true,
570 std::shared_ptr<SubstitutionProcessCollection> SPC,
571 std::map<
size_t, std::shared_ptr<SequenceEvolution>>& mSeqEvol,
572 const std::map<
size_t, std::shared_ptr<const AlignmentDataInterface>>& mData,
573 const std::map<std::string, std::string>& params,
574 const string& suffix =
"",
575 bool suffixIsOptional =
true,
594 const std::string& distDescription,
595 std::map<std::string, std::string>& unparsedParameterValues,
596 bool verbose =
true);
612 const std::map<std::string, std::string>& params,
613 const std::string& suffix =
"",
614 bool suffixIsOptional =
true,
615 bool verbose =
true);
623 const std::map<std::string, std::string>& params,
624 const string& suffix =
"",
625 bool suffixIsOptional =
true,
626 bool verbose =
true);
648 std::shared_ptr<PhyloLikelihoodInterface> lik,
649 const std::map<std::string, std::string>& params,
650 const std::string& suffix =
"",
651 bool suffixIsOptional =
true,
677 std::shared_ptr<const Alphabet> alphabet,
678 std::shared_ptr<const SubstitutionModelInterface> model,
679 const std::map<std::string, std::string>& params,
708 const std::map<std::string, std::string>& params,
709 const std::string& prefix =
"output.",
710 const std::string& suffix =
"",
711 bool suffixIsOptional =
true,
713 bool checkOnly =
false,
734 const std::vector<const PhyloTree*>& trees,
735 const std::map<std::string, std::string>& params,
736 const std::string& prefix =
"output.",
737 const std::string& suffix =
"",
738 bool suffixIsOptional =
true,
740 bool checkOnly =
false,
764 const std::map<std::string, std::string>& params,
765 const std::string& prefix =
"output.",
766 const std::string& suffix =
"",
767 bool suffixIsOptional =
true,
769 bool checkOnly =
false,
770 bool withIds =
false,
862 static std::map<size_t, std::shared_ptr<T>>
uniqueToSharedMap(std::map<
size_t, std::unique_ptr<T>>& mu)
864 std::map<size_t, std::shared_ptr<T>> ms;
867 std::shared_ptr<T> pt = std::move(it.second);
868 ms.emplace(it.first, pt);
Joint interface SetOf+Aligned PhylLikelihood.
Interface for all Branch models.
Context for dataflow node construction.
The PhyloLikelihoodContainer, owns and assigns numbers to Phylolikelihoods.
This interface describes the evolution process of a sequence.
The SingleDataPhyloLikelihood interface, for phylogenetic likelihood.
Collection of Substitution Process, which owns all the necessary objects: Substitution models,...
This interface describes the substitution process along the tree and sites of the alignment.
The phylogenetic tree class.
Defines the basic types of data flow nodes.