74 virtual long GetIntValue(
size_t row,
size_t col)
const;
75 virtual double GetRealValue(
size_t row,
size_t col)
const;
126 CBioTreeContainer::GetTypeInfo(),
131 CBioTreeContainer::GetTypeInfo(),
150 if (!gi_str.empty()) {
161 string lcl_sid =
"lcl|";
162 lcl_sid.append(seq_id);
175 table_data->
m_Object =
object.object;
176 table_data->
m_Scope =
object.scope;
237 if (errno != ERANGE) {
246 if ((*it)->CanGetId())
300 catch (
const std::exception& e) {
301 LOG_POST(
Error <<
"CTableDataBioTreeContainer: " << e.what());
327 catch (
const std::exception& e) {
328 LOG_POST(
Error <<
"CTableDataBioTreeContainer: " << e.what());
352 catch (
const std::exception& e) {
355 LOG_POST(
"Value range error: " << strval);
357 LOG_POST(
Error <<
"CTableDataBioTreeContainer: " << e.what());
378 bool sid_res_status =
false;
392 sid_res_status =
true;
399 if (!sid_res_status) {
403 if (!gi_str.empty()) {
405 sid_res_status =
true;
414 if (!sid_res_status) {
416 string lcl_sid =
"lcl|";
417 lcl_sid.append(seq_id);
419 sid_res_status =
true;
426 if (sid_res_status) {
427 value.object.Reset(
id.GetPointer());
459 if (feat_value.empty())
468 selectedNodes.push_back(
i);
486 selectedNodes.push_back(
i);
493 vector<string> selected_feature_values;
494 selected_feature_values.reserve(selection.
GetNodeIds().size());
498 if (feat_val.empty())
500 selected_feature_values.push_back(feat_val);
505 ITERATE(vector<string>, itFeatValue, selected_feature_values) {
511 if (feat_value.empty())
513 if (*itFeatValue != feat_value)
516 selectedNodes.push_back(
i);
523 string feature_value;
528 if ((*it)->GetFeatureid() == feature_id) {
529 feature_value = (*it)->GetValue();
535 return feature_value;
554 unsigned selectionMode = selectNone;
561 bioTreeSelection =
dynamic_cast<const CBioTreeSelection*
>(objs[0].GetNonNullPointer());
564 selectionMode = selectSeqIds | selectTaxIds;
572 if (selectNone == selectionMode) {
575 selectionMode = selectNodeIds;
588 dstFeatId = dstTree->GetFeatureId(*it);
596 if (feat_name ==
"seq-id")
597 selectionMode = selectSeqIds;
598 else if (feat_name ==
"tax-id" || feat_name ==
"taxid")
599 selectionMode = selectTaxIds;
601 selectionMode = selectFeatures;
605 switch(selectionMode)
611 rows.reserve(nodeIds.size());
613 int row = bc.
FindRow((
int)(*nodeId));
630 case selectFeatures :
644 nodeIds.reserve(rows.size());
645 ITERATE(vector<size_t>, rowNum, rows) {
649 if (!node->CanGetId())
651 nodeIds.push_back(node->GetId());
653 if (!nodeIds.empty())
661 string feat_val = bioTreeSelection->GetFeatureValue(*iter, seqidFeatId);
662 if (feat_val.empty())
676 taxidFeatId = bioTreeSelection->GetFeatureId(
"taxid");
681 string feat_val = bioTreeSelection->GetFeatureValue(*iter, taxidFeatId);
682 if (feat_val.empty())
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.
User-defined methods of the data storage class.
Defines CBioTreeSelection, class used to broadcast selected tree nodes between views.
const TNodeIdsVector & GetNodeIds() const
Returns const list of selected nodes.
std::vector< objects::CNode::TId > TNodeIdsVector
Vector of node IDs.
std::string GetFeatureValue(objects::CNode::TId nodeId, objects::CFeatureDescr::TId featureId) const
Gets the value of a feature for the specified node id.
objects::CFeatureDescr::TId GetFeatureId(const std::string &feature) const
Gets the id of the specified feature.
CConstRef< objects::CBioTreeContainer > GetBioTree() const
Returns the BioTree.
static void RegisterFactory(const string &interface_name, IInterfaceFactory *factory)
CSelectionEvent CSelectionEvent is used for broadcasting selection between views.
vector< CConstRef< objects::CSeq_id > > TIds
const TTaxIds & GetTaxIDs() const
static bool sm_TreeBroadcastOneToOne
Node properties used to compare trees when broadcasting.
void AddTaxIDSelection(TTaxId tid)
void GetIndexed(const string &area_name, TConstObjects &objs) const
Get Objects from the private broadcasting area (caller has to make sure output objs is empty)
static vector< string > sm_TreeBroadcastProperties
broadcast sel. between documents
void AddIndexed(const string &area_name, const CObject &obj)
Add private selection broadcasting info.
const TIds & GetIds() const
bool AddObjectSelection(const CObject &obj)
vector< pair< int, ColInfo > > m_FeatureDescr
CRef< objects::CScope > m_Scope
CConstRef< CNode > GetNode(size_t row) const
virtual ColumnType GetColumnType(size_t col) const
vector< CRef< CNode > > m_Nodes
virtual size_t GetRowsCount() const
virtual long GetIntValue(size_t row, size_t col) const
static CTableDataBioTreeContainer * CreateObject(SConstScopedObject &object, ICreateParams *params)
virtual void GetStringValue(size_t row, size_t col, string &value) const
TNodeIdRowMap m_NodeIdRows
CConstRef< CObject > m_Object
int FindRow(int nodeId) const
virtual SConstScopedObject GetObjectValue(size_t row, size_t col) const
virtual string GetColumnLabel(size_t col) const
map< CNode::TId, size_t > TNodeIdRowMap
void SelectSeqIds(const CSelectionEvent::TIds &ids, CFeatureDescr::TId seqidFeatId, vector< size_t > &selectedNodes) const
CRef< CScope > GetScope()
virtual double GetRealValue(size_t row, size_t col) const
void SelectTaxIds(const CSelectionEvent::TTaxIds &tids, CFeatureDescr::TId taxidFeatId, vector< size_t > &selectedNodes) const
string x_GetNodeFeature(int feature_id, const CNode &node) const
virtual size_t GetColsCount() const
void SelectFeatures(const CBioTreeSelection &selection, CFeatureDescr::TId srcFeatId, CFeatureDescr::TId dstFeatId, vector< size_t > &selectedNodes) const
static CTableSelectionBioTreeContainer * CreateObject(SConstScopedObject &object, ICreateParams *params)
virtual void GetRows(const ITableData &table, const CSelectionEvent &evt, vector< size_t > &rows) const
vector< string > TStringVector
bool x_StringToSeqId(const string &seq_id, CRef< CSeq_id > &id) const
virtual void GetSelection(const ITableData &table, const vector< size_t > &rows, CSelectionEvent &evt) const
Class designed to hold a set of tax-ids represented as (on) bits in a bit vector.
bool IsSelected(TTaxId tid) const
container_type::const_iterator const_iterator
const_iterator end() const
const_iterator find(const key_type &key) const
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
static bool GetGIString(const string &sid, string *gi_str)
ad-hoc GI extraction (for misformed seq-id strings like: "gi|55823257|ref|YP_141698....
vector< CConstRef< CObject > > TConstObjects
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
CConstRef< CSeq_id > GetSeqId(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
@ e_YES
SeqIds compared, but are different.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
TObjectType * GetNonNullPointer(void) const
Get pointer value and throw a null pointer exception if pointer is null.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
static double StringToDoublePosix(const char *str, char **endptr=0, TStringToNumFlags flags=0)
Convert string to double-precision value (analog of strtod function)
static long StringToLong(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to long.
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
TId GetId(void) const
Get the Id member data.
list< CRef< CFeatureDescr > > Tdata
bool CanGetParent(void) const
Check if it is safe to call GetParent method.
TParent GetParent(void) const
Get the Parent member data.
list< CRef< CNodeFeature > > Tdata
bool CanGetFeatures(void) const
Check if it is safe to call GetFeatures method.
list< CRef< CNode > > Tdata
const Tdata & Get(void) const
Get the member data.
const Tdata & Get(void) const
Get the member data.
const TFdict & GetFdict(void) const
Get the Fdict member data.
const TFeatures & GetFeatures(void) const
Get the Features member data.
const Tdata & Get(void) const
Get the member data.
const TNodes & GetNodes(void) const
Get the Nodes member data.
unsigned int
A callback function used to compare two keys in a database.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
ColInfo(const string &n, ITableData::ColumnType t)
ITableData::ColumnType m_Type
void initCTableDataBioTreeContainer()
bool StringToSeqId(const string &seq_id, CRef< CSeq_id > &id)
static const char *const features[]