62 m_FeatProduct(feat_product),
64 m_OverlapType(eOverlap_Intervals),
65 m_ResolveMethod(eResolve_TSE),
66 m_SortOrder(eSortOrder_Normal),
67 m_LimitObjectType(eLimit_None),
68 m_UnresolvedFlag(eIgnoreUnresolved),
71 m_MaxSearchTime(FLT_MAX),
72 m_MaxSearchSegmentsAction(eMaxSearchSegmentsThrow),
74 m_AdaptiveDepthFlags(kAdaptive_None),
76 m_ExcludeExternal(
false),
77 m_CollectSeq_annots(
false),
78 m_CollectTypes(
false),
79 m_CollectNames(
false),
80 m_CollectCostOfLoading(
false),
81 m_IgnoreStrand(
false),
82 m_HasWildcardInAnnotsNames(
false),
85 m_ExcludeIfGeneIsSuppressed(
false),
86 m_SNPScaleLimit(
CSeq_id::eSNPScaleLimit_Default)
97 m_FeatProduct(feat_product),
99 m_OverlapType(eOverlap_Intervals),
100 m_ResolveMethod(eResolve_TSE),
101 m_SortOrder(eSortOrder_Normal),
102 m_LimitObjectType(eLimit_None),
103 m_UnresolvedFlag(eIgnoreUnresolved),
106 m_MaxSearchTime(FLT_MAX),
107 m_MaxSearchSegmentsAction(eMaxSearchSegmentsThrow),
109 m_AdaptiveDepthFlags(kAdaptive_None),
111 m_ExcludeExternal(
false),
112 m_CollectSeq_annots(
false),
113 m_CollectTypes(
false),
114 m_CollectNames(
false),
115 m_CollectCostOfLoading(
false),
116 m_IgnoreStrand(
false),
117 m_HasWildcardInAnnotsNames(
false),
120 m_ExcludeIfGeneIsSuppressed(
false),
121 m_SNPScaleLimit(
CSeq_id::eSNPScaleLimit_Default)
128 m_FeatProduct(
false),
130 m_OverlapType(eOverlap_Intervals),
131 m_ResolveMethod(eResolve_TSE),
132 m_SortOrder(eSortOrder_Normal),
133 m_LimitObjectType(eLimit_None),
134 m_UnresolvedFlag(eIgnoreUnresolved),
137 m_MaxSearchTime(FLT_MAX),
138 m_MaxSearchSegmentsAction(eMaxSearchSegmentsThrow),
140 m_AdaptiveDepthFlags(kAdaptive_None),
142 m_ExcludeExternal(
false),
143 m_CollectSeq_annots(
false),
144 m_CollectTypes(
false),
145 m_CollectNames(
false),
146 m_CollectCostOfLoading(
false),
147 m_IgnoreStrand(
false),
148 m_HasWildcardInAnnotsNames(
false),
151 m_ExcludeIfGeneIsSuppressed(
false),
152 m_SNPScaleLimit(
CSeq_id::eSNPScaleLimit_Default)
165 if (
this != &sel ) {
301 bool sx_HasWildcard(
const CAnnotName& name,
string* acc_ptr = 0)
306 const string& s = name.
GetName();
307 if ( s.empty() || s.back() !=
'*' ) {
314 template<
class TNames,
class TName>
315 inline bool sx_Has(
const TNames&
names,
const TName& name)
320 template<
class TNames,
class TName>
321 inline void sx_Add(TNames&
names,
const TName& name)
323 if ( !sx_Has(
names, name) ) {
324 names.push_back(name);
328 template<
class TNames,
class TName>
329 void sx_Del(TNames&
names,
const TName& name)
347 bool has_match =
false;
356 if ( arg_acc.empty() ) {
359 if ( incl_acc == arg_acc ) {
374 if ( arg_acc.empty() ) {
381 int incl_level = it->second;
382 if ( incl_level != -1 && arg_level != incl_level ) {
399 if ( arg_acc.empty() ) {
402 if ( incl_acc == arg_acc ) {
426 if ( !
n.IsNamed() ) {
449 void vector_erase(vector<CAnnotName>& v,
const CAnnotName& name)
451 v.erase(
remove(v.begin(), v.end(), name), v.end());
557 if ( zoom_level != 0 && zoom_part != zoom_level ) {
559 "SAnnotSelector::IncludeNamedAnnotAccession: "
560 "Incompatible zoom levels: "
561 <<acc<<
" vs "<<zoom_level);
563 zoom_level = zoom_part;
565 (*m_NamedAnnotAccessions)[acc_part] = zoom_level;
599 if ( acc_size ==
NPOS ) {
607 const string& tacc = it->first;
608 if ( tacc.size() == acc_size ) {
612 if ( tacc.size() == acc_size+2 &&
613 tacc[acc_size] ==
'.' &&
614 tacc[acc_size+1] ==
'*' ) {
644 if ( !
NCBI_PARAM_TYPE(OBJMGR, ADAPTIVE_DEPTH_BY_NAMED_ACC)::GetDefault() ) {
730 if ( default_value ) {
847 for (
size_t i = 0;
i <
range.first; ++
i) {
966 string* acc_ptr,
int* zoom_level_ptr)
NCBI_PARAM_DEF(bool, OBJMGR, ADAPTIVE_DEPTH_BY_NAMED_ACC, true)
NCBI_PARAM_DECL(bool, OBJMGR, ADAPTIVE_DEPTH_BY_NAMED_ACC)
static SAnnotSelector::TAdaptiveDepthFlags s_DefaultAdaptiveDepthFlags
Annotation iterators exceptions.
const string & GetName(void) const
TFeatSubtype GetFeatSubtype(void) const
TFeatType GetFeatType(void) const
TAnnotType GetAnnotType(void) const
pair< size_t, size_t > TIndexRange
static TIndexRange GetFeatTypeRange(CSeqFeatData::E_Choice type)
static size_t GetSubtypeIndex(CSeqFeatData::ESubtype subtype)
static TIndexRange GetIndexRange(const SAnnotTypeSelector &sel)
static TIndexRange GetAnnotTypeRange(CSeq_annot::C_Data::E_Choice type)
void AddLocation(const CSeq_loc &loc, ETransSplicing trans_splcing=eNoTransSplicing)
static E_Choice GetTypeFromSubtype(ESubtype subtype)
static string CombineWithZoomLevel(const string &acc, int zoom_level)
Combine accession string and zoom level into a string with separator.
static void AddZoomLevel(string &acc, int zoom_level)
static bool ExtractZoomLevel(const string &full_name, string *acc_ptr, int *zoom_level_ptr)
Extract optional zoom level suffix from named annotation string.
void Reset(void)
Reset to null state.
const CTSE_Info & x_GetTSE_Info(void) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
container_type::const_iterator const_iterator
static const struct name_t names[]
static void DLIST_NAME() remove(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)
Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...
#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.
const string & GetMsg(void) const
Get message string.
#define NCBI_THROW_FMT(exception_class, err_code, message)
The same as NCBI_THROW but with message processed as output to ostream.
const CTSE_Handle & GetTSE_Handle(void) const
Get CTSE_Handle of containing TSE.
const CTSE_Handle & GetTSE_Handle(void) const
const CTSE_Handle & GetTSE_Handle(void) const
const CSeq_entry_Info & x_GetInfo(void) const
const CSeq_annot_Info & x_GetInfo(void) const
vector< SAnnotTypeSelector > TAdaptiveTriggers
AutoPtr< CHandleRangeMap > m_SourceLoc
bool m_CollectCostOfLoading
EResolveMethod m_ResolveMethod
SAnnotSelector(TAnnotType annot=CSeq_annot::C_Data::e_not_set, TFeatType feat=CSeqFeatData::e_not_set, bool feat_product=false)
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
SAnnotSelector & SetAdaptiveTrigger(const SAnnotTypeSelector &sel)
SetAdaptiveTrigger() allows to change default set of adaptive trigger annotations.
SAnnotSelector & SetResolveTSE(void)
SetResolveTSE() is equivalent to SetResolveMethod(eResolve_TSE).
SAnnotSelector & ExcludeFeatSubtype(TFeatSubtype subtype)
Exclude feature subtype from the search.
SAnnotSelector & operator=(const SAnnotSelector &sel)
CBioseq_Handle m_IgnoreFarLocationsForSorting
SAnnotSelector & ForceAnnotType(TAnnotType type)
Set annot type, include all subtypes.
SAnnotSelector & ResetUnnamedAnnots(void)
Reset special processing of unnamed annots (added or excluded)
SAnnotSelector & SetAllNamedAnnots(void)
Look for all named Seq-annots Resets the filter, and then excludes unnamed annots.
TTSE_Limits m_ExcludedTSE
TAdaptiveDepthFlags m_AdaptiveDepthFlags
SAnnotSelector & ExcludeFeatType(TFeatType type)
Exclude feature type from the search.
bool IsIncludedAnyNamedAnnotAccession(void) const
check if any named annot accession is included in the search
SAnnotSelector & ExcludeAnnotType(TAnnotType type)
Exclude annotation type from the search.
SAnnotSelector & SetSearchExternal(const CTSE_Handle &tse)
Set all flags for searching standard GenBank external annotations.
EUnresolvedFlag m_UnresolvedFlag
virtual ~IFeatComparator()
CConstRef< CObject > m_LimitObject
bool HasWildcardInAnnotsNames() const
void CheckLimitObjectType(void) const
SAnnotSelector & SetSourceLoc(const CSeq_loc &loc)
Set filter for source location of annotations.
bool IsIncludedNamedAnnotAccession(const string &acc) const
check if named annot accession is included in the search
SAnnotSelector & ResetAnnotsNames(void)
Select annotations from all Seq-annots.
SAnnotSelector & ExcludeTSE(const CTSE_Handle &tse)
SAnnotSelector & ResetNamedAnnots(const CAnnotName &name)
Reset special processing of named annots (added or excluded)
void x_InitializeAnnotTypesSet(bool default_value)
ELimitObject m_LimitObjectType
SAnnotSelector & SetLimitNone(void)
Remove restrictions on the parent object of annotations.
SAnnotSelector & SetDataSource(const string &name)
Look for named annot.
bool IncludedFeatSubtype(TFeatSubtype subtype) const
SAnnotSelector & SetAdaptiveDepth(bool value=true)
SetAdaptiveDepth() requests to restrict subsegment resolution depending on annotations found on lower...
TAnnotTypesBitset m_AnnotTypesBitset
bool ExcludedAnnotName(const CAnnotName &name) const
SAnnotSelector & SetAdaptiveDepthFlags(TAdaptiveDepthFlags flags)
SetAdaptiveDepthFlags() sets flags for adaptive depth heuristics.
string CombineWithZoomLevel(const string &acc, int zoom_level)
Combine accession string and zoom level into a string with separator.
SAnnotSelector & SetLimitSeqAnnot(const CSeq_annot_Handle &limit)
Limit annotations to those from the seq-annot only.
TMaxSearchTime m_MaxSearchTime
TAdaptiveTriggers m_AdaptiveTriggers
bool IncludedAnnotType(TAnnotType type) const
Return true if at least one subtype of the type is included or selected type is not set (any).
AutoPtr< TNamedAnnotAccessions > m_NamedAnnotAccessions
SAnnotSelector & IncludeNamedAnnotAccession(const string &acc, int zoom_level=0)
SAnnotSelector & SetSearchUnresolved(void)
SAnnotSelector & IncludeFeatType(TFeatType type)
Include feature type in the search.
void AddZoomLevel(string &acc, int zoom_level)
TMaxSearchSegments m_MaxSearchSegments
EMaxSearchSegmentsAction m_MaxSearchSegmentsAction
SAnnotSelector & IncludeAnnotType(TAnnotType type)
Include annotation type in the search.
SAnnotSelector & SetAnnotType(TAnnotType type)
Set annotation type (feat, align, graph)
static TAdaptiveDepthFlags GetDefaultAdaptiveDepthFlags()
Get default set of adaptive depth flags.
SAnnotSelector & ResetExcludedTSE(void)
map< string, int > TNamedAnnotAccessions
TSNPScaleLimit m_SNPScaleLimit
bool IncludedAnnotName(const CAnnotName &name) const
bool HasIncludedOnlyNamedAnnotAccessions() const
bool m_ExcludeIfGeneIsSuppressed
static void SetDefaultAdaptiveDepthFlags(TAdaptiveDepthFlags flags)
Set default set of adaptive depth flags.
SAnnotSelector & AddNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to look for.
bool ExtractZoomLevel(const string &full_name, string *acc_ptr, int *zoom_level_ptr)
Extract optional zoom level suffix from named annotation string.
EOverlapType m_OverlapType
bool ExcludedTSE(const CTSE_Handle &tse) const
Uint1 TAdaptiveDepthFlags
SAnnotSelector & ExcludeNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to exclude.
SAnnotSelector & SetLimitTSE(const CTSE_Handle &limit)
Limit annotations to those from the TSE only.
SAnnotSelector & ExcludeUnnamedAnnots(void)
Add unnamed annots to set of annots names to exclude.
bool m_HasWildcardInAnnotsNames
CIRef< IFeatComparator > m_FeatComparator
bool IsSetIncludedAnnotsNames(void) const
SAnnotSelector & ResetSourceLoc(void)
Reset filter for source location of annotations.
TAnnotsNames m_IncludeAnnotsNames
SAnnotSelector & AddUnnamedAnnots(void)
Add unnamed annots to set of annots names to look for.
SAnnotSelector & ExcludeNamedAnnotAccession(const string &acc)
bool MatchType(const CAnnotObject_Info &annot_info) const
Check if type of the annotation matches the selector.
SAnnotSelector & ResetNamedAnnotAccessions(void)
Add named annot accession (NA*) in the search.
TAnnotsNames m_ExcludeAnnotsNames
bool IncludedFeatType(TFeatType type) const
SAnnotSelector & SetLimitSeqEntry(const CSeq_entry_Handle &limit)
Limit annotations to those from the seq-entry only.
void x_ClearAnnotTypesSet(void)
void Reset(void)
Reset reference object.
#define NCBI_PARAM_TYPE(section, name)
Generate typename for a parameter from its {section, name} attributes.
#define numeric_limits
Pre-declaration of the "numeric_limits<>" template Forcibly overrides (using preprocessor) the origin...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
NCBI_NS_STD::string::size_type SIZE_TYPE
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
@ e_not_set
No variant selected.
@ e_not_set
No variant selected.
range(_Ty, _Ty) -> range< _Ty >
const GenericPointer< typename T::ValueType > T2 value
const CharType(& source)[N]
TFeatSubtype GetFeatSubtype(void) const
CSeq_annot::C_Data::E_Choice TAnnotType
TAnnotType GetAnnotType(void) const
TFeatType GetFeatType(void) const
void SetAnnotType(TAnnotType type)
void SetFeatType(TFeatType type)
void SetFeatSubtype(TFeatSubtype subtype)