NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CPriorityTaxNodes Class Reference

Search Toolkit Book for CPriorityTaxNodes

#include <algo/structure/cd_utils/cuPrefTaxNodes.hpp>

+ Collaboration diagram for CPriorityTaxNodes:

Public Types

enum  TaxNodeInputType {
  eCddPrefNodes = 1 , eCddModelOrgs = 2 , eCddOptional = 4 , eCddPrefNodesAll = 7 ,
  eRawTaxIds = 8
}
 

Public Member Functions

 CPriorityTaxNodes (TaxNodeInputType inputType)
 
 CPriorityTaxNodes (const string &prefTaxnodeFileName, TaxNodeInputType inputType)
 
 CPriorityTaxNodes (const CCdd_pref_nodes &prefNodes, TaxNodeInputType inputType)
 
 CPriorityTaxNodes (const vector< TTaxId > &taxids, TaxClient &taxClient, TaxNodeInputType inputType=eRawTaxIds)
 
virtual ~CPriorityTaxNodes ()
 
bool LoadFromFile (const string &prefTaxnodeFileName, bool doReset=false)
 
unsigned int Load (const CCdd_pref_nodes &prefNodes, bool doReset=false)
 
void Reset (TaxNodeInputType *inputType=NULL, bool forceClearAncestorMap=false)
 
bool IsLoaded ()
 
string GetLastError ()
 
TaxNodeInputType GetNodeInputType () const
 
bool IsPriorityTaxnode (TTaxId taxid)
 
bool GetPriorityTaxid (TTaxId taxidIn, TTaxId &priorityTaxid, TaxClient &taxClient)
 
bool GetPriorityTaxidAndName (TTaxId taxidIn, TTaxId &priorityTaxid, string &nodeName, TaxClient &taxClient)
 
int GetPriorityTaxnode (TTaxId taxid, string &nodeName, TaxClient *taxClient=NULL)
 
int GetPriorityTaxnode (TTaxId taxid, const OrgNode *&orgNode, TaxClient *taxClient=NULL)
 

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, TTaxIdTAncestorMap
 

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"
 

Detailed Description

Definition at line 56 of file cuPrefTaxNodes.hpp.

Member Typedef Documentation

◆ TAncestorMap

Definition at line 153 of file cuPrefTaxNodes.hpp.

Member Enumeration Documentation

◆ TaxNodeInputType

Enumerator
eCddPrefNodes 
eCddModelOrgs 
eCddOptional 
eCddPrefNodesAll 
eRawTaxIds 

Definition at line 61 of file cuPrefTaxNodes.hpp.

Constructor & Destructor Documentation

◆ CPriorityTaxNodes() [1/4]

CPriorityTaxNodes::CPriorityTaxNodes ( TaxNodeInputType  inputType)

Definition at line 48 of file cuPrefTaxNodes.cpp.

References LoadFromFile(), and PREF_TAXNODE_FILE.

◆ CPriorityTaxNodes() [2/4]

CPriorityTaxNodes::CPriorityTaxNodes ( const string prefTaxnodeFileName,
TaxNodeInputType  inputType 
)

Definition at line 54 of file cuPrefTaxNodes.cpp.

References LoadFromFile().

◆ CPriorityTaxNodes() [3/4]

CPriorityTaxNodes::CPriorityTaxNodes ( const CCdd_pref_nodes prefNodes,
TaxNodeInputType  inputType 
)

Definition at line 59 of file cuPrefTaxNodes.cpp.

References BuildMap(), and m_loaded.

◆ CPriorityTaxNodes() [4/4]

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().

◆ ~CPriorityTaxNodes()

CPriorityTaxNodes::~CPriorityTaxNodes ( )
virtual

Definition at line 76 of file cuPrefTaxNodes.cpp.

Member Function Documentation

◆ BuildMap()

void CPriorityTaxNodes::BuildMap ( const CCdd_pref_nodes prefNodes,
bool  reset = false 
)
private

◆ CddOrgRefSetToTaxIds()

unsigned int CPriorityTaxNodes::CddOrgRefSetToTaxIds ( const CCdd_org_ref_set cddOrgRefSet,
vector< TTaxId > &  taxids,
vector< int > *  notAddedIndices = NULL 
)
static

Definition at line 208 of file cuPrefTaxNodes.cpp.

References CCdd_org_ref_set_Base::Get(), getTaxId(), and ZERO_TAX_ID.

◆ findAncestor()

TaxidToOrgMap::iterator CPriorityTaxNodes::findAncestor ( TTaxId  taxid,
TaxClient taxClient 
)
private

◆ GetLastError()

string CPriorityTaxNodes::GetLastError ( )
inline

Definition at line 105 of file cuPrefTaxNodes.hpp.

References m_err.

◆ GetNodeInputType()

