& feature_color,
45: m_Root(
NULL), m_Ostr(ostr)
47 Init(feature_name, feature_color,
tree);
51 const string& feature_color,
61 m_Error=
"Feature not in feature dictionary";
75CBioTreeDynamic::CBioNode& x_node,
79*
m_Ostr<<
"stack top: ";
106CBioTreeDynamic::CBioNode& x_node)
114 if(x_node.IsLeaf()) {
115pair<string, string> label_color
119 if(label_color.first.empty() || label_color.second.empty()) {
120 m_Error=
"Leafe node has unset feature, Id: " 128*
m_Ostr<<
"Leaf, m_CurrentGroupName put on stack: " 140CBioTreeDynamic::CBioNode& x_node)
143*
m_Ostr<<
"x_OnStepDown, Id: " 147 if(x_node.IsLeaf()) {
152*
m_Ostr<<
"Leaf, m_CurrentGroupName == DIFFERENT_GROUPS" 161 m_Error=
"Leafe node has unset feature, Id: " 175*
m_Ostr<<
" group name different, changing stack top to DIFFERENT_GROUPS" 183*
m_Ostr<<
" group name the same, stack top not changed" 193CBioTreeDynamic::CBioNode& x_node)
200 constpair<string, string> subtree_label_color =
m_LabelStack.top();
245 if(
m_LabelStack.top().first != subtree_label_color.first)
254 const string& color_feature,
256: m_LabelFeatureTag(label_feature),
257m_ColorFeatureTag(color_feature),
258m_FoundQueryNode(
false),
259m_FoundSeqFromType(
false),
260m_FoundSeqFromVerifiedMat(
false),
261m_FoundSeqReferenceDB(
false),
262m_FoundSeqKmerBlast(
false)
266 m_Error=
"Feature not in feature dictionary";
274CBioTreeDynamic::CBioNode& node,
321 constCBioTreeDynamic::CBioNode& node)
const 329 constCBioTreeDynamic::CBioNode& node)
const 336 constCBioTreeDynamic::CBioNode& node)
const 343 constCBioTreeDynamic::CBioNode& node)
const 351 const string& feature_color,
352 const string& feature_acc,
357 Init(feature_name, feature_color, feature_acc,
tree);
361 const string& feature_color,
362 const string& feature_acc,
383CBioTreeDynamic::CBioNode& x_node,
401*
m_Ostr<<
"Number of blast names ="<< nodeMap.
size() << endl;
402 for(
autoit = nodeMap.
begin(); it != nodeMap.
end(); ++it) {
403vector <CPhyTreeNodeAnalyzer::TLeafNodeInfo> vecInf = it->second;
404 stringprintStr = (vecInf.size() > 1) ?
" nodeIDs: ":
" nodeID: ";
405*
m_Ostr<<
"Blast name: "<< it->first << printStr;
406 for(
size_t i= 0;
i< vecInf.size();
i++){
407*
m_Ostr<< vecInf[
i].nodeID <<
",";
410printStr = (vecInf.size() > 1) ?
" Accessions: ":
" Accession: ";
412 for(
size_t i= 0;
i< vecInf.size();
i++){
413*
m_Ostr<< vecInf[
i].accession <<
",";
422vector <TLeafNodeInfo> vecLeafInfoNode;
425leafInfoNode.
nodeID= x_node.GetValue().GetId();
430vecLeafInfoNode.push_back(leafInfoNode);
441CBioTreeDynamic::CBioNode& x_node)
448 if(x_node.IsLeaf()) {
450 m_Error=
"Leaf node has unset feature, Id: " 461CBioTreeDynamic::CBioNode& x_node)
466 if(x_node.IsLeaf()) {
469 m_Error=
"Leaf node has unset feature, Id: " 484 for(
autoit = nodeMap2.
begin(); it != nodeMap2.
end(); ++it) {
485 if(mapResult.count(it->first) > 0 ) {
486vector <TLeafNodeInfo> vecInf2 = it->second;
487vector <TLeafNodeInfo> vecInf1 = mapResult[it->first];
488vecInf1.
insert(vecInf1.end(), vecInf2.begin(), vecInf2.end());
489mapResult[it->first].
insert(mapResult[it->first].
end(), vecInf2.begin(), vecInf2.end());
499CBioTreeDynamic::CBioNode& x_node)
static string GetFeatureTag(EFeatureID feat)
Get tree feature tag.
static const char * kNodeInfoSeqFromType
Node feature "node-info" value for sequences from type.
@ eNodeInfoId
Used for denoting query nodes.
static const char * kNodeInfoSeqReferenceDB
static const char * kNodeInfoQuery
Node feature "node-info" value for query nodes.
static const char * kNodeInfoSeqKmerBlast
static const char * kNodeInfoSeqFromVerifiedMat
bool x_IsSeqReferenceDB(const CBioTreeDynamic::CBioNode &node) const
CPhyTreeLabelTracker(const string &label, const string &color, CBioTreeDynamic &tree)
bool m_FoundSeqFromVerifiedMat
bool x_IsSeqKmerBlast(const CBioTreeDynamic::CBioNode &node) const
bool x_IsQuery(const CBioTreeDynamic::CBioNode &node) const
ETreeTraverseCode operator()(CBioTreeDynamic::CBioNode &node, int delta)
bool m_FoundSeqReferenceDB
bool x_IsSeqFromVerifiedMat(const CBioTreeDynamic::CBioNode &node) const
bool x_IsSeqFromType(const CBioTreeDynamic::CBioNode &node) const
TLabelColorMap m_LabelsColors
void x_InitLeafNodeStack(CBioTreeDynamic::CBioNode &x_node)
void x_PrintNodeMap(TLeafNodeInfoMap nodeMap)
stack< TLeafNodeInfoMap > m_InfoStack
CLabeledNodes m_LabeledNodes
ETreeTraverseCode x_OnStepLeft(CBioTreeDynamic::CBioNode &x_node)
TLeafNodeInfoMap x_CombineNodeMaps(TLeafNodeInfoMap nodeMap1, TLeafNodeInfoMap nodeMap2)
ETreeTraverseCode operator()(CBioTreeDynamic::CBioNode &node, int delta)
string m_LabelFeatureName
CPhyTreeNodeAnalyzer(const string &feature_name, const string &feature_acc, const string &feature_color, CBioTreeDynamic &tree, CNcbiOfstream *ostr=NULL)
string m_ColorFeatureName
ETreeTraverseCode x_OnStepRight(CBioTreeDynamic::CBioNode &x_node)
void Init(const string &feature_name, const string &feature_color, const string &feature_acc, CBioTreeDynamic &tree)
ETreeTraverseCode x_OnStepDown(CBioTreeDynamic::CBioNode &x_node)
map< string, vector< TLeafNodeInfo > > TLeafNodeInfoMap
ETreeTraverseCode operator()(CBioTreeDynamic::CBioNode &node, int delta)
bool x_IsRoot(CBioTreeDynamic::CBioNode *node) const
ETreeTraverseCode x_OnStepRight(CBioTreeDynamic::CBioNode &x_node)
stack< pair< string, string > > m_LabelStack
stack< TBioTreeNodeId > m_ParentIdStack
string m_ColorFeatureName
CBioTreeDynamic::CBioNode * m_Root
void Init(const string &feature_name, const string &feature_color, CBioTreeDynamic &tree)
CLabeledNodes m_LabeledNodes
CPhyTreeNodeGroupper(const string &feature_name, const string &feature_color, CBioTreeDynamic &tree, CNcbiOfstream *ostr=NULL)
ETreeTraverseCode x_OnStepLeft(CBioTreeDynamic::CBioNode &x_node)
string m_LabelFeatureName
ETreeTraverseCode x_OnStepDown(CBioTreeDynamic::CBioNode &x_node)
const_iterator begin() const
const_iterator end() const
iterator_bool insert(const value_type &val)
container_type::value_type value_type
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
ETreeTraverseCode
Tree traverse code returned by the traverse predicate function.
bool HasFeature(const string &feature_name) const
Check if feature is listed in the dictionary.
@ eTreeTraverseStop
Stop traversal (return form algorithm)
@ eTreeTraverse
Keep traversal.
static const char label[]
Int4 delta(size_t dimension_, const Int4 *score_)
static const string s_kDifferentGroups
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