use_vdb_index =
NCBI_PARAM_TYPE(VDBGRAPH, USE_VDB_INDEX)::GetDefault();
68 return!use_vdb_index;
115 boolanother_vdb =
false;
129 "Cannot open VDB graph table: "<<path,
140 TVDBRowIdlast_row = curs->m_Cursor.GetMaxRowId();
144 ERR_POST(
Warning<<
"CVDBGraphDb: sid index not found. Scanning sequentially.");
150 if( *seq_id ==
info.m_SeqId ) {
153 info.m_SeqLength = start +
len;
156 if( !
info.m_SeqId.empty() ) {
159 info.m_SeqId = *seq_id;
165 if( !
info.m_SeqId.empty() ) {
166 info.m_RowLast = last_row;
173 info.m_SeqId = *seq_id;
175 info.m_RowSize = *curs->LEN(
row);
181 if( range.second > 1 ) {
182 row+= range.second-1;
223 boolret = curs->m_GR_ZOOM_Q100;
234 return*iter->second;
238 autocurs =
Graph();
240 if(
id.
empty() ) {
247 info.m_RowFirst = first_row;
248 TSeqPosfirst_len = *curs->LEN(first_row);
249 info.m_RowSize = first_len;
251 _ASSERT(first_row == range.first);
253 if( range.second > 1 ) {
255 TVDBRowIdlast_row = first_row + range.second - 1;
256 info.m_RowLast = last_row;
258 TSeqPoslast_len = *curs->LEN(last_row);
259 info.m_SeqLength = last_start + last_len;
263 info.m_RowLast = first_row;
265 info.m_SeqLength = first_start + first_len;
279 return*iter->second;
284 const CTextseq_id* text_id = seq_id->GetTextseq_Id();
292 autocurs =
Graph();
294 if( !range.second ) {
298 autofirst_row = range.first;
301 info.m_Seq_id_Handle = idh;
302 info.m_RowFirst = first_row;
303 TSeqPosfirst_len = *curs->LEN(first_row);
304 info.m_RowSize = first_len;
305 if( range.second > 1 ) {
307 TVDBRowIdlast_row = first_row + range.second - 1;
308 info.m_RowLast = last_row;
310 TSeqPoslast_len = *curs->LEN(last_row);
311 info.m_SeqLength = last_start + last_len;
315 info.m_RowLast = first_row;
317 info.m_SeqLength = first_start + first_len;
356 "CVDBGraphSeqIterator is invalid");
362 template<
classDstVector,
classSrcVector>
363 static void sx_Assign(DstVector& dst,
constSrcVector& src)
366dst.reserve(src.size());
367 ITERATE(
typenameSrcVector, it, src ) {
388 if( !annot_name.empty() ) {
397 constTValue kMinIntValue =
kMin_I4;
398 constTValue kMaxIntValue =
kMax_I4;
399 constTValue kMinByteValue = 0;
400 constTValue kMaxByteValue =
kMax_UI1;
414 for(
size_tindex = pos%row_size/step;
416++index, pos += step ) {
417TValue v = values[index];
418 boolswitch_to_real =
false;
421switch_to_real = v < kMinIntValue;
425switch_to_real = v > kMaxIntValue;
427 if( switch_to_real && int_vv ) {
430real_graph = &graph->
SetGraph().SetReal();
437int_vv->push_back(
int(v));
440real_vv->push_back(
double(v));
444pos < (
row-
info.m_RowFirst+1)*row_size ) {
446 "CVDBGraphSeqIterator: graph data array is too short");
450 if( min_v >= kMinByteValue && max_v <= kMaxByteValue ) {
452numval = int_vv->size();
454byte_graph->SetAxis(0);
455byte_graph->SetMin(
int(min_v));
456byte_graph->SetMax(
int(max_v));
457 sx_Assign(byte_graph->SetValues(), *int_vv);
458graph->
SetGraph().SetByte(*byte_graph);
462 else if( real_graph ) {
464numval = real_vv->size();
466real_graph->
SetMin(
double(min_v));
467real_graph->
SetMax(
double(max_v));
471numval = int_vv->size();
473int_graph->
SetMin(
int(min_v));
474int_graph->
SetMax(
int(max_v));
481graph->
SetA(1./scale);
483 if( numval >
size_t(
kMax_Int) ) {
485 "CVDBGraphSeqIterator::x_MakeGraph: graph too big");
502 constTValue kMinIntValue =
kMin_I4;
503 constTValue kMaxIntValue =
kMax_I4;
505TValue min_v = 0, max_v = 0;
510 for( ; pos < range.
GetToOpen(); ++
row, pos += row_size ) {
515TValue v = vv_arr[off+
i];
527 table->SetFeat_type(0);
531 table->SetColumns().push_back(col_id);
532col_id->
SetHeader().SetField_name(
"Seq-table location");
537 table->SetColumns().push_back(col_id);
544 table->SetColumns().push_back(col_pos);
550 table->SetColumns().push_back(col_span);
551col_span->
SetHeader().SetField_name(
"span");
555 table->SetColumns().push_back(col_val);
556col_val->
SetHeader().SetField_name(
"values");
559TValue cur_v = vv[0];
560 if( min_v < kMinIntValue || max_v > kMaxIntValue ) {
565arr_pos.push_back(cur_i+range.
GetFrom());
566arr_span.push_back(
i-cur_i);
567arr_vv.push_back(
double(cur_v));
572arr_pos.push_back(cur_i+range.
GetFrom());
573arr_span.push_back(
size-cur_i);
574arr_vv.push_back(
double(cur_v));
581arr_pos.push_back(cur_i+range.
GetFrom());
582arr_span.push_back(
i-cur_i);
583arr_vv.push_back(
int(cur_v));
588arr_pos.push_back(cur_i+range.
GetFrom());
589arr_span.push_back(
size-cur_i);
590arr_vv.push_back(
int(cur_v));
596 table->SetColumns().push_back(col_step);
597col_step->
SetHeader().SetField_name(
"value_step");
600 if( arr_pos.size() >
size_t(
kMax_Int) ) {
602 "CVDBGraphSeqIterator::x_MakeTable: graph too big");
604 table->SetNum_rows(
int(arr_pos.size()));
612 if( !cursor.m_NUM_SWITCHES ) {
617 constTValue kMinIntValue =
kMin_I4;
618 constTValue kMaxIntValue =
kMax_I4;
619 constTValue kMinByteValue = 0;
620 constTValue kMaxByteValue =
kMax_UI1;
621TValue min_v = 0, max_v = 0;
628 for( ; pos < range.
GetToOpen(); ++
row, pos += row_size ) {
630switches += *cursor.NUM_SWITCHES(
info.m_RowFirst+
row);
631TValue v = cursor.GR_Q100(
info.m_RowFirst+
row);
639 size_ttable_value_size =
640min_v < kMinIntValue || max_v > kMaxIntValue?
sizeof(double):
sizeof(
int);
641 size_tgraph_value_size =
642min_v < kMinByteValue || max_v > kMaxByteValue? table_value_size: 1;
644(table_value_size+2*
sizeof(
int))*switches;
646graph_value_size*values;
647 returntable_size < graph_size;
657 if( range.
Empty() ) {
664 returnseq_table_is_smaller;
670 const string& annot_name,
677 if( range0.
Empty() ) {
683 if( !annot_name.empty() ) {
686annot->
SetDesc().Set().push_back(desc);
695 "several zoom tracks are requested");
718obj.
SetType().SetStr(
"AnnotationTrack");
719obj.
AddField(
"ZoomLevel",
int(step));
720obj.
AddField(
"StatisticsType",
"Percentiles");
721annot->
SetDesc().Set().push_back(desc);
725 if( !(content &
f) ) {
732step, *curs, curs->m_GR_Q0 , 0);
736step, *curs, curs->m_GR_Q10 , 10);
740step, *curs, curs->m_GR_Q50 , 50);
744step, *curs, curs->m_GR_Q90 , 90);
748step, *curs, curs->m_GR_Q100, 100);
754annot->
SetData().SetGraph().push_back(graph);
762 "several zoom tracks are requested");
785obj.
SetType().SetStr(
"AnnotationTrack");
786obj.
AddField(
"ZoomLevel",
int(step));
787obj.
AddField(
"StatisticsType",
"Percentiles");
788annot->
SetDesc().Set().push_back(desc);
792 if( !(content &
f) ) {
799step, *curs, curs->m_GR_ZOOM_Q0 , 0);
803step, *curs, curs->m_GR_ZOOM_Q10 , 10);
807step, *curs, curs->m_GR_ZOOM_Q50 , 50);
811step, *curs, curs->m_GR_ZOOM_Q90 , 90);
815step, *curs, curs->m_GR_ZOOM_Q100, 100);
821annot->
SetData().SetGraph().push_back(graph);
834 boolas_table =
false;
848obj.
SetType().SetStr(
"Track Data");
849obj.
AddField(
"track type",
"graph");
850annot->
SetDesc().Set().push_back(desc);
8591, *curs, curs->m_GRAPH, -1);
860annot->
SetData().SetGraph().push_back(graph);
@ eNotFoundTable
DB table not found.
virtual TErrCode GetErrCode(void) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
CUser_object & AddField(const string &label, const string &value, EParseField parse=eParse_String)
add a data field to the user object that holds a given value
CVDBTableIndex m_LookupIndex
CRef< SGraphTableCursor > Graph(void)
bool HasMidZoomGraphs(void)
CVDBObjectCache< SGraphTableCursor > m_Graph
TSeqInfoMapBySeq_id m_SeqMapBySeq_id
CVDBGraphDb_Impl(CVDBMgr &mgr, CTempString path, ELookupType lookup_type=eLookupDefault)
SSeqInfo GetSeqInfoAtRow(TVDBRowId row)
void Put(CRef< SGraphTableCursor > &curs)
bool LookupIsInMemory() const
SSeqInfo GetSeqInfo(const CSeq_id_Handle &seq_id)
TSeqInfoMapByFirstRow m_SeqMapByFirstRow
const CVDBTable & GraphTable(void)
virtual ~CVDBGraphDb_Impl(void)
list< SSeqInfo > TSeqInfoList
CVDBGraphDb_Impl::SSeqInfo m_Info
bool x_SeqTableIsSmaller(COpenRange< TSeqPos > range, SGraphTableCursor &cursor) const
CVDBGraphDb_Impl & GetDb(void) const
bool SeqTableIsSmaller(COpenRange< TSeqPos > range) const
CRef< CSeq_graph > x_MakeGraph(const string &annot_name, CSeq_loc &loc, const SSeqInfo &info, const COpenRange< TSeqPos > &range, TSeqPos step, SGraphTableCursor &cursor, CVDBColumn &column, int level) const
CVDBGraphSeqIterator & operator++(void)
CRef< CSeq_table > x_MakeTable(const string &annot_name, CSeq_loc &loc, const SSeqInfo &info, const COpenRange< TSeqPos > &range, SGraphTableCursor &cursor) const
CVDBGraphSeqIterator(void)
CRef< CSeq_annot > GetAnnot(COpenRange< TSeqPos > range, const string &annot_name=kEmptyStr, TContentFlags content=fDefaultContent) const
const SSeqInfo & GetInfo(void) const
TVDBRowIdRange Find(const string &value) const
const_iterator end() const
iterator_bool insert(const value_type &val)
container_type::value_type value_type
const_iterator find(const key_type &key) const
The NCBI C++ standard methods for dealing with std::string.
static const char * column
NCBI_DEFINE_ERR_SUBCODE_X(1)
NCBI_PARAM_DECL(bool, VDBGRAPH, USE_VDB_INDEX)
static void sx_Assign(DstVector &dst, const SrcVector &src)
NCBI_PARAM_DEF_EX(bool, VDBGRAPH, USE_VDB_INDEX, true, eParam_NoThread, VDBGRAPH_USE_VDB_INDEX)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
C * SerialClone(const C &src)
Create on heap a clone of the source object.
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.
TObjectType & GetNCObject(void) const
Get object.
#define NCBI_PARAM_TYPE(section, name)
Generate typename for a parameter from its {section, name} attributes.
@ eParam_NoThread
Do not use per-thread values.
position_type GetLength(void) const
TThisType & SetFrom(position_type from)
position_type GetTo(void) const
TThisType & SetToOpen(position_type toOpen)
position_type GetToOpen(void) const
position_type GetFrom(void) const
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static string & ToUpper(string &str)
Convert string to upper case â string& version.
void SetType(TType &value)
Assign a value to Type data member.
void SetHeader(THeader &value)
Assign a value to Header data member.
void SetData(TData &value)
Assign a value to Data data member.
void SetDefault(TDefault &value)
Assign a value to Default data member.
@ eField_id_location_id
location Seq-id
@ eField_id_location_from
interval from
bool IsSetAccession(void) const
Check if a value has been assigned to Accession data member.
TVersion GetVersion(void) const
Get the Version member data.
bool IsSetRelease(void) const
Check if a value has been assigned to Release data member.
bool IsSetVersion(void) const
Check if a value has been assigned to Version data member.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
const TAccession & GetAccession(void) const
Get the Accession member data.
void SetA(TA value)
Assign a value to A data member.
void SetAxis(TAxis value)
Assign a value to Axis data member.
void SetTitle(const TTitle &value)
Assign a value to Title data member.
TValues & SetValues(void)
Assign a value to Values data member.
void SetAxis(TAxis value)
Assign a value to Axis data member.
void SetNumval(TNumval value)
Assign a value to Numval data member.
void SetComp(TComp value)
Assign a value to Comp data member.
void SetGraph(TGraph &value)
Assign a value to Graph data member.
void SetMax(TMax value)
Assign a value to Max data member.
void SetMax(TMax value)
Assign a value to Max data member.
void SetComment(const TComment &value)
Assign a value to Comment data member.
void SetLoc(TLoc &value)
Assign a value to Loc data member.
void SetMin(TMin value)
Assign a value to Min data member.
void SetMin(TMin value)
Assign a value to Min data member.
TValues & SetValues(void)
Assign a value to Values data member.
void SetData(TData &value)
Assign a value to Data data member.
void SetDesc(TDesc &value)
Assign a value to Desc data member.
TName & SetName(void)
Select the variant.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
TUser & SetUser(void)
Select the variant.
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in SRA C++ support libraries.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
#define NCBI_THROW2_FMT(exception_class, err_code, message, extra)
#define row(bind, expected)
SGraphTableCursor(const CVDBTable &table)
#define INIT_VDB_COLUMN(name)
pair< TVDBRowId, TVDBRowCount > TVDBRowIdRange
#define INIT_OPTIONAL_VDB_COLUMN(name)
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