NCBI C++ ToolKit
|
Search Toolkit Book for CPriorityTaxNodes
#include <algo/structure/cd_utils/cuPrefTaxNodes.hpp>
Public Types | |
enum | TaxNodeInputType { eCddPrefNodes = 1 , eCddModelOrgs = 2 , eCddOptional = 4 , eCddPrefNodesAll = 7 , eRawTaxIds = 8 } |
Static Public Member Functions | |
static string | getTaxName (const CRef< CCdd_org_ref > &orgRef) |
static TTaxId | getTaxId (const CRef< CCdd_org_ref > &orgRef) |
static bool | isActive (const CRef< CCdd_org_ref > &orgRef) |
static unsigned int | CddOrgRefSetToTaxIds (const CCdd_org_ref_set &cddOrgRefSet, vector< TTaxId > &taxids, vector< int > *notAddedIndices=NULL) |
static unsigned int | TaxIdsToCddOrgRefSet (const vector< TTaxId > &taxids, CCdd_org_ref_set &cddOrgRefSet, TaxClient &taxClient, vector< TTaxId > *notAddedTaxids=NULL) |
Protected Attributes | |
string | m_err |
Private Types | |
typedef map< TTaxId, TTaxId > | TAncestorMap |
Private Member Functions | |
TaxidToOrgMap::iterator | findAncestor (TTaxId taxid, TaxClient *taxClient) |
void | putIntoMap (const CCdd_org_ref_set &orgRefs) |
void | BuildMap (const CCdd_pref_nodes &prefNodes, bool reset=false) |
bool | ReadPreferredTaxnodes (const string &fileName, bool reset=false) |
Private Attributes | |
bool | m_loaded |
TaxNodeInputType | m_inputType |
TaxidToOrgMap | m_selectedTaxNodesMap |
TAncestorMap | m_ancestralTaxNodeMap |
Static Private Attributes | |
static const char * | PREF_TAXNODE_FILE = "data/txnodes.asn" |
Definition at line 56 of file cuPrefTaxNodes.hpp.
|
private |
Definition at line 153 of file cuPrefTaxNodes.hpp.
Enumerator | |
---|---|
eCddPrefNodes | |
eCddModelOrgs | |
eCddOptional | |
eCddPrefNodesAll | |
eRawTaxIds |
Definition at line 61 of file cuPrefTaxNodes.hpp.
CPriorityTaxNodes::CPriorityTaxNodes | ( | TaxNodeInputType | inputType | ) |
Definition at line 48 of file cuPrefTaxNodes.cpp.
References LoadFromFile(), and PREF_TAXNODE_FILE.
CPriorityTaxNodes::CPriorityTaxNodes | ( | const string & | prefTaxnodeFileName, |
TaxNodeInputType | inputType | ||
) |
Definition at line 54 of file cuPrefTaxNodes.cpp.
References LoadFromFile().
CPriorityTaxNodes::CPriorityTaxNodes | ( | const CCdd_pref_nodes & | prefNodes, |
TaxNodeInputType | inputType | ||
) |
Definition at line 59 of file cuPrefTaxNodes.cpp.
References BuildMap(), and m_loaded.
CPriorityTaxNodes::CPriorityTaxNodes | ( | const vector< TTaxId > & | taxids, |
TaxClient & | taxClient, | ||
TaxNodeInputType | inputType = eRawTaxIds |
||
) |
Definition at line 66 of file cuPrefTaxNodes.cpp.
References m_loaded, putIntoMap(), Reset(), and TaxIdsToCddOrgRefSet().
|
virtual |
Definition at line 76 of file cuPrefTaxNodes.cpp.
|
private |
Definition at line 126 of file cuPrefTaxNodes.cpp.
References CCdd_pref_nodes_Base::CanGetModel_organisms(), CCdd_pref_nodes_Base::CanGetOptional_nodes(), CCdd_pref_nodes_Base::CanGetPreferred_nodes(), eCddModelOrgs, eCddOptional, eCddPrefNodes, eRawTaxIds, CCdd_pref_nodes_Base::GetModel_organisms(), CCdd_pref_nodes_Base::GetOptional_nodes(), CCdd_pref_nodes_Base::GetPreferred_nodes(), m_inputType, putIntoMap(), and Reset().
Referenced by CPriorityTaxNodes(), Load(), and ReadPreferredTaxnodes().
|
static |
Definition at line 208 of file cuPrefTaxNodes.cpp.
References CCdd_org_ref_set_Base::Get(), getTaxId(), and ZERO_TAX_ID.
|
private |
Definition at line 230 of file cuPrefTaxNodes.cpp.
References map_checker< Container >::begin(), map_checker< Container >::end(), map_checker< Container >::find(), map_checker< Container >::insert(), TaxClient::IsTaxDescendant(), m_ancestralTaxNodeMap, m_selectedTaxNodesMap, and ZERO_TAX_ID.
Referenced by GetPriorityTaxidAndName(), and GetPriorityTaxnode().
|
inline |
Definition at line 105 of file cuPrefTaxNodes.hpp.
References m_err.
|
inline |
Definition at line 106 of file cuPrefTaxNodes.hpp.
References m_inputType.
bool CPriorityTaxNodes::GetPriorityTaxid | ( | TTaxId | taxidIn, |
TTaxId & | priorityTaxid, | ||
TaxClient & | taxClient | ||
) |
Definition at line 264 of file cuPrefTaxNodes.cpp.
References GetPriorityTaxidAndName().
bool CPriorityTaxNodes::GetPriorityTaxidAndName | ( | TTaxId | taxidIn, |
TTaxId & | priorityTaxid, | ||
string & | nodeName, | ||
TaxClient & | taxClient | ||
) |
Definition at line 270 of file cuPrefTaxNodes.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), findAncestor(), getTaxName(), kEmptyStr, m_selectedTaxNodesMap, result, and ZERO_TAX_ID.
Referenced by GetPriorityTaxid().
int CPriorityTaxNodes::GetPriorityTaxnode | ( | TTaxId | taxid, |
const OrgNode *& | orgNode, | ||
TaxClient * | taxClient = NULL |
||
) |
Definition at line 297 of file cuPrefTaxNodes.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), findAncestor(), m_selectedTaxNodesMap, NULL, OrgNode::order, and ZERO_TAX_ID.
int CPriorityTaxNodes::GetPriorityTaxnode | ( | TTaxId | taxid, |
string & | nodeName, | ||
TaxClient * | taxClient = NULL |
||
) |
Definition at line 322 of file cuPrefTaxNodes.cpp.
References getTaxName(), kEmptyStr, NULL, OrgNode::order, and OrgNode::orgRef.
Referenced by CTaxNRCriteria::Apply().
|
static |
Definition at line 164 of file cuPrefTaxNodes.cpp.
References CCdd_org_ref_Base::CanGetReference(), CCdd_org_ref_Base::GetReference(), COrg_ref::GetTaxId(), and ZERO_TAX_ID.
Referenced by CddOrgRefSetToTaxIds(), and putIntoMap().
|
static |
Definition at line 151 of file cuPrefTaxNodes.cpp.
References CCdd_org_ref_Base::CanGetReference(), CCdd_org_ref_Base::GetReference(), COrg_ref_Base::GetTaxname(), COrg_ref_Base::IsSetTaxname(), and kEmptyStr.
Referenced by GetPriorityTaxidAndName(), and GetPriorityTaxnode().
|
static |
Definition at line 175 of file cuPrefTaxNodes.cpp.
References CCdd_org_ref_Base::GetActive().
|
inline |
Definition at line 104 of file cuPrefTaxNodes.hpp.
References m_loaded.
Definition at line 258 of file cuPrefTaxNodes.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), and m_selectedTaxNodesMap.
unsigned int CPriorityTaxNodes::Load | ( | const CCdd_pref_nodes & | prefNodes, |
bool | doReset = false |
||
) |
Definition at line 107 of file cuPrefTaxNodes.cpp.
References BuildMap(), m_selectedTaxNodesMap, and map_checker< Container >::size().
Definition at line 96 of file cuPrefTaxNodes.cpp.
References m_err, m_loaded, ReadPreferredTaxnodes(), and result.
Referenced by CPriorityTaxNodes().
|
private |
Definition at line 139 of file cuPrefTaxNodes.cpp.
References CCdd_org_ref_set_Base::Get(), getTaxId(), i, map_checker< Container >::insert(), m_selectedTaxNodesMap, and map_checker< Container >::size().
Referenced by BuildMap(), and CPriorityTaxNodes().
|
private |
Definition at line 114 of file cuPrefTaxNodes.cpp.
References BuildMap(), m_err, and ReadASNFromFile().
Referenced by LoadFromFile().
void CPriorityTaxNodes::Reset | ( | TaxNodeInputType * | inputType = NULL , |
bool | forceClearAncestorMap = false |
||
) |
Definition at line 80 of file cuPrefTaxNodes.cpp.
References map_checker< Container >::clear(), m_ancestralTaxNodeMap, m_err, m_inputType, m_loaded, and m_selectedTaxNodesMap.
Referenced by BuildMap(), and CPriorityTaxNodes().
|
static |
Definition at line 180 of file cuPrefTaxNodes.cpp.
References TaxClient::GetOrgRef(), i, CRef< C, Locker >::NotEmpty(), CCdd_org_ref_set_Base::Set(), CCdd_org_ref_Base::SetActive(), and CCdd_org_ref_Base::SetReference().
Referenced by CPriorityTaxNodes().
|
private |
Definition at line 154 of file cuPrefTaxNodes.hpp.
Referenced by findAncestor(), and Reset().
|
protected |
Definition at line 141 of file cuPrefTaxNodes.hpp.
Referenced by GetLastError(), LoadFromFile(), ReadPreferredTaxnodes(), and Reset().
|
private |
Definition at line 145 of file cuPrefTaxNodes.hpp.
Referenced by BuildMap(), GetNodeInputType(), and Reset().
|
private |
Definition at line 144 of file cuPrefTaxNodes.hpp.
Referenced by CPriorityTaxNodes(), IsLoaded(), LoadFromFile(), and Reset().
|
private |
Definition at line 148 of file cuPrefTaxNodes.hpp.
Referenced by findAncestor(), GetPriorityTaxidAndName(), GetPriorityTaxnode(), IsPriorityTaxnode(), Load(), putIntoMap(), and Reset().
|
staticprivate |
Definition at line 58 of file cuPrefTaxNodes.hpp.
Referenced by CPriorityTaxNodes().