(
const string&
id,
unsigned intidx)
380vector<float>& distances,
393idx = (*m_Tree)[idx].GetParent();
401 void GetLongest(vector<TTreeIdx>& path,
float& length);
449 constvector<float>& distances,
482 constvector<pair<string,string> >& label_ranges,
532 if(node.GetChildren().size() == 1 && node.GetParent() !=
TNodeType::Null()) {
533 TTreeIdxchild_idx = node.GetChildren()[0];
548,
m_Dist((float)x_dist) {}
554((*node).GetDistance() >
m_Dist);
570 return((*node).IDX().first <=
m_Depth);
582 template<
classTPhyloTree>
584 constvector<CPhyloTree::TID>& node_ids,
589 typedefpair<TTreeIdx, float> TNodeDist;
593vector<TNodeDist> node_distances;
597 for(
size_t i= 0;
i< node_ids.size(); ++
i) {
598 TTreeIdxnode_idx = phylo_tree.FindNodeById(node_ids[
i]);
600node_distances.push_back(TNodeDist(node_idx, 0.0f));
602visited_nodes.
insert(node_idx);
608 if(!phylo_tree.GetFeatureDict().HasFeature(
"dist") || d <= 0.0f)
611 while(node_distances.size() > 0) {
612vector<TNodeDist> prev_node_distances = node_distances;
614node_distances.clear();
619 for(
size_t i= 0;
i< prev_node_distances.size(); ++
i) {
620TNodeType&
n= phylo_tree.GetNode(prev_node_distances[
i].
first);
621 floataccumulated_dist = prev_node_distances[
i].second;
623 if(
n.HasParent()) {
625 floatparent_dist =
n.GetValue().GetDistance();
626 if(accumulated_dist + parent_dist <= d && visited_nodes.
find(parent_idx) == visited_nodes.
end()) {
627node_distances.push_back(TNodeDist(parent_idx, accumulated_dist + parent_dist));
632TNodeType::TNodeList_I child_iter =
n.GetChildren().begin();
633 for(; child_iter !=
n.GetChildren().end(); ++child_iter) {
635 floatchild_dist = phylo_tree.GetNode(child_idx).GetValue().GetDistance();
636 if(accumulated_dist + child_dist <= d && visited_nodes.
find(child_idx) == visited_nodes.
end()) {
637node_distances.push_back(TNodeDist(child_idx, accumulated_dist + child_dist));
642visited_nodes.
insert(prev_node_distances[
i].
first);
656 template<
classTBioTreeContainer,
classTPhyloTree>
658 constTBioTreeContainer& tree_container,
660 boolpreserve_node_ids =
true,
661 boolexpand_all =
false)
669 typedef typenameTBioTreeContainer::TFdict TContainerDict;
672 constTContainerDict& fd = tree_container.GetFdict();
673 const typenameTContainerDict::Tdata& feat_list = fd.Get();
677 ITERATE(
typenameTContainerDict::Tdata, it, feat_list) {
679 const string& fvalue = (*it)->GetName();
680 if(fvalue ==
"$NODE_COLLAPSED")
681expand_collapse_id = fid;
696 typedef typenameTBioTreeContainer::TNodes TCNodeSet;
697 typedef typenameTCNodeSet::Tdata TNodeList;
698 typedef typenameTNodeList::value_type::element_type TCNode;
700 constTNodeList node_list = tree_container.GetNodes().Get();
702std::map<TBioTreeNodeId, typename TPhyloTree::TTreeIdx> pmap;
704phylo_tree.Reserve(node_list.size());
706 ITERATE(
typenameTNodeList, it, node_list) {
711 typedef typenameTPhyloTree::TNodeType TNodeType;
712 typedef typenameTNodeType::TValueType TNodeValueType;
715 if(preserve_node_ids) {
719 typedef typenameTCNode::TFeatures TCNodeFeatureSet;
721 if(cnode->CanGetFeatures()) {
722 constTCNodeFeatureSet& fset = cnode->GetFeatures();
724 const typenameTCNodeFeatureSet::Tdata& flist = fset.Get();
726 ITERATE(
typenameTCNodeFeatureSet::Tdata, fit, flist) {
727 unsigned intfid = (*fit)->GetFeatureid();
728 const string& fvalue = (*fit)->GetValue();
734 if(expand_all && fid == expand_collapse_id) {
735v.GetBioTreeFeatureList().SetFeature(fid,
"0");
739v.GetBioTreeFeatureList().SetFeature(fid, fvalue);
743 if(cnode->CanGetParent()) {
749 if(parent_node_idx != TPhyloTree::Null()) {
750node_idx = phylo_tree.AddNode();
751phylo_tree[node_idx].SetValue(v);
752phylo_tree.AddChild(parent_node_idx, node_idx);
753 if(!preserve_node_ids) {
754phylo_tree[node_idx].GetValue().SetId(++node_id);
761pmap[uid] = node_idx;
764phylo_tree[node_idx].SetValue(v);
765phylo_tree.SetRootIdx(node_idx);
767 if(!preserve_node_ids) {
768phylo_tree[node_idx].GetValue().SetId(++node_id);
770pmap[uid] = node_idx;
789 template<
classTBioTreeContainer,
classTTreeType>
799 typedef typenameTNodeList::value_type::element_type
TCNode;
810 m_NodeList= &(tree_container->SetNodes().Set());
816 if(delta_level < 0) {
828 if(node_idx !=
m_RootIdx&& node.HasParent()) {
831cnode->SetParent(node_parent.GetValue().GetId());
835TNodeValueType::TNodeFeaturesType::TFeatureList TFList;
836 constTFList& flist = v.GetBioTreeFeatureList().GetFeatureList();
838 if(!flist.empty()) {
842 ITERATE(
typenameTFList, it, flist) {
844 const stringfvalue = it->value;
847cfeat->SetFeatureid(fid);
848cfeat->SetValue(fvalue);
850fset.Set().push_back(cfeat);
865 template<
classTBioTreeContainer,
classTTreeType>
875 typedef typenameTNodeList::value_type::element_type
TCNode;
886 m_NodeList= &(tree_container->SetNodes().Set());
892 if(delta_level < 0) {
908 if(node_idx !=
m_RootIdx&& node.HasParent()) {
911cnode->SetParent(node_parent.GetValue().GetId());
915TNodeValueType::TNodeFeaturesType::TFeatureList TFList;
916 constTFList& flist = v.GetBioTreeFeatureList().GetFeatureList();
918 if(!flist.empty()) {
922 ITERATE(
typenameTFList, it, flist) {
924 const stringfvalue = it->value;
927cfeat->SetFeatureid(fid);
928cfeat->SetValue(fvalue);
930fset.Set().push_back(cfeat);
945 template<
classTBioTreeContainer,
classTTreeType>
955 typedef typenameTNodeList::value_type::element_type
TCNode;
962TBioTreeContainer* tree_container,
972 m_NodeList= &(tree_container->SetNodes().Set());
973 if(
tree.GetFeatureDict().HasFeature(
"dist")) {
982 if(delta_level < 0) {
998 if(node.GetChildren().size() == 1) {
1014 if(node_idx !=
m_RootIdx&& node.HasParent()) {
1026cnode->SetParent(node_parent.GetValue().GetId());
1031TNodeValueType::TNodeFeaturesType::TFeatureList TFList;
1032 constTFList& flist = v.GetBioTreeFeatureList().GetFeatureList();
1034 if(!flist.empty()) {
1038 ITERATE(
typenameTFList, it, flist) {
1040 stringfvalue = it->value;
1045 if(!fvalue.empty()) {
1053 catch(std::exception&) {}
1058cfeat->SetFeatureid(fid);
1059cfeat->SetValue(fvalue);
1061fset.Set().push_back(cfeat);
1088 template<
classTBioTreeContainer,
classTPhyloTree>
1090TPhyloTree& phylo_tree,
1095 typedef typenameTBioTreeContainer::TFdict TContainerDict;
1101TContainerDict& fd = tree_container.SetFdict();
1102 typenameTContainerDict::Tdata& feat_list = fd.Set();
1104 typenameTContainerDict::Tdata::value_type::element_type TCFeatureDescr;
1108 const string& fvalue = it->second;
1115feat_list.push_back(d);
1120func(&tree_container, node_idx);
1122 if(node_idx==TPhyloTree::Null())
1130 template<
classTBioTreeContainer,
classTPhyloTree>
1132TPhyloTree& phylo_tree,
1137 typedef typenameTBioTreeContainer::TFdict TContainerDict;
1143TContainerDict& fd = tree_container.SetFdict();
1144 typenameTContainerDict::Tdata& feat_list = fd.Set();
1146 typenameTContainerDict::Tdata::value_type::element_type TCFeatureDescr;
1150 const string& fvalue = it->second;
1157feat_list.push_back(d);
1162func(&tree_container, node_idx);
1164 if(node_idx == TPhyloTree::Null())
1172 template<
classTBioTreeContainer,
classTPhyloTree>
1174TPhyloTree& phylo_tree,
1179 typedef typenameTBioTreeContainer::TFdict TContainerDict;
1185TContainerDict& fd = tree_container.SetFdict();
1186 typenameTContainerDict::Tdata& feat_list = fd.Set();
1188 typenameTContainerDict::Tdata::value_type::element_type TCFeatureDescr;
1192 const string& fvalue = it->second;
1199feat_list.push_back(d);
1204func(phylo_tree, &tree_container, node_idx);
1206 if(node_idx == TPhyloTree::Null())
1215 template<
classTBioTreeContainer,
classTTreeType>
1225 typedef typenameTNodeList::value_type::element_type
TCNode;
1238 m_NodeList= &(tree_container->SetNodes().Set());
1244 if(delta_level < 0) {
1256 if(node_idx !=
m_RootIdx&& node.HasParent()) {
1259cnode->SetParent(node_parent.GetValue().GetId());
1263TNodeValueType::TNodeFeaturesType::TFeatureList TFList;
1264 constTFList& flist = v.GetBioTreeFeatureList().GetFeatureList();
1266 if(!flist.empty()) {
1272 ITERATE(
typenameTFList, it, flist) {
1274 const stringfvalue = it->value;
1278cfeat->SetFeatureid(fid);
1279cfeat->SetValue(fvalue);
1281fset.Set().push_back(cfeat);
1300 template<
classTBioTreeContainer,
classTPhyloTree>
1302TPhyloTree& phylo_tree,
1307 typedef typenameTBioTreeContainer::TFdict TContainerDict;
1314TContainerDict& fd = tree_container.SetFdict();
1315 typenameTContainerDict::Tdata& feat_list = fd.Set();
1317 typenameTContainerDict::Tdata::value_type::element_type TCFeatureDescr;
1321 const string& fvalue = it->second;
1322 if(features.
find(fvalue) != features.
end()) {
1326return_dict.
Register(fid, fvalue);
1328feat_list.push_back(d);
1333func(&tree_container, node_idx, return_dict);
1335 if(node_idx == TPhyloTree::Null())
1343 template<
classTContainerDict>
1351 typenameTContainerDict::Tdata& feat_list = fd.Set();
1352 typedef typenameTContainerDict::Tdata::value_type::element_type TCFeatureDescr;
1356 const string& fvalue = it->second;
1363feat_list.push_back(d);
Things for representing and manipulating bio trees.
Template class to create a table with custom row-column access.
CRgbaGradColorTable * m_ColorTable
void x_UpdateProperties(TNodeType &node, int row_idx)
Updates node properties using values from m_AttrTable.
void SetClusters(const TClusterHash &clst)
virtual ETreeTraverseCode x_OnStepDown(TTreeIdx x_node)
CPhyloTreeNode::TTreeIdx m_CollapsedParentIdx
CPhyloTreeCalculator(TTreeType *tree, CRgbaGradColorTable *color_table)
map< TClusterID, vector< TTreeIdx > > TClusterHash
virtual ETreeTraverseCode x_OnStep(TTreeIdx x_node, int delta)
void SetLabelFormat(string labelFmt)
void SetAttrTable(const TAttrTable &attr)
TClusterID m_MaxClusterID
virtual ETreeTraverseCode x_OnStepRight(TTreeIdx x_node)
TBioTreeFeatureId m_AttrKeyId
const TClusterHash & GetClusters()
string m_LabelFormat
label calculation
const TAttrTable * m_AttrTable
Attributes with seq-ids optionally provided to update tree properties.
CPhyloTree::TClusterID TClusterID
virtual ~CPhyloTreeCalculator()
TClusterID GetMaxClusterID() const
CNcbiTable< string, unsigned, string > TAttrTable
void Init(CRgbaGradColorTable *ct)
unsigned GetVisibleNodes()
vector< AttrKey > m_AttrKeys
Mapping for efficient lookup of seq-ids in m_AttrTable.
virtual ETreeTraverseCode x_OnStepLeft(TTreeIdx x_node)
TTreeIdx m_MaxDistNode
Index of node that is furthest from the root.
vector< float > & GetDistances()
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
CPhyloTreeDistFromRoot(TTreeType *tree)
TTreeIdx GetMaxDistNode() const
vector< float > m_Distances
Distance of each node from root.
virtual bool x_Allowed(TNodeType &node)
CPhyloTreeFilter_Depth(TTreeType *tree, int x_depth)
virtual bool x_Allowed(TNodeType &node)
CPhyloTreeFilter_Distance(TTreeType *tree, float x_dist)
CPhyloTreeFilter_Export(TTreeType *tree)
virtual bool x_Allowed(TNodeType &node)
virtual bool x_Allowed(TNodeType &node)
CPhyloTreeFilter_Selector(TTreeType *tree)
CPhyloTreeLabelRange(TTreeType *tree, bool x_order)
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
vector< pair< string, string > > & GetLabelRanges()
vector< pair< string, string > > m_LabelRanges
Min and max label values (according to lexicographic.
For each node, this returns the maximum distances of any of its children (recursively searched) from ...
vector< float > m_Distances
Max distace of any child of a node from the root, saved in same order as node array in tree.
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
vector< float > & GetDistances()
CPhyloTreeMaxChildDist(TTreeType *tree)
float m_MaxDist
Keep track of overall max and min distances.
For each node this finds the maximum distance of any of its immediate (not recursively searched) chil...
CPhyloTreeMaxDirectChildDist(TTreeType *tree, SCollapsable *collapsable_func=new SCollapsable())
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
CRef< SCollapsable > m_CheckCollapseFunc
vector< SChildMaxDist > m_Distances
Max distace of any direct child of a node from the root, saved in same order as node array in tree.
vector< SChildMaxDist > & GetDistances()
virtual ~CPhyloTreeMaxIdCalculator()
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
CPhyloNodeData::TID GetMaxId() const
CPhyloTreeMaxIdCalculator(TTreeType *tree)
CPhyloTreeMidpointDist(TTreeType *tree, vector< float > &distances, TTreeIdx max_dist_node_idx)
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
float m_MaxDist
Total distance along m_MaxPath.
vector< TTreeIdx > m_MaxDistPathToRoot
vector< TTreeIdx > m_SortedMaxDistPathToRoot
vector< float > m_Distances
Distance of each node from root node.
void GetLongest(vector< TTreeIdx > &path, float &length)
TTreeIdx m_MaxDistNode
Node at greatest distance from root, its distance and vector of nodes from root to m_MaxDistNode (sor...
vector< TTreeIdx > m_MaxPath
Path (set of nodes) that is the longest path in the tree.
float m_LeafMidpoint
Index of leaf at center of subtree (leaves in subtree/2)
TTreeIdx m_PriorityLeafIdx
Leaf with highest priority number.
TTreeIdx GetMaxPriorityNode() const
virtual ~CPhyloTreePriorityNode()
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
size_t m_MaxPriorityLeafNum
Leaf index of node with m_MaxPriority.
CPhyloTreePriorityNode(TTreeType *tree, TTreeIdx node_idx)
void Init(TTreeIdx node_idx)
int m_MaxPriority
Max priority value found in priority field in subtree.
TBioTreeFeatureId m_PriorityId
Id of priority feature in tree.
size_t m_LeafCount
Current leaf count (as we iterate over the subtree)
const TModelRect & GetRect() const
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
virtual ~CPhyloTreeRectCalculator()
CPhyloTreeRectCalculator(TTreeType *tree)
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
const vector< pair< string, string > > & m_LabelRanges
CPhyloTreeSorterLabelRange(TTreeType *tree, const vector< pair< string, string > > &label_ranges, bool x_order)
CPhyloTreeSorterLabel(TTreeType *tree, bool x_order)
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
CPhyloTreeSorterSubtreeDist(TTreeType *tree, const vector< float > &distances, bool x_order)
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
const vector< float > & m_Distances
CPhyloTreeSorter(TTreeType *tree, bool x_order)
virtual ETreeTraverseCode x_OnStep(TTreeIdx node_idx, int delta)
Tree subclass also has functions and data needed for rendering and selection.
CPhyloNodeData::TClusterID TClusterID
CRgbaGradColorTable Provides a storage for colors (to eliminate color creation overhead) and Function...
Visitor functor to convert phylo tree nodes to ASN.1 BioTree container.
ETreeTraverseCode operator()(TTreeType &tree, TTreeIdx node_idx, int delta_level)
TNodeFeatureList::value_type::element_type TCNodeFeature
TCNodeSet::Tdata TNodeList
TCNodeFeatureSet::Tdata TNodeFeatureList
TTreeType::TTreeIdx TTreeIdx
TCNode::TFeatures TCNodeFeatureSet
TTreeNodeType::TValueType TNodeValueType
TBioTreeContainer::TNodes TCNodeSet
CTreeConvert2ContainerFunc(TBioTreeContainer *tree_container, TTreeIdx root_idx)
TNodeList::value_type::element_type TCNode
TBioTreeContainer * m_Container
TTreeType::TNodeType TTreeNodeType
Visitor functor to convert phylo tree nodes to ASN.1 BioTree container not including all features.
TBioTreeContainer * m_Container
TNodeFeatureList::value_type::element_type TCNodeFeature
TTreeType::TTreeIdx TTreeIdx
ETreeTraverseCode operator()(TTreeType &tree, TTreeIdx node_idx, int delta_level)
const CBioTreeFeatureDictionary & m_ReturnDict
TCNodeFeatureSet::Tdata TNodeFeatureList
TTreeNodeType::TValueType TNodeValueType
TCNodeSet::Tdata TNodeList
TNodeList::value_type::element_type TCNode
TTreeType::TNodeType TTreeNodeType
TCNode::TFeatures TCNodeFeatureSet
CTreeConvert2ContainerPartialFunc(TBioTreeContainer *tree_container, TTreeIdx root_idx, const CBioTreeFeatureDictionary &return_dict)
TBioTreeContainer::TNodes TCNodeSet
TTreeType::TTreeIdx TTreeIdx
TBioTreeFeatureId m_DistFeatureId
TBioTreeContainer::TNodes TCNodeSet
TCNode::TFeatures TCNodeFeatureSet
TBioTreeContainer * m_Container
CTreeConvertNonSingleChild2ContainerFunc(TTreeType &tree, TBioTreeContainer *tree_container, TTreeIdx root_idx)
TNodeList::value_type::element_type TCNode
TCNodeFeatureSet::Tdata TNodeFeatureList
TCNodeSet::Tdata TNodeList
TTreeType::TNodeType TTreeNodeType
ETreeTraverseCode operator()(TTreeType &tree, TTreeIdx node_idx, int delta_level)
TBioTreeNodeId m_ParentID
TTreeNodeType::TValueType TNodeValueType
TNodeFeatureList::value_type::element_type TCNodeFeature
TCNode::TFeatures TCNodeFeatureSet
TNodeList::value_type::element_type TCNode
CTreeConvertSelected2ContainerFunc(TBioTreeContainer *tree_container, TTreeIdx root_idx)
TNodeFeatureList::value_type::element_type TCNodeFeature
TTreeType::TTreeIdx TTreeIdx
TTreeNodeType::TValueType TNodeValueType
TBioTreeContainer::TNodes TCNodeSet
TCNodeSet::Tdata TNodeList
TTreeType::TNodeType TTreeNodeType
ETreeTraverseCode operator()(TTreeType &tree, TTreeIdx node_idx, int delta_level)
TCNodeFeatureSet::Tdata TNodeFeatureList
TBioTreeContainer * m_Container
TNodeList & GetChildren()
Return the indices of this node's child nodes.
static TTreeIdx Null()
Static function that returns the null value.
static TTreeIdx Null()
Return the index value that represents a NULL node.
TNodeType & GetNode(TTreeIdx idx)
Return a reference to the node at the given index.
virtual bool x_Allowed(TNodeType &)
IPhyloTreeFilter(TTreeType *tree)
virtual ETreeTraverseCode x_OnStep(TTreeIdx x_node, int delta)
vector< TTreeIdx > m_TreeStack
virtual ETreeTraverseCode x_OnStepDown(TTreeIdx x_node)
ETreeTraverseCode operator()(TTreeType &tree, TTreeIdx tree_node, int delta)
virtual ETreeTraverseCode x_OnStep(TTreeIdx x_node, int delta)
virtual ~IPhyloTreeVisitor()
virtual ETreeTraverseCode x_OnStepRight(TTreeIdx x_node)
IPhyloTreeVisitor(TTreeType *tree)
CPhyloTree::TTreeIdx TTreeIdx
CPhyloTree::TNodeType TNodeType
virtual ETreeTraverseCode x_OnStepLeft(TTreeIdx x_node)
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
Include a standard set of the NCBI C++ Toolkit most basic headers.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
#define numeric_limits
Pre-declaration of the "numeric_limits<>" template Forcibly overrides (using preprocessor) the origin...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
ETreeTraverseCode
Tree traverse code returned by the traverse predicate function.
unsigned int TBioTreeNodeId
Tree node id. Every node has its unique id in the tree.
unsigned int TBioTreeFeatureId
Feature Id.
TBioTreeFeatureId Register(const string &feature_name)
Register new feature, return its id.
bool HasFeature(const string &feature_name) const
Check if feature is listed in the dictionary.
const TFeatureDict & GetFeatureDict() const
Get reference on the internal map.
@ eTreeTraverse
Keep traversal.
@ eTreeTraverseStepOver
Do not traverse current node (pick the next one)
constexpr auto sort(_Init &&init)
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Int4 delta(size_t dimension_, const Int4 *score_)
void TreeConvertNonSingleChild2Container(TBioTreeContainer &tree_container, TPhyloTree &phylo_tree, typename TPhyloTree::TTreeIdx node_idx=TPhyloTree::Null())
Convert selected nodes from tree to ASN.1 BioTree container.
void TreeConvert2Container(TBioTreeContainer &tree_container, TPhyloTree &phylo_tree, typename TPhyloTree::TTreeIdx node_idx=TPhyloTree::Null())
Convert tree to ASN.1 BioTree container.
void TreeConvertSelected2Container(TBioTreeContainer &tree_container, TPhyloTree &phylo_tree, typename TPhyloTree::TTreeIdx node_idx=TPhyloTree::Null())
Convert selected nodes from tree to ASN.1 BioTree container.
void TreeConvert2ContainerPartial(TBioTreeContainer &tree_container, TPhyloTree &phylo_tree, const set< string > &features, typename TPhyloTree::TTreeIdx node_idx=TPhyloTree::Null())
Convert tree to ASN.1 BioTree container but only include the requested features.
void BioTreeConvertContainer2Tree(TPhyloTree &phylo_tree, const TBioTreeContainer &tree_container, CBioTreeFeatureDictionary *dictionary, bool preserve_node_ids=true, bool expand_all=false)
Convert ASN.1 BioTree container to phylo tree.
set< CPhyloTree::TTreeIdx > GetTreeNeighborhood(TPhyloTree &phylo_tree, const vector< CPhyloTree::TID > &node_ids, float d)
Find all nodes within 'd' distance of the nodes 'node_ids' If tree does not have distance information...
void DictConvert2ContainerFeatureDict(TContainerDict &fd, CBioTreeFeatureDictionary &dict)
Convert CBioTreeFeatureDictionary to ASN.1 BioTree dictionary.
Structure allows us to more efficiently store and look up keys (usually seq-ids) in m_AttrTable.
AttrKey(const string &id, unsigned int idx)
unsigned int m_AttrTableIdx
bool operator<(const AttrKey &rhs) const
Sort keys on seq-id string value.
SChildMaxDist(TTreeIdx idx, float dist)
bool operator<(const SChildMaxDist &rhs) const
Sort keys on seq-id string value.
virtual bool operator()(const CPhyloTreeNode &n)
Fun TreeDepthFirst(TTreeModel &tree_model, typename TTreeModel::TTreeIdx node_idx, Fun func)
Depth-first tree traversal algorithm.
size_t TTreeIdx
Bi-directionaly linked N way tree allocated in a contiguous memory block.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4