TaxNodeInputType CPriorityTaxNodes::GetNodeInputType ( ) const
inline

Definition at line 106 of file cuPrefTaxNodes.hpp.

References m_inputType.

◆ GetPriorityTaxid()

bool CPriorityTaxNodes::GetPriorityTaxid ( TTaxId  taxidIn,
TTaxId priorityTaxid,
TaxClient taxClient 
)

Definition at line 264 of file cuPrefTaxNodes.cpp.

References GetPriorityTaxidAndName().

◆ GetPriorityTaxidAndName()

bool CPriorityTaxNodes::GetPriorityTaxidAndName ( TTaxId  taxidIn,
TTaxId priorityTaxid,
string nodeName,
TaxClient taxClient 
)

◆ GetPriorityTaxnode() [1/2]

int CPriorityTaxNodes::GetPriorityTaxnode ( TTaxId  taxid,
const OrgNode *&  orgNode,
TaxClient taxClient = NULL 
)

◆ GetPriorityTaxnode() [2/2]

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().

◆ getTaxId()

TTaxId CPriorityTaxNodes::getTaxId ( const CRef< CCdd_org_ref > &  orgRef)
static

◆ getTaxName()

string CPriorityTaxNodes::getTaxName ( const CRef< CCdd_org_ref > &  orgRef)
static

◆ isActive()

bool CPriorityTaxNodes::isActive ( const CRef< CCdd_org_ref > &  orgRef)
static

Definition at line 175 of file cuPrefTaxNodes.cpp.

References CCdd_org_ref_Base::GetActive().

◆ IsLoaded()

bool CPriorityTaxNodes::IsLoaded ( )
inline

Definition at line 104 of file cuPrefTaxNodes.hpp.

References m_loaded.

◆ IsPriorityTaxnode()

bool CPriorityTaxNodes::IsPriorityTaxnode ( TTaxId  taxid)

◆ Load()

unsigned int CPriorityTaxNodes::Load ( const CCdd_pref_nodes prefNodes,
bool  doReset = false 
)

◆ LoadFromFile()

bool CPriorityTaxNodes::LoadFromFile ( const string prefTaxnodeFileName,
bool  doReset = false 
)

Definition at line 96 of file cuPrefTaxNodes.cpp.

References m_err, m_loaded, ReadPreferredTaxnodes(), and result.

Referenced by CPriorityTaxNodes().

◆ putIntoMap()

void CPriorityTaxNodes::putIntoMap ( const CCdd_org_ref_set orgRefs)
private

◆ ReadPreferredTaxnodes()

bool CPriorityTaxNodes::ReadPreferredTaxnodes ( const string fileName,
bool  reset = false 
)
private

Definition at line 114 of file cuPrefTaxNodes.cpp.

References BuildMap(), m_err, and ReadASNFromFile().

Referenced by LoadFromFile().

◆ Reset()

void CPriorityTaxNodes::Reset ( TaxNodeInputType inputType = NULL,
bool  forceClearAncestorMap = false 
)

◆ TaxIdsToCddOrgRefSet()

unsigned int CPriorityTaxNodes::TaxIdsToCddOrgRefSet ( const vector< TTaxId > &  taxids,
CCdd_org_ref_set cddOrgRefSet,
TaxClient taxClient,
vector< TTaxId > *  notAddedTaxids = NULL 
)
static

Member Data Documentation

◆ m_ancestralTaxNodeMap

TAncestorMap CPriorityTaxNodes::m_ancestralTaxNodeMap
private

Definition at line 154 of file cuPrefTaxNodes.hpp.

Referenced by findAncestor(), and Reset().

◆ m_err

string CPriorityTaxNodes::m_err
protected

Definition at line 141 of file cuPrefTaxNodes.hpp.

Referenced by GetLastError(), LoadFromFile(), ReadPreferredTaxnodes(), and Reset().

◆ m_inputType

TaxNodeInputType CPriorityTaxNodes::m_inputType
private

Definition at line 145 of file cuPrefTaxNodes.hpp.

Referenced by BuildMap(), GetNodeInputType(), and Reset().

◆ m_loaded

bool CPriorityTaxNodes::m_loaded
private

Definition at line 144 of file cuPrefTaxNodes.hpp.

Referenced by CPriorityTaxNodes(), IsLoaded(), LoadFromFile(), and Reset().

◆ m_selectedTaxNodesMap

TaxidToOrgMap CPriorityTaxNodes::m_selectedTaxNodesMap
private

◆ PREF_TAXNODE_FILE

const char * CPriorityTaxNodes::PREF_TAXNODE_FILE = "data/txnodes.asn"
staticprivate

Definition at line 58 of file cuPrefTaxNodes.hpp.

Referenced by CPriorityTaxNodes().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:03 2024 by modify_doxy.py rev. 669887