66 objs =
m_Args[0]->GetObjects();
74 bool one_partial_start =
false, one_partial_stop =
false;
75 for (
auto&& it : objs) {
126 if (!edit_feat || !scope)
142 bool one_based = (
m_Args.size() == 1) ?
m_Args[0]->GetBool() :
false;
159 void CMacroFunction_LocationLength::TheFunction()
161 m_Result->SetNotSet();
164 CRef<CScope> scope = m_DataIter->GetScopedObject().scope;
165 if (!seq_feat || !scope)
169 m_Result->SetInt(
len);
172 bool CMacroFunction_LocationLength::x_ValidArguments()
const
174 return (m_Args.empty());
183 void CMacroFunction_LocationStrand::TheFunction()
190 m_Result->SetNotSet();
195 m_Result->SetString(strand);
199 bool CMacroFunction_LocationStrand::x_ValidArguments()
const
201 return (m_Args.empty());
210 void CMacroFunction_LocationStrandSymbol::TheFunction()
217 m_Result->SetNotSet();
221 m_Result->SetString(
".");
227 m_Result->SetString(
"+");
230 m_Result->SetString(
"-");
233 m_Result->SetString(
".");
238 bool CMacroFunction_LocationStrandSymbol::x_ValidArguments()
const
240 return (m_Args.empty());
257 const string& location_type = m_Args[0]->GetString();
268 bool match = x_Match(loc, *loc_cons);
270 m_Result->SetBool(
match);
276 bool has_null =
false;
277 int num_intervals = 0;
282 for (
CSeq_loc_CI loc_iter(loc); loc_iter; ++loc_iter) {
285 }
else if (!loc_iter.IsEmpty()) {
291 if (num_intervals == 1) {
295 if (num_intervals > 1 && !has_null) {
330 else if (
m_Args.size() == 1 && !
m_Args[0]->GetString().empty()) {
339 bsh = sobject.
scope->GetBioseqHandle(*loc);
365 if (!
GetFieldsByName(&res_oi, objInfo, field_name) || res_oi.size() != 1)
398 if (res_oi.size() != 1)
400 oi = res_oi.front().field;
@ eExtreme_Positional
numerical value
@ eExtreme_Biological
5' and 3'
namespace ncbi::objects::
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
static const char * sm_Stop
static const char * sm_SeqNa
class CMacroFunction_LocationSeqType IS_SEQ_AA(["location"]) - returns true if the sequence identifie...
virtual void TheFunction()
Function implementation.
static const char * sm_PartialStart
class CMacroFunction_LocPartialTest - tests whether the location is 5'/3' partial ISPARTIALSTART() - ...
list< SResolvedField > TObs
static const char * sm_SeqAa
static const char * sm_FromStart
class CMacroFunction_LocationDistConstraint DISTFROMSTART() [>][=][<] distance DISTFROMSTOP()
static const char * sm_PartialStop
void SetDataType(EType dt)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
virtual void TheFunction()
Function implementation.
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
bool GetFieldsByName(CMQueryNodeValue::TObs *results, const CObjectInfo &oi_i, const string &field_name)
Resolve existing dot qualified ASN.1 name (field_name) starting from the object information instance ...
static objects::CSeq_loc * s_GetLocation(const string &field_name, CIRef< IMacroBioDataIter > iter)
bool x_Match(const objects::CSeq_loc &loc, const objects::CLocation_constraint &loc_cons)
objects::ESeqtype_constraint m_Seqtype
CRef< CMQueryNodeValue > m_Result
virtual void TheFunction()
Function implementation.
#define DEFINE_MACRO_FUNCNAME(CL_NAME, FN_NAME)
static const char * sm_FromStop
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
CIRef< IMacroBioDataIter > m_DataIter
virtual void TheFunction()
Function implementation.
static const char * sm_Start
class CMacroFunction_LocEnd Start() and Stop() - return the positional extremes of a location
CRef< objects::CScope > scope
#define ENUM_METHOD_NAME(EnumName)
static const TObjectType * SafeCast(TTypeInfo type)
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
ENa_strand GetStrand(void) const
Get the location's strand.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
bool IsSetStrand(EIsSetStrand flag=eIsSetStrand_Any) const
Check if strand is set for any/all part(s) of the seq-loc depending on the flag.
bool IsPartialStop(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
CObjectInfo GetPointedObject(void) const
Get data and type information of object to which this type refers.
TObjectPtr GetObjectPtr(void) const
Get pointer to object.
ETypeFamily GetTypeFamily(void) const
Get data type family.
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
bool IsNucleotide(void) const
TSeqPos GetBioseqLength(void) const
bool IsProtein(void) const
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define USING_SCOPE(ns)
Use the specified namespace.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
TLocation_type GetLocation_type(void) const
Get the Location_type member data.
@ eSeqtype_constraint_prot
@ eSeqtype_constraint_nuc
@ eLocation_type_constraint_ordered
@ eLocation_type_constraint_joined
@ eLocation_type_constraint_any
@ eLocation_type_constraint_single_interval
const TLocation & GetLocation(void) const
Get the Location member data.
ENa_strand
strand of nucleic acid
E_Choice Which(void) const
Which variant is currently selected.
Functions that resolve field names described in asn format.
const GenericPointer< typename T::ValueType > T2 value
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)