Ncbi_library_version_mismatch__Full_rebuild_to_fix_20200522
65 #ifdef USE_VARIATION_LIB 66 #include <internal/variation/lib/Variant/Spdi.hpp> 67 #include <internal/variation/lib/Constructors/VcfForSpdi.hpp> 68 #include <internal/variation/lib/Primitives/Sequence.hpp> 69 #include <internal/variation/lib/Primitives/SeqId.hpp> 85void CMacroFunction_ChoiceType::TheFunction()
88 if(!m_Args.empty()) {
89field_name = m_Args[0]->GetString();
93 if(m_DataIter->GetChoiceType(field_name, choice_type)) {
94m_Result->SetString(choice_type);
98 boolCMacroFunction_ChoiceType::x_ValidArguments()
const 100 return(m_Args.empty() || (m_Args.size() == 1 && m_Args[0]->IsString()));
113 if(
m_Args[index]->IsNotSet()) {
118 if(
m_Args[index]->IsRef()) {
122 if(
m_Args[index]->IsString()) {
129 if(
m_Args[index]->AreObjects()) {
131 boolrval = !res_oi.empty();
133 for(
const auto& it : res_oi) {
136 string val= it.field.GetPrimitiveValueString();
152 if(
m_Args[index]->AreStrings()) {
153 boolrval = !
m_Args[index]->GetStrings().empty();
158 boolcont_element = (
m_Args.size() == 2);
159 stringfield_name =
m_Args[index]->GetString();
162container = field_name;
163field_name =
m_Args[++index]->GetString();
166 if(
NStr::IsBlank(field_name) || (cont_element && container.empty()))
179 size_tas =
m_Args.size();
180 if(as != 1 && as != 2)
184 boolfirst_ok =
m_Args[index]->IsString() ||
m_Args[index]->AreObjects() ||
m_Args[index]->IsNotSet() ||
m_Args[index]->IsRef();
190 for(
auto&& it :
m_Args) {
212 if(res_oi.empty()) {
224 while(elem.
Valid()) {
291 CObjectInfoobjInfo(&molinfo, molinfo.GetTypeInfo());
297 if(
m_Args.size() == 1) {
312 for(
auto& it :
m_Args) {
313 if(!it->IsString()) {
326 voidCMacroFunction_GetDBLink::TheFunction()
328 const stringfield_type = m_Args[0]->GetString();
334 const auto& user = desc_it->GetUser();
335 if(user.GetType().IsStr() && user.GetType().GetStr() ==
"DBLink") {
337 if(const_user_field) {
339 CObjectInfoobjInfo(&user_field, user_field.GetTypeInfo());
341x_AssignReturnValue(objInfo,
"data.str");
343x_AssignReturnValue(objInfo,
"data.strs");
349 boolCMacroFunction_GetDBLink::x_ValidArguments()
const 351 return(m_Args.size() == 1 && m_Args[0]->IsString());
377 return(
m_Args.size() == 1 &&
m_Args[0]->IsString());
389void CMacroFunction_RelatedFeatures::TheFunction()
392 stringfield_name = m_Args[1]->GetString();
394 if(m_Args.size() == 3) {
395container = field_name;
396field_name = m_Args[2]->GetString();
401 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
402 if(!feat || !scope) {
407NMacroUtil::TVecFeatList::iterator it = feat_list.begin();
408 if(!feat_list.empty()) {
410 CObjectInfoobjInfo(related_feat.GetPointer(), related_feat.GetPointer()->GetTypeInfo());
411 if(container.empty()) {
412x_AssignReturnValue(objInfo, field_name);
415x_AssignReturnValueFromContainer(objInfo, container, field_name);
420 boolCMacroFunction_RelatedFeatures::x_ValidArguments()
const 422 if(m_Args.size() != 2 && m_Args.size() != 3) {
425 for(
auto& it : m_Args) {
426 if(!it->IsString()) {
442void CMacroFunction_Features_For_Object::TheFunction()
446 stringcontainer = (++index < m_Args.size()) ? m_Args[index]->GetString() :
kEmptyStr;
447 stringfield_name = (++index < m_Args.size()) ? m_Args[index]->GetString() :
kEmptyStr;
448 if(m_Args.size() != 3) {
449field_name = container;
452 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
468 if(m_Args.size() == 3) {
469x_AssignReturnValueFromContainer(objInfo, container, field_name);
472x_AssignReturnValue(objInfo, field_name);
478 boolCMacroFunction_Features_For_Object::x_ValidArguments()
const 480 if(m_Args.empty() || m_Args.size() > 3) {
483 for(
auto& it : m_Args) {
506res_oi =
m_Args[0]->GetObjects();
512 if(res_oi.empty()) {
536void CMacroFunction_CDSTranslation::TheFunction()
540 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
547 if(prot_seq.empty()) {
551 if(m_Nested == eNotNested) {
552m_Result->SetString(prot_seq);
556new_node->SetString(prot_seq);
557m_Result->SetRef(new_node);
561 boolCMacroFunction_CDSTranslation::x_ValidArguments()
const 563 return(m_Args.empty());
573void CMacroFunction_SeqID::TheFunction()
575m_Result->SetNotSet();
580vector<string> id_labels;
585 if(bssh && bssh.
IsSetClass() && bssh.
GetClass() == objects::CBioseq_set::eClass_nuc_prot) {
595m_Result->SetStrings(id_labels);
598 boolCMacroFunction_SeqID::x_ValidArguments()
const 600 returnm_Args.empty();
610 for(
const auto& it : bseq.
GetId()) {
613id_labels.push_back(
label);
615 if(it->IsLocal() && local_id.empty()) {
619 if(it->IsGeneral() && it->GetGeneral().IsSetDb() && it->GetGeneral().GetDb() ==
"BankIt") {
620id_labels.push_back(
"BankIt"+
label);
621 size_tpos =
label.find(
"/");
623 stringprefix =
label.substr(0, pos);
624id_labels.push_back(
"BankIt"+ prefix);
626id_labels.push_back(prefix);
630 size_tpos =
label.find(
"/");
634id_labels.push_back(
label);
639 if(it->IsGenbank()) {
642id_labels.push_back(
label);
655void CMacroFunction_Accession::TheFunction()
657m_Result->SetNotSet();
666m_Result->SetString(acc);
670 LOG_POST(
Error<<
"CMacroFunction_Accession: failed when retrieving accession, "<< e.
GetMsg());
675 boolCMacroFunction_Accession::x_ValidArguments()
const 677 returnm_Args.empty();
685void CMacroFunction_InconsistentTaxa::TheFunction()
689 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
690 if(!seqset || !scope) {
694 stringtaxname, first_taxname;
695 boolis_first(
true), inconsistent(
false);
700 if(desc->GetSource().IsSetTaxname()) {
701taxname = desc->GetSource().GetTaxname();
705 if(feat_it && feat_it->GetData().GetBiosrc().IsSetTaxname()) {
706taxname = feat_it->GetData().GetBiosrc().GetTaxname();
711first_taxname = taxname;
717inconsistent =
true;
721m_Result->SetBool(inconsistent);
724 boolCMacroFunction_InconsistentTaxa::x_ValidArguments()
const 726 return(m_Args.empty());
735void CMacroFunction_StringLength::TheFunction()
746res_oi = m_Args[0]->GetObjects();
749x_GetObjectsFromRef(res_oi, 0);
752 if(res_oi.empty()) {
763 if(elem.
Valid()) {
773 boolCMacroFunction_StringLength::x_ValidArguments()
const 775 return(m_Args.size() == 1 && (m_Args[0]->IsString() || m_Args[0]->AreObjects() || m_Args[0]->IsRef()));
783void CMacroFunction_StructCommField::TheFunction()
787 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
791 const string& field_name = m_Args[0]->GetString();
792m_Result->SetNotSet();
801x_AssignReturnValue(objInfo,
"data.str");
806 size_tsearch_depth = 0;
828x_AssignReturnValue(objInfo,
"data.str");
837 boolCMacroFunction_StructCommField::x_ValidArguments()
const 839 return(m_Args.size() == 1 && m_Args[0]->IsString());
847void CMacroFunction_StructCommDatabase::TheFunction()
851 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
855m_Result->SetNotSet();
859 if(m_Nested == eNotNested) {
860m_Result->SetString(prefix);
865new_node->SetString(prefix);
866m_Result->SetRef(new_node);
871 size_tsearch_depth = 0;
887vector<string> dbnames;
891dbnames.push_back(prefix);
894 if(!dbnames.empty()) {
895 if(m_Nested == eNotNested) {
896m_Result->SetStrings(dbnames);
900new_node->SetStrings(dbnames);
901m_Result->SetRef(new_node);
907 boolCMacroFunction_StructCommDatabase::x_ValidArguments()
const 909 returnm_Args.empty();
916void CMacroFunction_StructCommFieldname::TheFunction()
921 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
929 for(
auto& it : user_obj->
SetData()) {
946 if(m_Nested == eNotNested) {
947m_Result->AssignFromObjectInfo(objs.front().field);
950m_Result->SetObjects(objs);
954 boolCMacroFunction_StructCommFieldname::x_ValidArguments()
const 956 returnm_Args.empty();
963void CMacroFunction_GetDBXref::TheFunction()
968 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
972m_Result->SetNotSet();
973vector<string> values;
979 const CDbtag& xref = **db_it;
980 stringdb = xref.
GetDb();
986values.push_back(db +
":"+
tag);
991 for(
const auto& db_it : src->
GetOrg().
GetDb()) {
992 stringdb = db_it->GetDb();
994 if(db_it->GetTag().IsStr())
995 tag= db_it->GetTag().GetStr();
996 if(db_it->GetTag().IsId())
998values.push_back(db +
":"+
tag);
1003 if(m_Nested == eNotNested) {
1004m_Result->SetStrings(values);
1009new_node->SetStrings(values);
1010m_Result->SetRef(new_node);
1014 boolCMacroFunction_GetDBXref::x_ValidArguments()
const 1016 returnm_Args.empty();
1030 voidCMacroFunction_InTable::TheFunction()
1032 autoarg_nr = m_Args.size();
1033 boolcont_element = (m_Args[3]->IsInt());
1035 size_tindex = cont_element ? 2 : 1;
1036 const string&
table_name= m_Args[index]->GetString();
1037 intcol = (
int)m_Args[++index]->GetInt();
1041 string delimiter= m_Args[++index]->GetString();
1042 boolmerge_del = (++index < arg_nr) ? m_Args[index]->GetBool() :
false;
1043 boolsplit_firstcol = (++index < arg_nr) ? m_Args[index]->GetBool() :
false;
1044 boolconvert_multi = (++index < arg_nr) ? m_Args[index]->GetBool() :
false;
1045 boolmerge_firstcols = (++index < arg_nr) ? m_Args[index]->GetBool() :
false;
1046 boolcase_sensitive = (++index < arg_nr) ? m_Args[index]->GetBool() :
true;
1047 boolmultiple_spaces_only = (++index < arg_nr) ? m_Args[index]->GetBool() :
false;
1050merge_del, split_firstcol, convert_multi, merge_firstcols, multiple_spaces_only);
1052 boolfound =
false;
1053 if(m_Args[0]->AreStrings()) {
1054found = m_DataIter->FindInTable(m_Args[0]->GetStrings(), case_sensitive);
1059 if(m_Args[0]->IsString()) {
1063x_AssignReturnValueFromContainer(oi, m_Args[0]->GetString(), m_Args[1]->GetString());
1064res_oi = m_Result->GetObjects();
1066m_Result->SetNotSet();
1067m_Nested = eNotNested;
1073 else if(m_Args[0]->AreObjects()) {
1074res_oi = m_Args[0]->GetObjects();
1077found = m_DataIter->FindInTable(res_oi, case_sensitive);
1080m_Result->SetBool(found);
1083 boolCMacroFunction_InTable::x_ValidArguments()
const 1085 autoarg_nr = m_Args.size();
1086 if(arg_nr < 4 && arg_nr > 11)
1089 boolfirst_ok = m_Args[0]->IsString() ||
1090m_Args[0]->AreStrings() ||
1091m_Args[0]->AreObjects() ||
1092m_Args[0]->IsNotSet() ||
1094 if(!first_ok)
return false;
1095 if(m_Args[0]->IsRef()) {
1098 if(!m_Args[2]->IsInt() && !m_Args[3]->IsInt())
1101 size_tindex = (m_Args[2]->IsInt()) ? 2 : 3;
1103 for(
size_t i= 1;
i< index; ++
i) {
1104 if(!m_Args[
i]->IsString())
1108 if(!m_Args[index]->IsInt() || !m_Args[++index]->IsString())
1111 for(
size_t i= ++index;
i< arg_nr; ++
i) {
1112 if(!m_Args[
i]->IsBool())
1127 voidCMacroFunction_Contained::TheFunction()
1131 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
1132 if(!feat || !scope)
1136 boolcontained =
false;
1150m_Result->SetBool(contained);
1153 boolCMacroFunction_Contained::x_ValidArguments()
const 1155 return(m_Args.size() == 1 && m_Args[0]->IsString());
1165 if(start1 == stop2 + 1 || start2 == stop1 + 1) {
1178void CMacroFunction_IllegalDbXref::TheFunction()
1182 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
1183 if(!feat || !scope)
1186 const auto& objs = m_Args[0]->GetObjects();
1187 if(objs.empty() || objs.front().field.GetName() !=
"Dbtag") {
1188m_Result->SetBool(
false);
1194validator::CValidator::TDbxrefValidFlags
flags=
1195validator::CValidator::IsValidDbxref(*
tag,
false,
false);
1197 boolnon_valid =
flags| validator::CValidator::eValid;
1198m_Result->SetBool(non_valid);
1201 boolCMacroFunction_IllegalDbXref::x_ValidArguments()
const 1203 return(m_Args.size() == 1 && m_Args[0]->AreObjects());
1214 if(
subname.empty())
return;
1216 stringinst, coll, id;
1226 voidCMacroFunction_StructVoucherPart::TheFunction()
1234 stringvoucher_type;
1235 stringvoucher_part = m_Args[index]->GetString();
1238 if(m_Args[0]->IsString()) {
1239voucher_type = m_Args[0]->GetString();
1241 else if(m_Args[0]->AreObjects()) {
1242res_oi = m_Args[0]->GetObjects();
1244 else if(m_Args[0]->IsRef()) {
1245x_GetObjectsFromRef(res_oi, 0);
1248 if(voucher_type.empty() && res_oi.empty()) {
1259vector<string> values;
1260m_Result->SetNotSet();
1262 if(!voucher_type.empty()) {
1271 autoorgmod = *mod_it;
1272 if(orgmod->IsSetSubtype() && orgmod->GetSubtype() == subtype && orgmod->IsSetSubname()) {
1278 for(
auto& it : res_oi) {
1280 s_ParseValues(it.field.GetPrimitiveValueString(), part, values);
1285 if(!values.empty()) {
1286 if(m_Nested == eNotNested) {
1287m_Result->SetStrings(values);
1292new_node->SetStrings(values);
1293m_Result->SetRef(new_node);
1298 boolCMacroFunction_StructVoucherPart::x_ValidArguments()
const 1300 if(m_Args.size() != 2)
1303 boolfirst_ok = m_Args[0]->IsString() || m_Args[0]->AreObjects() || m_Args[0]->IsRef();
1304 returnfirst_ok && m_Args[1]->IsString();
1313void CMacroFunction_GeneType::TheFunction()
1323m_Result->SetNotSet();
1326m_Result->SetString(
label);
1330 boolCMacroFunction_GeneType::x_ValidArguments()
const 1332 return(m_Args.empty());
1340void CMacroFunction_Label::TheFunction()
1350m_Result->SetString(
label);
1353 boolCMacroFunction_Label::x_ValidArguments()
const 1355 return(m_Args.size() == 1 && m_Args[0]->IsString());
1363void CMacroFunction_VariationType::TheFunction()
1371m_Result->SetString(var_class);
1374 boolCMacroFunction_VariationType::x_ValidArguments()
const 1376 returnm_Args.empty();
1383void CMacroFunction_RefAllele::TheFunction()
1393 if(alleles.empty()) {
1394m_Result->SetNotSet();
1397m_Result->SetString(alleles.front());
1401 boolCMacroFunction_RefAllele::x_ValidArguments()
const 1403 returnm_Args.empty();
1410void CMacroFunction_AltAlleles::TheFunction()
1417 string str= m_Args[0]->GetString();
1418 stringsDelimiter = (m_Args.size() == 1) ? m_Args[0]->GetString() :
"/";
1423 if(alleles.empty()) {
1424m_Result->SetNotSet();
1428 for(
size_t i= 1;
i< alleles.size(); ++
i) {
1429 if(!alt_allele.empty()) {
1430alt_allele += sDelimiter;
1432alt_allele += alleles[
i];
1434m_Result->SetString(alt_allele);
1438 boolCMacroFunction_AltAlleles::x_ValidArguments()
const 1440 if(m_Args.empty()) {
1443 if(m_Args.size() == 1 && m_Args[0]->IsString()) {
1454void CMacroFunction_VcfSevenCol::TheFunction()
1461m_Result->SetNotSet();
1478 LOG_POST(
Error<<
"CMacroFunction_VcfSevenCol: failed when retrieving accession, "<< e.
GetMsg());
1481sResult += sAcc +
"\t";
1489 if(dbtag && dbtag->IsSetTag()) {
1490 const auto&
tag= dbtag->GetTag();
1491 if(
tag.IsStr()) {
1492snp_id =
tag.GetStr();
1494 else if(
tag.IsId()) {
1497 else if(
tag.IsId8()) {
1504 if(!alleles.empty()) {
1505 boolisUsedVarLib(
false);
1506 #ifdef USE_VARIATION_LIB 1508 if(!seq_id.
IsNull() && alleles.size() == 2) {
1509NVariation::NPrimitives::CSeqId var_seq_id(NVariation::NPrimitives::CSeqId::FromDatatoolObject(*seq_id));
1510NVariation::NVariant::CSpdi spdi(var_seq_id,
1514 autoseq_cache(NVariation::NPrimitives::ISequenceFactory::CreateDefault(m_DataIter->GetScopedObject().scope)->GetSequence(var_seq_id,
1516 autovcf_var = NVariation::NConstructors::g_VcfFromSpdi(spdi, *seq_cache);
1518sResult += snp_id +
"\t";
1519sResult += vcf_var.Reference() +
"\t"+ vcf_var.Alternate() +
"\t";
1520isUsedVarLib =
true;
1526 if(!isUsedVarLib) {
1528sResult += snp_id +
"\t";
1529 if(alleles.empty()) {
1532sResult += alleles.front();
1535 if(alleles.size() < 2) {
1539 for(
size_t i= 1;
i< alleles.size(); ++
i) {
1540 if(!alt_allele.empty()) {
1543alt_allele += alleles[
i];
1545sResult += alt_allele;
1552 if(!sResult.empty()) {
1553m_Result->SetString(sResult);
1557 boolCMacroFunction_VcfSevenCol::x_ValidArguments()
const 1559 returnm_Args.empty();
1565void CMacroFunction_Consequence::TheFunction()
1573m_Result->SetString(conseq);
1576 boolCMacroFunction_Consequence::x_ValidArguments()
const 1578 returnm_Args.empty();
1585void CMacroFunction_SnpID::TheFunction()
1592m_Result->SetNotSet();
1595 if(dbtag && dbtag->IsSetTag()) {
1597 const auto&
tag= dbtag->GetTag();
1598 if(
tag.IsStr()) {
1599snp_id =
tag.GetStr();
1601 else if(
tag.IsId()) {
1604 else if(
tag.IsId8()) {
1607m_Result->SetString(snp_id);
1612 boolCMacroFunction_SnpID::x_ValidArguments()
const 1614 returnm_Args.empty();
@ eExtreme_Positional
numerical value
const CBioseq & GetNucFromNucProtSet(void) const
CConstRef< CSeqdesc > GetClosestDescriptor(CSeqdesc::E_Choice choice, int *level=NULL) const
Subclass of the IQueryParseUserObject which is held as the user-defined object in each CQueryParseNod...
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static bool ParseStructuredVoucher(const string &str, string &inst, string &coll, string &id)
ESubtype GetSubtype(void) const
namespace ncbi::objects::
CConstRef< CDbtag > GetNamedDbxref(const CTempString &db) const
Return a specified DB xref.
string GetGenePropertyString() const
const char * GetVariationClassString() const
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Return a field reference representing the tokenized key, or a NULL reference if the key doesn't exist...
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
vector< string > TAlleles
list of alleles belonging to particular SNP a deletion is represented by a "-"
static void GetAlleles(const CMappedFeat &mapped_feat, TAlleles &Alleles)
Return list of alleles encoded in qual.
static CSnpBitfield GetBitfield(const CMappedFeat &)
Return bitfield information stored in the feature.
static const char table_name[]
static const char * str(char *buf, int n)
unsigned int TSeqPos
Type for sequence locations and lengths.
#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)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
static const char * sm_BsrcForSeq
void x_AssignReturnValueFromContainer(const CObjectInfo &oi, const string &container, const string &field_name)
CLabel::ELabelType NameToLabelType(const string &name)
static bool s_ContainedIn(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
static const char * sm_BsrcForSeqdesc
static const char * sm_SeqForFeat
objects::CSeqdesc::E_Choice m_SeqdescType
objects::CSeqFeatData::ESubtype GetFeatSubtype(const string &feat_type)
void x_IsContainerElementPresent(const string &container, const string &field_name)
static const char * sm_Last
CMQueryNodeValue::EType GetPrimitiveFromRef(CMQueryNodeValue &node)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
static const char * sm_SeqForDescr
class CMacroFunction_Sequence_For_Seqdesc SEQUENCE_FOR_SEQDESC(field_name) SEQUENCE_FOR_SEQFEAT(field...
list< SResolvedField > TObs
static const char * sm_MolinfoForFeat
void Dereference()
If it is a reference it is resolved to the first non reference type in the hierarchy.
void SetDataType(EType dt)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
void x_AssignReturnValue(const CObjectInfo &oi, const string &field_name)
Assigns value to m_Result. It is mostly useful for functions used in the WHERE clause.
static const char * sm_First
CMacroFunction_FirstItem FIRSTOF(objects) - returns the first item from the list of objects LASTOF(ob...
virtual void TheFunction()
Function implementation.
EStructVoucherPart GetSVPartFromString(const string voucher_part)
static const char * sm_BsrcForFeat
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 bool s_GatherIdLabels(const CBioseq_Handle &bsh, vector< string > &id_labels)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
virtual void TheFunction()
Function implementation.
DEFINE_MACRO_FUNCNAME(CMacroFunction_IsPresent, "ISPRESENT")
class CMacroFunction_IsPresent ISPRESENT(field_name) ISPRESENT(container, element_name)
void x_GetObjectsFromRef(CMQueryNodeValue::TObs &objects, const size_t &index)
CRef< CMQueryNodeValue > m_Result
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
virtual void TheFunction()
Function implementation.
static const char * sm_BsrcForMolinfo
class CMacroFunction_GetSeqdesc BIOSOURCE_FOR_MOLINFO(field_name) or BIOSOURCE_FOR_MOLINFO(container,...
void x_IsSimpleTypePresent(const string &field_name)
void SetObjects(const TObs &obs)
static void s_ParseValues(const string &subname, NMacroUtil::EStructVoucherPart part, vector< string > &values)
class CMacroFunction_StructVoucherPart StructVoucherPart(type|object, part)
CIRef< IMacroBioDataIter > m_DataIter
vector< CConstRef< objects::CSeq_feat > > TVecFeatList
static const char * sm_MolinfoForBsrc
virtual void TheFunction()
Function implementation.
static bool IsPseudoFeature(const objects::CSeq_feat &feat)
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
size_t TMemberIndex
Type used for indexing class members and choice variants.
virtual const CTypeInfo * GetThisTypeInfo(void) const =0
static const TObjectType * SafeCast(TTypeInfo type)
@ ePrimitiveValueString
string|char*|const char*
@ ePrimitiveValueEnum
enum
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
CConstRef< CSeq_id > GetSeqId(void) const
@ fLabel_GeneralDbIsContent
For type general, use the database name as the tag and the (text or numeric) key as the content.
@ eContent
Untagged human-readable accession or the like.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
TSeqPos GetStop(ESeqLocExtremes ext) const
CElementIterator BeginElements(void) const
Create container elements iterator.
CObjectInfo GetPointedObject(void) const
Get data and type information of object to which this type refers.
CObjectInfo GetElement(void) const
Get element data and type information.
TObjectPtr GetObjectPtr(void) const
Get pointer to object.
TMemberIndex GetCurrentChoiceVariantIndex(void) const
Get index of currently selected choice variant.
CChoiceVariant GetCurrentChoiceVariant(void) const
Get data and type information of selected choice variant.
bool Valid(void) const
Is iterator valid.
CMemberIterator GetClassMemberIterator(TMemberIndex index) const
Create class member iterator that initially points to specified member.
ETypeFamily GetTypeFamily(void) const
Get data type family.
void GetPrimitiveValueString(string &value) const
Get string data.
CMemberIterator FindClassMember(const string &memberName) const
Find class member by its name.
Int4 GetPrimitiveValueInt4(void) const
Get data as Int4.
EPrimitiveValueType GetPrimitiveValueType(void) const
Get type of primitive value.
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,...
Int8 TestForOverlapEx(const CSeq_loc &loc1, const CSeq_loc &loc2, EOverlapType type, CScope *scope=0, TOverlapFlags flags=fOverlap_Default)
Updated version of TestForOverlap64().
@ eOverlap_Contained
2nd contained within 1st extremes
static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)
Translate a string using a specified genetic code.
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CBioseq_set_Handle GetBioseq_setHandle(const CBioseq_set &seqset, EMissing action=eMissing_Default)
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
CConstRef< CBioseq_set > GetCompleteBioseq_set(void) const
Return the complete bioseq-set object.
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
bool IsSetClass(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
TObjectType & GetObject(void) const
Get object.
#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 string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)
Convert Int8 to string.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another 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 bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
@ eNocase
Case insensitive compare.
static const char label[]
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
const TOrg & GetOrg(void) const
Get the Org member data.
bool IsStr(void) const
Check if variant Str is selected.
const TTag & GetTag(void) const
Get the Tag member data.
bool IsStrs(void) const
Check if variant Strs is selected.
bool IsId(void) const
Check if variant Id is selected.
const TData & GetData(void) const
Get the Data member data.
const TDb & GetDb(void) const
Get the Db member data.
bool IsStr(void) const
Check if variant Str is selected.
TData & SetData(void)
Assign a value to Data data member.
const TStr & GetStr(void) const
Get the variant data.
const TLabel & GetLabel(void) const
Get the Label member data.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
TId GetId(void) const
Get the variant data.
bool IsSetDb(void) const
ids in taxonomic or culture dbases Check if a value has been assigned to Db data member.
const TDb & GetDb(void) const
Get the Db member data.
@ eSubtype_specimen_voucher
@ eSubtype_culture_collection
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
const TLocation & GetLocation(void) const
Get the Location member data.
bool IsGene(void) const
Check if variant Gene is selected.
const TData & GetData(void) const
Get the Data member data.
bool IsSetDbxref(void) const
support for xref to other databases Check if a value has been assigned to Dbxref data member.
bool IsRna(void) const
Check if variant Rna is selected.
const TSource & GetSource(void) const
Get the variant data.
const TId & GetId(void) const
Get the Id member data.
const TMolinfo & GetMolinfo(void) const
Get the variant data.
@ e_User
user defined object
@ e_Molinfo
info on the molecule and techniques
@ e_Source
source of materials, includes Org-ref
@ eMol_na
just a nucleic acid
unsigned int
A callback function used to compare two keys in a database.
Functions that resolve field names described in asn format.
constexpr bool empty(list< Ts... >) noexcept
static const char delimiter[]
Utility macros and typedefs for exploring NCBI objects from seqfeat.asn.
#define FOR_EACH_ORGMOD_ON_BIOSOURCE(Itr, Var)
FOR_EACH_ORGMOD_ON_BIOSOURCE EDIT_EACH_ORGMOD_ON_BIOSOURCE.
#define FOR_EACH_DBXREF_ON_FEATURE
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