OnActivate(wxTreeEvent& event);
99wxFrame(parent, -1, "Taxonomy Tree", wxPoint(75,75), wxSize(400,400),
100wxDEFAULT_FRAME_STYLE
101 #if defined(__WXMSW__) 102| wxFRAME_TOOL_WINDOW | wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT
108 tree=
newwxTreeCtrl(
this, -1, wxPoint(0,0), GetClientSize());
109SetIcon(wxICON(cn3d));
118 static void ExpandAll(wxTreeCtrl&
tree,
constwxTreeItemId&
id,
boolshouldExpand,
inttoLevel)
120 if(toLevel == 0 || !
tree.ItemHasChildren(
id))
return;
123 boolisExpanded =
tree.IsExpanded(
id);
124 if(shouldExpand && !isExpanded)
126 else if(!shouldExpand && isExpanded)
127 tree.Collapse(
id);
130wxTreeItemIdValue cookie = &
tree;
131 for(wxTreeItemId child=
tree.GetFirstChild(
id, cookie); child.IsOk(); child=
tree.GetNextChild(
id, cookie))
137 constwxTreeItemId& itemID =
event.GetItem();
138 boolkeyActivated = (
event.GetPoint().x == 0 &&
event.GetPoint().y == 0);
139 boolhasChildren =
tree->ItemHasChildren(itemID);
141 if(keyActivated && hasChildren) {
146 else if(!keyActivated && !hasChildren) {
169 INFOMSG(
"taxonomy server connection initialized");
171 ERRORMSG(
"Unable to initialize taxonomy server!");
182(**w)->handle =
NULL;
214wxString name(s->first->identifier->ToString().c_str());
217name.Printf(
"%s (x%i)",
tmp.c_str(), s->second);
219 constwxTreeItemId& child =
tree->AppendItem(
id, name);
229wxString name = childNode->
name.c_str();
234 if(childNode->
name!= name.c_str())
235name += wxString(
" . . . ") + childNode->
name.c_str();
239wxTreeItemId childId =
tree->AppendItem(
id, name);
280 if(!taxData)
continue;
286 if(parent == 0)
break;
289 AddNode(&taxTree, seq, taxid, taxData, parent);
296 if(!taxData)
break;
300taxTree[1].name =
"Global Root";
301 TRACEMSG(
"apparent # leaves in tree: "<< taxTree[1].nDescendentLeaves);
304 INFOMSG(
"deepest node containing all leaves: "<< node->
name);
313window->Show(
true);
325 if(!
Init())
return0;
327 stringerr =
"no gi or source info";
338 if(taxid == 0 && seq->
bioseqASN->IsSetDescr()) {
339CBioseq::TDescr::Tdata::const_iterator d, de = seq->
bioseqASN->GetDescr().Get().end();
340 for(d=seq->
bioseqASN->GetDescr().Get().begin(); d!=de; ++d) {
343org = &((*d)->GetOrg());
344 else if((*d)->IsSource())
345org = &((*d)->GetSource().GetOrg());
358<<
"; reason: "<< err);
368TaxonomyInfoMap::const_iterator
i=
taxonomyInfo.find(taxid);
377 WARNINGMSG(
"Unable to get taxonomy data for taxid "<< taxid
382 return data.GetPointer();
392 if(!
Init())
return0;
397 WARNINGMSG(
"Unable to get parent for taxid "<< taxid
const Sequence * GetSequenceOfRow(unsigned int row) const
unsigned int NRows(void) const
void HighlightAndShowSequence(const Sequence *sequence)
std::string ToString(void) const
static const TGi GI_NOT_SET
NodeData(const Sequence *s)
const Sequence * sequence
const MoleculeIdentifier * identifier
CConstRef< objects::CBioseq > bioseqASN
map< int, bool > ChildTaxIDMap
map< const Sequence *, int > SequenceMap
ChildTaxIDMap childTaxids
int GetTaxIDForSequence(const Sequence *seq)
int GetParentTaxID(int taxid)
ncbi::objects::CTaxon1 taxonomyServer
TaxonomyWindowList taxonomyWindows
TaxonomyIDMap taxonomyIDs
TaxonomyInfoMap taxonomyInfo
TaxonomyParentMap taxonomyParents
const ncbi::objects::CTaxon2_data * GetTaxInfoForTaxID(int taxid)
void ShowTreeForAlignment(wxFrame *parent, const BlockMultipleAlignment *alignment, bool abbreviated)
void OnActivate(wxTreeEvent &event)
container_type::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
bool IsSetOrg(void) const
Org-ref with Org-name and db filled in Check if a value has been assigned to Org data member.
const TOrg & GetOrg(void) const
Get the Org member data.
Messenger * GlobalMessenger(void)
#define row(bind, expected)
static void ExpandAll(wxTreeCtrl &tree, const wxTreeItemId &id, bool shouldExpand, int toLevel)
static void AppendChildrenToTree(wxTreeCtrl *tree, const TaxonomyTreeMap &treeMap, const TaxonomyTreeNode &node, const wxTreeItemId id, bool abbreviated)
static void AddNode(TaxonomyTreeMap *taxTree, const Sequence *seq, int taxid, const CTaxon2_data *taxData, int parent)
map< int, TaxonomyTreeNode > TaxonomyTreeMap
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