56 :
IEditingAction(seh, name), m_is_descriptor(is_descriptor), m_is_feature(is_feature), m_EditedBiosource(
NULL), m_Desc(
NULL)
100 if (
IsFrom(action) && found_seh && seh != found_seh)
117 if (!found && !
IsNOOP(action))
137 m_Feat = feat_ci->GetSeq_feat_Handle();
249 vector<string>
names;
265 if (
names.size() <= pos + 1) {
269 bool found_keyword =
true;
270 while (pos <
names.size() && found_keyword) {
272 found_keyword =
false;
275 found_keyword =
true;
281 found_keyword =
true;
287 string taxname_after_binomial =
kEmptyStr;
288 while (pos <
names.size()) {
289 taxname_after_binomial +=
names[pos] +
" ";
293 return taxname_after_binomial;
301 return !taxname.empty();
464 :
IEditingActionBiosource(seh, is_descriptor, is_feature,
"CEditingActionBiosourcePrimers"), m_is_fwd(is_fwd), m_is_rev(is_rev), m_is_name(is_name), m_is_seq(is_seq), m_val(
NULL)
478 if (
m_is_fwd && (*qual_it)->IsSetForward())
483 if (
m_is_name && (*primer_it)->IsSetName())
486 m_val = &(*primer_it)->SetName().Set();
489 if (
m_is_seq && (*primer_it)->IsSetSeq())
492 m_val = &(*primer_it)->SetSeq().Set();
502 if ( (!(*primer_it)->IsSetName() || (*primer_it)->GetName().Get().empty()) &&
503 (!(*primer_it)->IsSetSeq() || (*primer_it)->GetSeq().Get().empty()) )
507 if (
m_is_rev && (*qual_it)->IsSetReverse())
512 if (
m_is_name && (*primer_it)->IsSetName())
515 m_val = &(*primer_it)->SetName().Set();
518 if (
m_is_seq && (*primer_it)->IsSetSeq())
521 m_val = &(*primer_it)->SetSeq().Set();
531 if ( (!(*primer_it)->IsSetName() || (*primer_it)->GetName().Get().empty()) &&
532 (!(*primer_it)->IsSetSeq() || (*primer_it)->GetSeq().Get().empty()) )
545 if ( (!(*qual_it)->IsSetForward() || !(*qual_it)->GetForward().IsSet() || (*qual_it)->GetForward().Get().empty()) &&
546 (!(*qual_it)->IsSetReverse() || !(*qual_it)->GetReverse().IsSet() || (*qual_it)->GetReverse().Get().empty()) )
617 reaction->
SetForward().Set().push_back(primer);
621 reaction->
SetReverse().Set().push_back(primer);
653 if ((*qual_it)->IsSetSubtype() && (*qual_it)->GetSubtype() ==
m_qual)
712 if ((*qual_it)->IsSetSubtype() && (*qual_it)->GetSubtype() ==
m_qual)
822 :
CEditingActionBiosourceOrgMod(seh, is_descriptor, is_feature, subtype,
"CEditingActionBiosourceStructuredVoucher"), m_voucher_type(voucher_type)
832 string inst, coll, id;
847 vector<string> values;
849 if (values.size() == 3)
855 else if (values.size() == 2)
860 else if (values.size() == 1)
870 string inst, coll, id;
890 string inst, coll, id;
909 string inst, coll, id;
925 string inst, coll, id;
998 if (!db.empty() && !
tag.empty())
1014 dbtag->
SetTag().SetId(
id);
1030 return db +
":" +
tag;
1041 bool is_descriptor =
true;
1042 bool is_feature =
true;
1050 is_descriptor =
false;
1053 if (
NStr::EqualNocase(field,
"taxname") || field ==
"organism name" || field ==
"org")
1055 if (field ==
"Taxname after Binomial")
1059 if (field ==
"common name" || field ==
"common-name")
1061 if (field ==
"division")
1063 if (field ==
"lineage")
1065 if (field ==
"genome")
1067 if (field ==
"origin")
1069 if (field ==
"fwd-primer-name")
1071 if (field ==
"fwd-primer-seq")
1073 if (field ==
"rev-primer-name")
1075 if (field ==
"rev-primer-seq")
1077 if (field ==
"host")
1079 if (field ==
"note-orgmod" || field ==
"orgmod-note")
1081 if (field ==
"note-subsource" || field ==
"subsource-note" || field ==
"note-subsrc" || field ==
"subsrc-note")
1083 if (field ==
"All primers")
1085 if (field ==
"All notes" || field ==
"all-notes" || field ==
"note")
1087 if (field ==
"bio-material-coll")
1089 if (field ==
"bio-material-inst")
1091 if (field ==
"bio-material-specid")
1093 if (field ==
"culture-collection-coll")
1095 if (field ==
"culture-collection-inst")
1097 if (field ==
"culture-collection-specid")
1099 if (field ==
"specimen-voucher-coll")
1101 if (field ==
"specimen-voucher-inst")
1103 if (field ==
"specimen-voucher-specid")
virtual void Modify(EActionType action)
CEditingActionBiosourceAllNotes(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature)
virtual void SetValue(const string &value)
virtual void ResetValue(void)
virtual bool IsSetValue(void)
CRef< CSubSource > m_SubSource
virtual string GetValue(void)
virtual void ResetValue(void)
virtual string GetValue(void)
virtual void SetValue(const string &value)
CEditingActionBiosourceCommonName(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature)
virtual bool IsSetValue(void)
CEditingActionBiosourceDbxref(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature)
virtual void SetValue(const string &value)
virtual void ResetValue(void)
virtual string GetValue(void)
virtual void Modify(EActionType action)
virtual bool IsSetValue(void)
virtual void ResetValue(void)
virtual void SetValue(const string &value)
virtual bool IsSetValue(void)
virtual string GetValue(void)
CEditingActionBiosourceDivision(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature)
CEditingActionBiosourceLineage(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature)
virtual bool IsSetValue(void)
virtual void SetValue(const string &value)
virtual string GetValue(void)
virtual void ResetValue(void)
virtual void ResetValue(void)
virtual void SetValue(const string &value)
virtual bool IsSetValue(void)
virtual string GetValue(void)
CEditingActionBiosourceLocation(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature)
virtual string GetValue(void)
virtual bool IsSetValue(void)
CEditingActionBiosourceOrgMod(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature, const COrgMod::ESubtype subtype, const string &name="CEditingActionBiosourceOrgMod")
virtual void Modify(EActionType action)
virtual void SetValue(const string &value)
virtual void ResetValue(void)
CEditingActionBiosourceOrigin(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature)
virtual bool IsSetValue(void)
virtual string GetValue(void)
virtual void ResetValue(void)
virtual void SetValue(const string &value)
virtual void ResetValue(void)
virtual string GetValue(void)
CEditingActionBiosourcePrimers(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature, bool is_fwd, bool is_rev, bool is_name, bool is_seq)
virtual void SetValue(const string &value)
virtual void Modify(EActionType action)
CRef< CPCRPrimer > m_primer
CRef< CPCRReaction > m_reaction
virtual bool IsSetValue(void)
virtual void ResetValue(void)
void Parse(const string &str, string &inst, string &coll, string &id)
virtual string GetValue(void)
virtual void SetValue(const string &value)
virtual bool IsSetValue(void)
CEditingActionBiosourceStructuredVoucher(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature, const COrgMod::ESubtype subtype, const int voucher_type)
virtual void Modify(EActionType action)
virtual void SetValue(const string &value)
virtual void ResetValue(void)
CEditingActionBiosourceSubSource(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature, const CSubSource::ESubtype subtype, const string &name="CEditingActionBiosourceSubSource")
virtual bool IsSetValue(void)
CRef< CSubSource > m_SubSource
virtual string GetValue(void)
CSubSource::ESubtype m_qual
virtual void SetValue(const string &value)
string x_GetTextAfterNomial(const string &taxname) const
CEditingActionBiosourceTaxnameAfterBinomial(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature)
virtual bool IsSetValue(void)
virtual void ResetValue(void)
virtual string GetValue(void)
virtual void SetValue(const string &value)
virtual bool IsSetValue(void)
CEditingActionBiosourceTaxname(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature)
virtual void ResetValue(void)
virtual string GetValue(void)
virtual bool Match(const string &value)
@OrgMod.hpp User-defined methods of the data storage class.
static bool IsValidSubtypeName(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static string MakeStructuredVoucher(const string &inst, const string &coll, const string &id)
namespace ncbi::objects::
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static bool IsValidSubtypeName(const string &str, EVocabulary vocabulary=eVocabulary_raw)
CRef< CSeqdesc > m_EditedDesc
CSeq_entry_Handle m_DescContext
virtual bool SameObject()
virtual void Find(EActionType action)
CRef< CSeq_feat > m_EditedFeat
virtual void Modify(EActionType action)
virtual void SwapContext(IEditingAction *source)
virtual void FindRelated(EActionType action)
void SetFeat(CSeq_feat_Handle fh)
void SetDesc(const CSeqdesc *desc)
CBioSource * m_EditedBiosource
IEditingActionBiosource(CSeq_entry_Handle seh, bool is_descriptor, bool is_feature, const string &name)
map< const CSeqdesc *, CSeq_entry_Handle > m_ContextForDescriptors
map< const CSeqdesc *, CSeq_entry_Handle > m_CreatedDescriptors
CSeq_entry_Handle m_TopSeqEntry
map< const CSeqdesc *, CRef< CSeqdesc > > m_ChangedDescriptors
map< CSeq_feat_Handle, CRef< CSeq_feat > > m_ChangedFeatures
CSeq_entry_Handle m_CurrentSeqEntry
void Action(EActionType action)
virtual void SwapContext(IEditingAction *source)
bool IsFrom(EActionType action)
CRef< CEditingActionConstraint > m_constraint
bool IsCreateNew(EActionType action)
bool IsNOOP(EActionType action)
const_iterator end() const
const_iterator find(const key_type &key) const
static const char * nomial_keywords[]
IEditingActionBiosource * CreateActionBiosource(CSeq_entry_Handle seh, string field)
static const struct name_t names[]
static const char * str(char *buf, int n)
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define ENUM_METHOD_NAME(EnumName)
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
NCBI_NS_STD::string::size_type SIZE_TYPE
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
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 whitespace in a string (in-place)
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static bool EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive equality of a substring with another string.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
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 string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
@ fConvErr_NoThrow
Do not throw an exception on error.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
@ eTrunc_End
Truncate trailing whitespace only.
const Tdata & Get(void) const
Get the member data.
const TPcr_primers & GetPcr_primers(void) const
Get the Pcr_primers member data.
TGenome GetGenome(void) const
Get the Genome member data.
TOrigin GetOrigin(void) const
Get the Origin member data.
void ResetGenome(void)
Reset Genome data member.
void ResetOrigin(void)
Reset Origin data member.
void SetSubtype(TSubtype value)
Assign a value to Subtype data member.
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
bool IsSetPcr_primers(void) const
Check if a value has been assigned to Pcr_primers data member.
void SetOrigin(TOrigin value)
Assign a value to Origin data member.
void SetSeq(const TSeq &value)
Assign a value to Seq data member.
const TOrg & GetOrg(void) const
Get the Org member data.
bool IsSetOrigin(void) const
Check if a value has been assigned to Origin data member.
void SetGenome(TGenome value)
Assign a value to Genome data member.
void SetForward(TForward &value)
Assign a value to Forward data member.
bool IsSetGenome(void) const
Check if a value has been assigned to Genome data member.
void SetPcr_primers(TPcr_primers &value)
Assign a value to Pcr_primers data member.
void SetReverse(TReverse &value)
Assign a value to Reverse data member.
void SetName(const TName &value)
Assign a value to Name data member.
void SetOrg(TOrg &value)
Assign a value to Org data member.
void SetName(const TName &value)
Assign a value to Name data member.
const TName & GetName(void) const
Get the Name member data.
EGenome
biological context
bool IsSet(void) const
Check if a value has been assigned to data member.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
void ResetPcr_primers(void)
Reset Pcr_primers data member.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetDb(void) const
name of database or system Check if a value has been assigned to Db data member.
const TTag & GetTag(void) const
Get the Tag member data.
void SetTag(TTag &value)
Assign a value to Tag data member.
bool IsId(void) const
Check if variant Id is selected.
bool IsSetTag(void) const
appropriate tag Check if a value has been assigned to Tag data member.
const TDb & GetDb(void) const
Get the Db member data.
void ResetTag(void)
Reset Tag data member.
const TStr & GetStr(void) const
Get the variant data.
void SetDb(const TDb &value)
Assign a value to Db 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 TLineage & GetLineage(void) const
Get the Lineage member data.
const TDiv & GetDiv(void) const
Get the Div member data.
const TSubname & GetSubname(void) const
Get the Subname member data.
bool IsSetCommon(void) const
common name Check if a value has been assigned to Common data member.
bool IsSetLineage(void) const
lineage with semicolon separators Check if a value has been assigned to Lineage data member.
void SetSubtype(TSubtype value)
Assign a value to Subtype data member.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
const TCommon & GetCommon(void) const
Get the Common member data.
const TDb & GetDb(void) const
Get the Db member data.
bool IsSetDiv(void) const
GenBank division code Check if a value has been assigned to Div data member.
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
bool IsSetSubname(void) const
Check if a value has been assigned to Subname data member.
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
void SetSubname(const TSubname &value)
Assign a value to Subname data member.
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
@ eSubtype_other
ASN5: old-name (254) will be added to next spec.
@ eSubtype_nat_host
natural host of this specimen
@ eSubtype_specimen_voucher
@ eSubtype_culture_collection
void SetData(TData &value)
Assign a value to Data data member.
TSource & SetSource(void)
Select the variant.
@ e_Source
source of materials, includes Org-ref
const GenericPointer< typename T::ValueType > T2 value
const CharType(& source)[N]
Utility macros and typedefs for exploring NCBI objects from seqfeat.asn.
#define ERASE_DBXREF_ON_ORGREF(Itr, Var)
ERASE_DBXREF_ON_ORGREF.
#define ERASE_ORGMOD_ON_BIOSOURCE(Itr, Var)
ERASE_ORGMOD_ON_BIOSOURCE.
#define EDIT_EACH_DBXREF_ON_ORGREF(Itr, Var)
#define EDIT_EACH_PCRPRIMER_IN_PCRPRIMERSET(Itr, Var)
EDIT_EACH_PCRPRIMER_IN_PCRPRIMERSET.
#define EDIT_EACH_ORGMOD_ON_BIOSOURCE(Itr, Var)
#define ERASE_SUBSOURCE_ON_BIOSOURCE(Itr, Var)
ERASE_SUBSOURCE_ON_BIOSOURCE.
#define EDIT_EACH_SUBSOURCE_ON_BIOSOURCE(Itr, Var)
#define ERASE_PCRPRIMER_IN_PCRPRIMERSET(Itr, Var)
ERASE_PCRPRIMER_IN_PCRPRIMERSET.
#define EDIT_EACH_PCRREACTION_IN_PCRREACTIONSET(Itr, Var)
EDIT_EACH_PCRREACTION_IN_PCRREACTIONSET.
#define ERASE_PCRREACTION_IN_PCRREACTIONSET(Itr, Var)
ERASE_PCRREACTION_IN_PCRREACTIONSET.