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,
325 std::shared_ptr<const Alphabet> alphabet,
326 std::shared_ptr<const GeneticCode> gCode,
327 const std::string& freqDescription,
328 std::shared_ptr<const AlignmentDataInterface> data,
329 std::map<std::string, std::string>& sharedParams,
330 const std::vector<double>& rateFreqs,
334 std::map<size_t, std::shared_ptr<const AlignmentDataInterface>> mData;
337 return getFrequencySet(alphabet, gCode, freqDescription, mData, 1, sharedParams, rateFreqs, verbose, warn);
364 std::shared_ptr<const Alphabet> alphabet,
365 std::shared_ptr<const GeneticCode> gCode,
366 const std::string& freqDescription,
367 const std::map<
size_t, std::shared_ptr<const AlignmentDataInterface>>& mData,
369 std::map<std::string, std::string>& sharedParams,
370 const std::vector<double>& rateFreqs,
394 static map<size_t, std::unique_ptr<ModelPath>>
getModelPaths(
395 const std::map<std::string, std::string>& params,
396 const map<
size_t, std::shared_ptr<BranchModelInterface>>& mModel,
397 const string& suffix =
"",
398 bool suffixIsOptional =
true,
420 const std::map<std::string, std::string>& params,
421 const map<
size_t, std::shared_ptr<ModelPath>>& mModelPath,
422 const map<
size_t, std::shared_ptr<BranchModelInterface>>& mModel,
423 const string& suffix =
"",
424 bool suffixIsOptional =
true,
443 const std::string& regTypeDesc,
444 std::shared_ptr<const StateMapInterface> stateMap,
445 std::shared_ptr<const GeneticCode> genCode,
446 std::shared_ptr<AlphabetIndex2>& weights,
447 std::shared_ptr<AlphabetIndex2>& distances,
448 bool verbose =
true);
477 std::shared_ptr<const Alphabet> alphabet,
478 std::shared_ptr<const GeneticCode> gCode,
479 std::shared_ptr<const AlignmentDataInterface> data,
480 const vector<std::shared_ptr<PhyloTree>>& vTree,
481 const std::map<std::string, std::string>& params,
482 const std::string& suffix =
"",
483 bool suffixIsOptional =
true,
510 std::shared_ptr<const Alphabet> alphabet,
511 std::shared_ptr<const GeneticCode> gCode,
512 const map<
size_t, std::shared_ptr<PhyloTree>>& mTree,
513 const map<
size_t, std::shared_ptr<BranchModelInterface>>& mMod,
514 const map<
size_t, std::shared_ptr<FrequencySetInterface>>& mRootFreq,
515 const map<
size_t, std::shared_ptr<DiscreteDistributionInterface>>& mDist,
516 const map<
size_t, std::shared_ptr<ModelScenario>>& mScen,
517 const std::map<std::string, std::string>& params,
518 map<string, string>& unparsedparams,
519 const string& suffix =
"",
520 bool suffixIsOptional =
true,
540 const std::map<std::string, std::string>& params,
550 std::shared_ptr<SubstitutionProcessCollection> SPC,
551 const std::map<std::string, std::string>& params,
552 map<string, string>& unparsedParams,
553 const string& suffix =
"",
554 bool suffixIsOptional =
true,
569 std::shared_ptr<SubstitutionProcessCollection> SPC,
570 std::map<
size_t, std::shared_ptr<SequenceEvolution>>& mSeqEvol,
571 const std::map<
size_t, std::shared_ptr<const AlignmentDataInterface>>& mData,
572 const std::map<std::string, std::string>& params,
573 const string& suffix =
"",
574 bool suffixIsOptional =
true,
593 const std::string& distDescription,
594 std::map<std::string, std::string>& unparsedParameterValues,
595 bool verbose =
true);
611 const std::map<std::string, std::string>& params,
612 const std::string& suffix =
"",
613 bool suffixIsOptional =
true,
614 bool verbose =
true);
622 const std::map<std::string, std::string>& params,
623 const string& suffix =
"",
624 bool suffixIsOptional =
true,
625 bool verbose =
true);
647 std::shared_ptr<PhyloLikelihoodInterface> lik,
648 const std::map<std::string, std::string>& params,
649 const std::string& suffix =
"",
650 bool suffixIsOptional =
true,
676 std::shared_ptr<const Alphabet> alphabet,
677 std::shared_ptr<const SubstitutionModelInterface> model,
678 const std::map<std::string, std::string>& params,
707 const std::map<std::string, std::string>& params,
708 const std::string& prefix =
"output.",
709 const std::string& suffix =
"",
710 bool suffixIsOptional =
true,
712 bool checkOnly =
false,
733 const std::vector<const PhyloTree*>& trees,
734 const std::map<std::string, std::string>& params,
735 const std::string& prefix =
"output.",
736 const std::string& suffix =
"",
737 bool suffixIsOptional =
true,
739 bool checkOnly =
false,
763 const std::map<std::string, std::string>& params,
764 const std::string& prefix =
"output.",
765 const std::string& suffix =
"",
766 bool suffixIsOptional =
true,
768 bool checkOnly =
false,
769 bool withIds =
false,
861 static std::map<size_t, std::shared_ptr<T>>
uniqueToSharedMap(std::map<
size_t, std::unique_ptr<T>>& mu)
863 std::map<size_t, std::shared_ptr<T>> ms;
866 std::shared_ptr<T> pt = std::move(it.second);
867 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.