67 if (seqdesc && seqdesc->
IsUser()) {
70 if (user && IsStructuredCommentForThisField(*user)) {
73 CUser_object::TData::iterator it = user->
SetData().begin();
74 while (it != user->
SetData().end()) {
75 if ((*it)->IsSetLabel() && (*it)->GetLabel().IsStr()
76 &&
NStr::Equal((*it)->GetLabel().GetStr(), m_FieldName)) {
77 rval |= SetVal(**it, newValue, existing_text);
80 if (!(*it)->IsSetData()) {
87 if (!found && (!
NStr::Equal(m_ConstraintFieldName, m_FieldName) || !m_StringConstraint)) {
89 new_field->
SetLabel().SetStr(m_FieldName);
91 x_InsertFieldAtCorrectPosition(*user, new_field);
113 user.
SetData().push_back(field);
119 if (field_names.size() == 0) {
121 user.
SetData().push_back(field);
125 vector<string>::iterator sit = field_names.begin();
126 CUser_object::TData::iterator fit = user.
SetData().begin();
127 while (sit != field_names.end() && fit != user.
SetData().end()) {
128 string field_label = (*fit)->GetLabel().GetStr();
138 user.
SetData().insert(fit, field);
145 user.
SetData().push_back(field);
159 field.
SetData().SetStr(curr_val);
165 field.
SetData().SetStr(newValue);
170 field.
SetData().SetStr(newValue);
180 vector<string> vals =
GetVals(
object);
181 if (vals.size() > 0) {
196 if (seqdesc && seqdesc->
IsUser()) {
200 CUser_object::TData::const_iterator it = user->
GetData().begin();
201 while (it != user->
GetData().end()) {
202 if ((*it)->IsSetLabel() && (*it)->GetLabel().IsStr() && (*it)->IsSetData()
204 switch((*it)->GetData().Which()) {
206 vals.push_back((*it)->GetData().GetStr());
229 string_constraint.
Reset();
239 vector<CConstRef<CObject> >
objects;
245 object.
Reset(&(*desc_ci));
257 vector<CRef<CApplyObject> >
objects;
282 vector<CConstRef<CObject> > objs;
289 vector<CConstRef<CObject> > these_objs =
GetObjects(*bi);
290 objs.insert(objs.end(), these_objs.begin(), these_objs.end());
293 vector<CConstRef<CObject> > these_objs =
GetObjects(*bi);
296 objs.push_back (*it);
312 if (seqdesc && seqdesc->
IsUser()) {
323 if (!(*it)->IsSetLabel()
324 || !(*it)->GetLabel().IsStr()) {
330 string label = (*it)->GetLabel().GetStr();
350 if (seqdesc && seqdesc->
IsUser()) {
354 CUser_object::TData::iterator it = user->
SetData().begin();
355 while (it != user->
SetData().end()) {
356 bool do_erase =
false;
357 if ((*it)->IsSetLabel() && (*it)->GetLabel().IsStr() &&
NStr::Equal((*it)->GetLabel().GetStr(),
m_FieldName)) {
361 it = user->
SetData().erase(it);
375 vector<CConstRef<CObject> > related;
384 }
else if (obj_desc) {
387 related.push_back(obj);
400 vector<CConstRef<CObject> > related;
407 }
else if (obj_desc) {
410 related.push_back(obj);
470 if (!comment_rules) {
480 if (errors.size() == 0) {
491 if (errors.size() == 0) {
507 if (!comment_rules) {
560 if (pos != string::npos) {
561 program =
val.substr(0, pos);
571 string new_val = program;
586 string previous = field.
GetVal(obj);
600 string previous = field.
GetVal(obj);
656 string method = field.
GetVal(obj);
667 string method = field.
GetVal(obj);
780 const string kANI =
"Taxonomic-Update-Statistics";
818 #define ANI_STRING_FIELD_IMPLEMENTATION(Fieldname) \
819 void CANIComment::Set##Fieldname(CUser_object& obj, string val, EExistingText existing_text) \
821 CStructuredCommentField field(kANI, kANI##Fieldname); \
822 field.SetVal(obj, val, existing_text); \
824 string CANIComment::Get##Fieldname(const CUser_object& obj) \
826 CStructuredCommentField field(kANI, kANI##Fieldname); \
827 return field.GetVal(obj); \
829 CANIComment& CANIComment::Set##Fieldname(string val, EExistingText existing_text) \
831 Set##Fieldname(*m_User, val, existing_text); \
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CSeq_entry_Handle GetSeqEntryForSeqdesc(CRef< CScope > scope, const CSeqdesc &seq_desc)
int Compare(const CObject_id &oid2) const
static bool DoesSeqMatchConstraint(CBioseq_Handle bsh, CRef< CStringConstraint > string_constraint)
namespace ncbi::objects::
bool DoesTextMatch(const string &text)
void Assign(const CStringConstraint &other)
Include a standard set of the NCBI C++ Toolkit most basic headers.
The NCBI C++ standard methods for dealing with std::string.
const char * kFieldTypeSeqId
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CScope & GetScope(void) const
Get scope this handle belongs to.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
#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.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
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 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.
static const char label[]
const TStr & GetStr(void) const
Get the variant data.
bool IsSetData(void) const
the object itself Check if a value has been assigned to Data data member.
const TData & GetData(void) const
Get the Data member data.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetLabel(void) const
field label Check if a value has been assigned to Label data member.
TData & SetData(void)
Assign a value to Data data member.
const TStr & GetStr(void) const
Get the variant data.
void SetLabel(TLabel &value)
Assign a value to Label data member.
const TData & GetData(void) const
Get the Data member data.
void SetType(TType &value)
Assign a value to Type data member.
void ResetData(void)
Reset Data data member.
void SetData(TData &value)
Assign a value to Data data member.
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.
vector< CStringUTF8 > TStrs
vector< CRef< CUser_field > > TData
E_Choice Which(void) const
Which variant is currently selected.
@ e_not_set
No variant selected.
const TLocation & GetLocation(void) const
Get the Location member data.
const TUser & GetUser(void) const
Get the variant data.
TUser & SetUser(void)
Select the variant.
bool IsUser(void) const
Check if variant User is selected.
@ e_User
user defined object
@ eMol_na
just a nucleic acid
bool DoesObjectMatchFieldConstraint(const CObject &object, const string &field_name, CRef< objects::edit::CStringConstraint > string_constraint, CRef< objects::CScope > scope)
static const char * prefix[]
@ eExistingText_replace_old
bool AddValueToString(string &str, const string &value, EExistingText existing_text)
Add text to an existing string, using the "existing_text" directive to combine new text with existing...
const string kANIPreviousName
const string kANIAnalysis1
const string kANIA1SubjectCoverage
const string kANIA1QueryCoverage
const string kANIA2SubjectCoverage
const string kANIA2QueryCoverage
USING_SCOPE(ncbi::objects)
const string kExpectedFinalVersion
const string kANICurrentName
const string kAssemblyMethod
const string kGenomeAssemblyData
const string kANIThisGenome
const string kANIA1Genome
const string kSingleCellAmplification
const string kANIAnalysisType
const string kANIDateUpdated
const string kGenomeCoverage
const string kStructuredCommentSuffix
const string kStructuredComment
#define ANI_STRING_FIELD_IMPLEMENTATION(Fieldname)
const string kStructuredCommentPrefix
const string kReferenceGuidedAssembly
const string kANIA2Genome
const string kANIAnalysis2
bool s_UserFieldCompare(const CRef< CUser_field > &f1, const CRef< CUser_field > &f2)
const string kSequencingTechnology