60 if (label_obj.HasField(
"label") &&
61 label_obj.GetField(
"label").GetData().IsStr()) {
62 m_Label = label_obj.GetField(
"label").GetData().GetStr();
65 if (label_obj.HasField(
"font-name") &&
66 label_obj.GetField(
"font-name").GetData().IsStr()) {
67 m_FontName = label_obj.GetField(
"font-name").GetData().GetStr();
70 if (label_obj.HasField(
"font-size") &&
71 label_obj.GetField(
"font-size").GetData().IsInt()) {
72 m_FontSize = label_obj.GetField(
"font-size").GetData().GetInt();
75 if (label_obj.HasField(
"posx") &&
76 label_obj.GetField(
"posx").GetData().IsInt()) {
77 m_XPos = label_obj.GetField(
"posx").GetData().GetInt();
80 if (label_obj.HasField(
"posy") &&
81 label_obj.GetField(
"posy").GetData().IsInt()) {
82 m_YPos = label_obj.GetField(
"posy").GetData().GetInt();
85 if (label_obj.HasField(
"color") &&
86 label_obj.GetField(
"color").GetData().IsStr()) {
104 uo_id->
SetStr(
"label-parameters");
107 label_object.
Reset(label_uo);
108 uo.
AddField(
"view-label", *label_uo);
111 if (label_object->HasField(
"label") &&
112 label_object->GetField(
"label").GetData().IsStr()) {
113 label_object->SetField(
"label").SetData().SetStr(
m_Label);
116 label_object->AddField(
"label",
m_Label);
119 if (label_object->HasField(
"font-name") &&
120 label_object->GetField(
"font-name").GetData().IsStr()) {
121 label_object->SetField(
"font-name").SetData().SetStr(
m_FontName);
124 label_object->AddField(
"font-name",
m_FontName);
127 if (label_object->HasField(
"font-size") &&
128 label_object->GetField(
"font-size").GetData().IsInt()) {
129 label_object->SetField(
"font-size").SetData().SetInt(
m_FontSize);
132 label_object->AddField(
"font-size",
m_FontSize);
135 if (label_object->HasField(
"posx") &&
136 label_object->GetField(
"posx").GetData().IsInt()) {
137 label_object->SetField(
"posx").SetData().SetInt(
m_XPos);
140 label_object->AddField(
"posx",
m_XPos);
143 if (label_object->HasField(
"posy") &&
144 label_object->GetField(
"posy").GetData().IsInt()) {
145 label_object->SetField(
"posy").SetData().SetInt(
m_YPos);
148 label_object->AddField(
"posy",
m_YPos);
151 if (label_object->HasField(
"color") &&
152 label_object->GetField(
"color").GetData().IsStr()) {
166 objects::CScope& scope,
180 objects::CScope& scope,
184 if (
tree.GetNodeCount() == 0 ) {
199 if (
tree.IsSetUser()) {
267 float dist_scaler = 1.0f / (max_dist - min_dist);
290 string sName = it->second;
291 string sKey =
"$(" + it->second +
")";
293 ttf += ttf.empty()?
"" :
"\n";
294 ttf += (sName +
": " + sKey);
298 return ttf.empty()?
"Tree Node":ttf;
304 const string& labelfmt)
308 if (!labelfmt.empty())
350 float colorStep = nmbClusters? (180.0 / nmbClusters): 0;
353 bool narrow_angle = colorStep < 5.0;
363 int cluster_id = cl->first;
370 if (cluster_id_to_selection_map.
find(cluster_id) != cluster_id_to_selection_map.
end()) {
371 size_t select_set_idx = cluster_id_to_selection_map[cluster_id];
377 while (c_dist < 0.2f) {
378 cluster_color.
Darken(0.15f);
394 color_idx = closest_idx;
400 float rotate_angle = colorStep + (narrow_angle ? 90.0 : 180.0);
411 ITERATE (vector<TTreeIdx>, node_iter, cl->second) {
415 if ((*parent).IDX().first < minX) {
416 minX = (*parent).IDX().first;
422 bool selection_cluster = (cluster_id_to_selection_map.
find(cl->first) != cluster_id_to_selection_map.
end());
427 if (selection_cluster)
432 ITERATE (vector<TTreeIdx>, node_iter, cl->second) {
436 for (; (*m_TreeModel)[parent_idx].HasParent();
437 parent_idx = (*m_TreeModel)[parent_idx].GetParent()) {
440 if ((*cursor).IDX().first > minX) {
447 int primary_cluster_id = (*cursor).GetPrimaryCluster();
448 if (parent_idx == *node_iter) {
449 if (primary_cluster_id == cl->first) {
450 (*cursor).SetClusterColorIdx(color_idx);
452 if (cursor.
IsLeaf() && (*cursor).GetNumClusters() > 1) {
455 if (selection_cluster) {
457 (*cursor).SetMarkerSize(2.0f);
458 (*cursor).GetMarkerColors().push_back(
464 (*cursor).SetClusterColorIdx(color_idx);
530 std::vector<CPhyloTree::TTreeIdx> path;
533 float midpoint = dist / 2.0f;
536 if (path.size() > 1) {
539 float dist_from_parent = 0.0f;
540 float dist_from_child = 0.0f;
542 for (
size_t i=0;
i < path.size(); ++
i) {
559 midpoint_child = path[
i];
560 midpoint_parent = path[
i + 1];
563 dist_from_parent = d - midpoint;
564 dist_from_child = midpoint - base_distance;
572 midpoint_parent = path[
i];
573 midpoint_child = path[
i + 1];
576 dist_from_parent = midpoint - base_distance;
577 dist_from_child = d - midpoint;
608 float close = (dist/float(path.size() - 1))/100.0f;
610 if (dist_from_parent <=
close)
611 close_idx = midpoint_parent;
612 else if (dist_from_child <=
close)
613 close_idx = midpoint_child;
623 LOG_POST(
Info <<
"Re-rooted tree at existing midpoint");
661 return collapsed_nodes;
670 vector<SChildMaxDist> distances = child_dist.
GetDistances();
673 std::sort(distances.begin(), distances.end());
677 while (current_leaf_count > leaf_count_target) {
678 vector<SChildMaxDist>::reverse_iterator riter = distances.rbegin();
682 for (; riter != distances.rend(); ++riter) {
685 bool has_subtree =
false;
688 for (
size_t i = 0;
i <
n.GetChildren().
size(); ++
i) {
692 else if (collapsed_nodes.
find(child_node->GetId()) == collapsed_nodes.
end()) {
701 if (riter == distances.rend())
714 for (
size_t i = 0;
i <
n.GetChildren().
size(); ++
i) {
718 iter = collapsed_nodes.
find(child_node->GetId());
719 if (iter != collapsed_nodes.
end()) {
720 collapsed_nodes.
erase(iter);
724 collapsed_nodes.
insert(
n->GetId());
729 current_leaf_count -=
n.GetChildren().size() - 1;
732 distances.erase(--riter.base());
735 return collapsed_nodes;
823 if (new_container->IsSetUser()) {
824 btc->SetUser().Assign(new_container->GetUser());
860 for (fiter=fdict.
begin(); fiter != fdict.
end(); ++fiter, ++
count) {
862 return (*fiter).second;
952 size_t& num_selected,
967 vector<TTreeIdx> sel =
FindNodes(
query, num_queried, string_matching, use_case);
973 num_selected = sel.size();
977 for (
auto iter=sel.begin(); iter!=sel.end(); ++iter) {
1002 tree[node]->GetBioTreeFeatureList().GetFeatureList();
1021 vector<CPhyloTree::TTreeIdx>
1024 vector<TTreeIdx> selNodes;
1064 vector<TTreeIdx> search_cache;
1070 if (search_cache.empty())
1079 else if (direction>0) {
1084 vector<TTreeIdx>::iterator itt =
1088 if (itt == search_cache.end()) {
1094 if (itt != search_cache.end())
1106 vector<TTreeIdx>::iterator itt =
1110 if (itt == search_cache.end()) {
1115 if (itt != search_cache.begin())
1260 m_IdMap[source_id] = target_id;
1262 new_node->SetId(target_id);
1269 node->GetBioTreeFeatureList().GetFeatureList()) {
1291 LOG_POST(
Info <<
"Error - did not find parent node as expected.");
1315 _TRACE(
"CPhyloTreeDataSource::Cut - Nothing is selected");
1320 _TRACE(
"CPhyloTreeDataSource::Cut - Removing root item is illegal");
1345 _TRACE(
"CPhyloTreeDataSource::Paste - Nothing is selected");
1350 _TRACE(
"CPhyloTreeDataSource::Paste - Clipboard is empty");
1366 _TRACE(
"CPhyloTreeDataSource::NewNode - Nothing is selected");
1373 _TRACE(
"CPhyloTreeDataSource::NewNode - New root cannot be added");
1383 new_node->SetId(next_id.
GetMaxId() + 1);
1409 return new_node_idx;
1417 _TRACE(
"CPhyloTreeDataSource::Remove - Nothing is selected");
1423 _TRACE(
"CPhyloTreeDataSource::Remove - The root node can't be removed");
1454 vector<CPhyloNodeData::TID> sel;
1457 if (sel.size() == 0) {
1458 _TRACE(
"CPhyloTreeDataSource::RemoveSelected() - Nothing is selected");
1463 for (
size_t i = 0;
i < sel.size(); ++
i) {
1468 _TRACE(
"CPhyloTreeDataSource::Remove - The root node can't be removed");
1479 for (
size_t i = 0;
i < sel.size(); ++
i)
1523 string priority_label = priority_node_features.
GetFeatureValue(label_feat_id);
1527 features.
SetFeature(label_feat_id, priority_label);
1536 for (
size_t i = 0;
i < node_ids.size(); ++
i) {
1551 vector<TTreeIdx> sel;
1555 if (sel.size() == 0) {
1556 _TRACE(
"CPhyloTreeDataSource::RemoveSelected() - Nothing is selected");
1563 for (
size_t i = 0;
i < sel.size(); ++
i)
1566 bool collapse_node =
true;
1570 while (parent_node_idx != root_idx) {
1573 collapse_node =
false;
1578 if (std::find(sel.begin(), sel.end(), parent_node_idx) != sel.end()) {
1579 collapse_node =
false;
1587 if (collapse_node) {
1603 _TRACE(
"CPhyloTreeDataSource::MoveNode - Nothing is selected");
1610 _TRACE(
"CPhyloTreeDataSource::MoveNode - The root node can't be moved");
1618 if (*it == current_node_idx) {
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Features storage for the bio tree node.
Template class to create a table with custom row-column access.
void Sync(CBioTreeFeatureDictionary &dict)
void SetDistance(TDistance x_dist)
CBioTreeFeatureList & GetBioTreeFeatureList()
TDistance GetDistance() const
void SetFeature(CBioTreeFeatureDictionary &dict, const string &name, const string &value)
void InitFromUserObject(CPhyloTree *tree_model, const objects::CBioTreeContainer_Base::TUser &uo)
vector< CPhyloSelectionSet > & GetSets()
void SetSelectionSetProperty(CPhyloTree *tree_model)
void RenumberClusterIDs(int start_id)
Update all cluster ids using the starting-id as the lowest value.
map< int, size_t > GetClusterToSelectionMap()
void SetLabelFormat(string labelFmt)
void SetAttrTable(const TAttrTable &attr)
const TClusterHash & GetClusters()
void Init(CRgbaGradColorTable *ct)
void SortDist(bool ascending)
vector< CPhyloTree::TID > m_StringQueryIDs
Temporary storage for string query results to get ID's back to caller.
virtual string GetColumnLabel(size_t col) const
get number and names of columns in data source
void Init(const objects::CBioTreeContainer &tree, objects::CScope &scope, bool expand_all=false)
Throws exception if tree is empty - at least 1 node is required.
void ReRootMidpoint()
Re-root tree using midpoint-method.
TTreeIdx IterateOverSelNodes(int direction, bool highlight)
virtual CMacroQueryExec * GetQueryExec(bool casesensitive, CStringMatching::EStringMatching matching)
Create an appropriate instance of a subclass of CQueryExec for that will be used to execute a query o...
void FilterDistances(double x_dist)
void Clusterize(CPhyloTreeScheme *scheme)
void ComputeLengthsFromRoot()
Create sorted array of distances of nodes from the parent (the m_LenDistribution array)
void SortLabel(bool ascending)
CRef< objects::CScope > m_Scope
void UpdateSelectionSets(CPhyloTreeScheme *scheme)
virtual void ClearQueryResults()
Clear any current results from previous queries.
TTreeIdx m_SearchCurrentNode
void ApplyAttributes(CBioTreeAttrReader::TAttrTable &attrs, CPhyloTreeScheme *scheme, const string &labelfmt="")
CPhyloTree::TClusterID TClusterID
virtual void ExecuteStringQuery(const string &query, size_t &num_selected, size_t &num_queried, CStringMatching::EStringMatching string_matching=CStringMatching::ePlainSearch, NStr::ECase use_case=NStr::eCase)
Execute a string-matching query on the underlying data.
virtual void SetQueryResults(CMacroQueryExec *q)
Set selection results to be whatever elements are selected in 'q'.
TClusterID GetMaxClusterID()
void ReRootEdge(TTreeIdx edge_child_node)
Re-root on the edge between the selected node and its parent.
void Relabel(CPhyloTreeScheme *scheme, string labelFmt)
void ReRoot(TTreeIdx root_idx)
Set the root node of the tree to the node at root_idx.
TTreeIdx NewNode(bool after=true)
vector< TTreeIdx > FindNodes(const string &query, size_t &num_queried, CStringMatching::EStringMatching string_matching, NStr::ECase use_case) const
search for nodes via the specified text matching algorithm
CRef< CPhyloTree > m_TreeModel
void Remove(bool subtree=true)
void Sort(bool ascending)
CPhyloSelectionSetMgr & GetSelectionSets()
static CPhyloTree m_sTreeClipboard
static (to allow copying between trees)
float GetClosestLen(float pct) const
Look in vector of sorted distances of nodes from the root and given a pct (0..1), return the distance...
CPhyloTreeCalculator * m_Calc
CPhyloTree::TTreeIdx TTreeIdx
void SetColorIndices(CPhyloTreeScheme *scheme)
virtual size_t GetColsCount() const
set< CPhyloNodeData::TID > CollapseByDistance(int leaf_count_target, SCollapsable *collapse_func)
Collapse, based on distance, enough nodes in the tree to get the total number of leaves down to the r...
void SetCollapsedLabels(const vector< CPhyloNodeData::TID > &node_ids)
Collapse all nodes in node_ids, doing relabeling if needed.
std::vector< float > m_LenDistribution
CPhyloTreeDataSource(const objects::CBioTreeContainer &tree, objects::CScope &scope, bool expand_all=false)
Throws exception if tree is empty - at least 1 node is required.
void SortLabelRange(bool ascending)
const CBioTreeFeatureDictionary & GetDictionary() const
CTreeGraphicsModel & GetModel()
Get model for rendering.
string GenerateTooltipFormat()
TModelRect GetBoundRect()
TClusterToColorMap m_ClusterToColorMap
void SetCollapsedLabel(CPhyloTree::TTreeIdx idx)
Collapse single node, do any relabeling if needed.
vector< float > & GetDistances()
TTreeIdx GetMaxDistNode() const
vector< pair< string, string > > & GetLabelRanges()
For each node, this returns the maximum distances of any of its children (recursively searched) from ...
vector< float > & GetDistances()
For each node this finds the maximum distance of any of its immediate (not recursively searched) chil...
vector< SChildMaxDist > & GetDistances()
CPhyloNodeData::TID GetMaxId() const
void GetLongest(vector< TTreeIdx > &path, float &length)
void ExpandCollapse(CBioTreeFeatureDictionary &dict, CPhyloNodeData::TDisplayChildren chds)
Set this node to be expanded/collapsed.
bool CanExpandCollapse(CPhyloNodeData::TDisplayChildren chds)
Return true if node can have its expand/collapsed state changed to chds.
void SetLabel(CBioTreeFeatureDictionary &dict, const string &label)
Set label string and synch value to the feature list for this ndoe.
bool IsLeafEx() const
Return true if node is a leaf or is collapsed.
TTreeIdx GetMaxPriorityNode() const
const TModelRect & GetRect() const
void SetMaxBranchDist(GLdouble bd)
void SetMaxNumChildren(GLdouble max_num_children)
void UpdateColorTable(CRgbaGradColorTable *color_table)
Make sure all current colors used by the scheme are in 'color_table' and add the ones that are not.
const TColoration & GetColoration(void) const
Tree subclass also has functions and data needed for rendering and selection.
void ClearSelection()
Sets selection state of all nodes to eNotSelected and clears m_Selected.
void Clear()
Clear the tree nodes, graphics model and selected nodes.
void UpdateNodesMapping()
CPhyloNodeData::TClusterID TClusterID
CPhyloSelectionSetMgr & GetSelectionSets()
void SetCurrentNode(TTreeIdx node_idx)
Set the index of the currently active node.
void SetSelection(TTreeIdx idx, bool sel, bool sel_children=true, bool sel_parents=true)
Select or deselect the node at the specified index and, optionally, its parents and children as well.
TTreeIdx GetCurrentNodeIdx() const
Return the index of the currently active node (may be Null()).
void GetExplicitlySelectedAndNotCollapsed(vector< TTreeIdx > &esel) const
Returns only indices of nodes explicitly selected, but when a node is underneath a collapsed node,...
CPhyloTreeNode & GetCurrentNode()
Get reference to currently active node. Throws exception if it's Null()
CRgbaGradColorTable * GetColorTable()
void GetExplicitlySelectedIDs(vector< TID > &esel) const
Returns only ids of nodes explicitly selected, not their parents or children, i.e.
TTreeIdx FindNodeById(TID id) const
Return index of the node with the given id or Null().
void GetExplicitlySelected(vector< TTreeIdx > &esel) const
Returns only indices of nodes explicitly selected, not their parents or children, i....
CBioTreeFeatureDictionary & GetFeatureDict()
Return feature dictionary.
Query execution function for assignment operator.
Query execution function for run-time variables.
class CRgbaColor provides a simple abstraction for managing colors.
EStringMatching
String matching algorithms.
bool MatchString(const CTempString &str)
Matches a string to a pattern, using the specified string matching algorithm.
CTreeCollisionModel2D & GetCollisionData()
void InitializeFromUserObject(const CBioTreeContainer_Base::TUser &uo)
void SaveToUserObject(CBioTreeContainer_Base::TUser &uo)
TTreeIdx GetParent() const
Get node's parent.
void ClearConnections()
Remove connections to parent and children of this node.
TNodeList_CI SubNodeEnd() const
Return const iterator to end of subnode list.
TNodeList & GetChildren()
Return the indices of this node's child nodes.
TNodeList::iterator TNodeList_I
void SetParent(TTreeIdx parent_idx)
Set index of nodes parent.
TData & GetValue()
Return the value object for the node.
bool HasParent() const
Check if the node has a parent.
bool IsLeaf() const
Report whether this is a leaf node.
static TTreeIdx Null()
Static function that returns the null value.
TNodeList_CI SubNodeBegin() const
Return const iterator to first subnode index.
void ReRoot(TTreeIdx idx)
Sets the root idx to be 'idx' and updates the tree so that all nodes above the new root become childr...
TNodeType & GetParent(TNodeType &node)
Return a reference to the parent node of the given node.
static TTreeIdx Null()
Return the index value that represents a NULL node.
void SetNumNodes(int count)
Set the number of displayed nodes in current tree layout.
TNodeType & GetNode(TTreeIdx idx)
Return a reference to the node at the given index.
TNodeType & GetRoot()
Return a reference to the root node of the tree.
void AddChild(TTreeIdx parent_idx, TTreeIdx child_idx)
Add the node at 'child_idx' to the children 'parent_idx'.
TTreeIdx GetRootIdx() const
Return the index of the root node.
TTreeIdx AddNode()
Add a new default node to the tree and return its index.
void RemoveChild(TTreeIdx parent_idx, TTreeIdx child_idx)
Remove the node at 'child_idx' from its parent 'parent_idx' Nothing is done if the node 'child_idx' i...
void SetRootIdx(TTreeIdx idx)
Set the index of the root node of the tree.
void SetTree(CPhyloTree *t)
Set current node for query execution.
std::vector< TTreeIdx > GetTreeSelected() const
bool HasField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Verify that a named field exists.
CUser_object & AddField(const string &label, const string &value, EParseField parse=eParse_String)
add a data field to the user object that holds a given value
CUser_field & SetField(const string &str, const string &delim=".", const string &obj_subtype=kEmptyStr, NStr::ECase use_case=NStr::eCase)
Access a named field in this user object.
const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Access a named field in this user object.
container_type::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
parent_type::iterator iterator
const_iterator find(const key_type &key) const
const_iterator end() const
visitor_copy_subtree(CPhyloTree &tree, CPhyloTree &target)
CPhyloTree::TNodeType TNodeType
ETreeTraverseCode operator()(CPhyloTree &tree, CPhyloTree::TTreeIdx node_idx, int delta)
CPhyloTree::TTreeIdx TTreeIdx
ETreeTraverseCode operator()(CPhyloTree &tree, CPhyloTree::TTreeIdx node, int delta)
CPhyloTree::TTreeIdx TTreeIdx
map< CPhyloNodeData::TID, CPhyloNodeData::TID > m_IdMap
mapping from Ids in source tree to target tree
CPhyloTree::TNodeType TNodeType
CPhyloNodeData::TID m_TargetMaxId
visitor_paste_subtree(CPhyloTree &source, CPhyloTree &target, TTreeIdx target_idx)
ETreeTraverseCode operator()(CPhyloTree &tree, CPhyloTree::TTreeIdx node_idx, int delta)
visitor_stringmatch_query(CStringMatching &stringMatching, vector< TTreeIdx > &selNodes, size_t &numQueried)
ETreeTraverseCode operator()(CPhyloTree &tree, TTreeIdx node, int delta)
vector< TTreeIdx > & m_SelNodes
CPhyloTree::TTreeIdx TTreeIdx
CStringMatching & m_StringMatching
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Info(CExceptionArgs_Base &args)
size_t AddColor(const CRgbaColor &c)
Add a single color to the table.
float FindClosestColor(const CRgbaColor &c, size_t &idx) const
Return index of color with minimum color disance (as defined in CRgbaColor) from c.
bool FindColor(const CRgbaColor &c, size_t &idx) const
On exact match, returns true with index in idx, false otherwise.
void LoadTexture(int alpha_levels=8)
OpenGL parameters and operations to allow color table to (also) be stored as a 1D texture.
void ClearColors()
Empty color table.
CRgbaColor & GetColor(size_t i)
static CRgbaColor RotateColor(const CRgbaColor &c, float degrees)
Rotate the hue of the color by degrees.
string ToString(bool printAlpha=true, bool uchars=true) const
Return a string representation of the current color.
static float ColorDistance(const CRgbaColor &c1, const CRgbaColor &c2)
returns the distance in the RGB color cube between the two colors, scaled to a range [0,...
void FromString(const string &str)
Assign color values encoded in a string.
TObjectType * GetNCPointer(void) const THROWS_NONE
Get pointer,.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
TObjectType & GetObject(void)
Get object.
TObjectType & GetNCObject(void) const
Get object.
void AddFunc(CQueryParseNode::EType func_type, CQueryFunctionBase *func)
Register function implementation.
@ eIdentifier
Identifier like db.field (Org, Fld12, etc.)
@ eFloatConst
Floating point const.
@ eIntConst
Integer const.
@ eBoolConst
Boolean (TRUE or FALSE)
@ eString
String ("free text")
#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.
ECase
Which type of string comparison.
@ eNocase
Case insensitive compare.
@ eCase
Case sensitive compare.
string GetName(TBioTreeFeatureId id) const
Return the featue name given the id, or "" if not found.
ETreeTraverseCode
Tree traverse code returned by the traverse predicate function.
unsigned int TBioTreeFeatureId
Feature Id.
void SetFeature(TBioTreeFeatureId id, const string &value)
Set feature value, feature if exists replaced, if not added.
TBioTreeFeatureId GetId(const string &feature_name) const
If feature is already registered returns its id by name.
TBioTreeFeatureId Register(const string &feature_name)
Register new feature, return its id.
const string & GetFeatureValue(TBioTreeFeatureId id) const
Get feature value by 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.
vector< CBioTreeFeaturePair > TFeatureList
@ eTreeTraverse
Keep traversal.
const TData & GetData(void) const
Get the Data member data.
TStr & SetStr(void)
Select the variant.
const TObject & GetObject(void) const
Get the variant data.
void SetType(TType &value)
Assign a value to Type data member.
void SetData(TData &value)
Assign a value to Data data member.
bool IsObject(void) const
Check if variant Object is selected.
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
const CharType(& source)[N]
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 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.
bool operator()(CPhyloTree::TTreeIdx lhs, CPhyloTree::TTreeIdx rhs) const
const CPhyloTree & m_Tree
NodeIdxSort(const CPhyloTree &t)
Fun TreeDepthFirst(TTreeModel &tree_model, typename TTreeModel::TTreeIdx node_idx, Fun func)
Depth-first tree traversal algorithm.
Fun TreeDepthFirstInvarient(TTreeModel &tree_model, typename TTreeModel::TTreeIdx node_idx, Fun func)
C++ wrappers for the Perl-compatible regular expression (PCRE) library.