(cf != created_features.
end())
212 cmd->AddCommand(*chgFeat);
214 cmd->AddCommand(*update_mrna_cmd);
215 if(retranslate_cds_cmd)
216 cmd->AddCommand(*retranslate_cds_cmd);
228 if(cd != created_descriptors.
end())
238 else if(dd != deleted_descriptors.
end())
241 const CSeqdesc*old_desc = it->first;
246 const CSeqdesc*old_desc = it->first;
267 autoctxt_it = descr_contexts.
find(old_desc);
268 if(ctxt_it != descr_contexts.
end()) {
270 cmd->AddCommand(*ecmd);
279 const CObject* actual =
dynamic_cast<const CObject*
>(&submit);
282 cmd->AddCommand(*chg_submit);
308prot_product = *name_it;
309 if(!prot_product.empty())
325new_mrna->
Assign(*orig_mrna);
327new_mrna->
SetData().SetRna().SetRnaProductName(prot_product, remainder);
337 boolcds_change(
false);
432 void IEditingAction::Edit(
const string& find,
const string& replace, macro::CMacroFunction_EditStringQual::ESearchLoc edit_loc,
boolcase_insensitive,
boolis_regex)
470 source->SwapContext(
this);
476 source->IEditingAction::SwapContext(
this);
494 source->SwapContext(
this);
500 source->IEditingAction::SwapContext(
this);
518 source->SwapContext(
this);
524 source->IEditingAction::SwapContext(
this);
543 source->SwapContext(
this);
549 source->IEditingAction::SwapContext(
this);
818parse_options.SetShouldRemove(
false);
832action2->ResetChangedFeatures();
833action2->ResetChangedDescriptors();
834action2->ResetChangedInstances();
835action2->ResetChangedIds();
836action2->ResetChangedValues();
847 const string& ncRNA_class,
892 if(!field_name_panel)
899 if(field_name.empty())
909 if(field ==
"protein name"|| field ==
"protein description"|| field ==
"protein EC number" 910|| field ==
"protein activity"|| field ==
"protein comment")
914 else if(field ==
"CDS comment"|| field ==
"CDS inference"|| field ==
"codon-start")
918 else if( field ==
"gene description"|| field ==
"gene comment" 919|| field ==
"gene inference"|| field ==
"gene allele"|| field ==
"gene maploc" 920|| field ==
"gene locus tag"|| field ==
"gene synonym"|| field ==
"gene old_locus_tag" 921|| field ==
"gene locus")
925 else if(field ==
"mRNA product"|| field ==
"mRNA comment")
929 else if(field ==
"mat_peptide name"|| field ==
"mat_peptide description"|| field ==
"mat_peptide EC number" 930|| field ==
"mat_peptide activity"|| field ==
"mat_peptide comment")
951 if(!rna_type.empty())
953 if(rna_type ==
"preRNA")
955 else if(rna_type ==
"mRNA")
957 else if(rna_type ==
"tRNA")
959 else if(rna_type ==
"rRNA")
961 else if(rna_type ==
"ncRNA") {
962ncRNA_class = ncrna_class;
965 else if(rna_type ==
"tmRNA")
967 else if(rna_type ==
"miscRNA")
978ncRNA_class =
"any";
982ncRNA_class =
"snRNA";
986ncRNA_class =
"scRNA";
990ncRNA_class =
"snoRNA";
997 const CSeqdesc* old_desc =
dynamic_cast<const CSeqdesc*
>(
object.GetPointer());
998 const CSeq_feat* old_feat =
dynamic_cast<const CSeq_feat*
>(
object.GetPointer());
1004new_desc->
Assign(*old_desc);
1005new_obj = (
CObject*)new_desc;
1006}
else if(old_feat) {
1009new_feat->
Assign(*old_feat);
1010new_obj = (
CObject*)new_feat;
1019 boolsuccess =
false;
1027 if(seh && new_desc) {
1029 cmd->AddCommand(*ecmd);
1032}
else if(old_feat) {
1046 const string&field,
1049 const string& ncRNA_class,
1054action->SetConstraint(constraint);
1061vector<CConstRef<CObject> > objs;
1062 for(
auto&fh : feathdlesmap)
1064objs.emplace_back(fh.first.GetSeq_feat());
1066 for(
auto&dh : descrmap)
1070 for(
auto&bh : instmap)
1079 if(!descrmap.
empty() && descr_context) {
1081descr_context->clear();
1082 for(
auto& it : contextmap) {
1083descr_context->emplace_back(it.second);
CSeq_entry_Handle GetSeqEntryForSeqdesc(CRef< CScope > scope, const CSeqdesc &seq_desc)
bool IsGeneralIdProtPresent(objects::CSeq_entry_Handle tse)
virtual string GetFieldName(const bool subfield=false)
Returns the name of the field as selected in the panel.
void Add(CObject *obj, const CObject *new_obj)
string GetRnaTypeOnly(void)
string GetNcrnaType(void)
virtual bool Match(const string &value)
@ eFieldType_BankITComment
@ eFieldType_TaxnameAfterBinomial
@ eFieldType_StructuredComment
string GetRnaTypeOnly(void)
string GetNcrnaType(void)
static CRef< CCmdComposite > RetranslateCDSCommand(CScope &scope, const CSeq_feat &old_cds, CSeq_feat &cds, bool &cds_change, int &offset, bool create_general_only)
ESubtype GetSubtype(void) const
static E_Choice GetTypeFromSubtype(ESubtype subtype)
@ eSubtype_mat_peptide_aa
static ESubtype SubtypeNameToValue(CTempString sName)
Turn a string into its ESubtype which is NOT necessarily related to the identifier of the enum.
namespace ncbi::objects::
void SetExistingText(edit::EExistingText existing_text)
const string GetName(void) const
void SetTopSeqEntry(CSeq_entry_Handle seh)
virtual void FindRelated(EActionType action)=0
virtual void SetValue(const string &value)=0
edit::EExistingText m_existing_text
map< const CSeqdesc *, CSeq_entry_Handle > m_ContextForDescriptors
CRef< CSubmit_block > GetChangedSubmitBlock(void)
void ResetChangedFeatures(void)
virtual void Find(EActionType action)=0
void ConvertFrom(ECapChange cap_change, bool leave_on_original, const string &strip_name, IEditingAction *destination)
void Apply(const string &value)
virtual void Modify(EActionType action)=0
map< const CSeqdesc *, CSeq_entry_Handle > m_CreatedDescriptors
void SetConstraint(CRef< CEditingActionConstraint > constraint)
const vector< string > & GetChangedValues(void)
const map< const CSeqdesc *, CSeq_entry_Handle > & GetDeletedDescriptors(void)
CSeq_entry_Handle m_TopSeqEntry
void ResetChangedDescriptors(void)
CConstRef< objects::CSeq_submit > m_SeqSubmit
const map< CSeq_feat_Handle, CRef< CSeq_feat > > & GetChangedFeatures(void)
const map< CBioseq_Handle, CRef< CSeq_inst > > & GetChangedInstances(void)
void ConvertTo(const string &value, IEditingAction *source)
void ResetChangedIds(void)
map< const CSeqdesc *, CRef< CSeqdesc > > m_ChangedDescriptors
IEditingAction(CSeq_entry_Handle seh, const string &name, CConstRef< objects::CSeq_submit > submit=CConstRef< objects::CSeq_submit >(NULL))
macro::CMacroFunction_EditStringQual::ESearchLoc m_edit_loc
map< CSeq_feat_Handle, CRef< CSeq_feat > > m_ChangedFeatures
CRef< CCmdComposite > GetActionCommand(void)
CRef< CCmdComposite > GetRetranslateCdsCmd(const CSeq_feat_Handle fh, const CRef< CSeq_feat > feat, int &offset, bool create_general_only)
void DoRemoveOutside(void)
void RemoveOutside(CRef< macro::CRemoveTextOptions > options)
CRef< CSubmit_block > m_ChangedSubmitBlock
virtual bool SameObject()=0
const map< const CSeqdesc *, CSeq_entry_Handle > & GetContextForDescriptors(void)
bool IsTo(EActionType action)
int CheckForExistingText(CIRef< IEditingAction > action2, EActionType action_type, edit::CParseTextOptions parse_options=edit::CParseTextOptions())
void CopyTo(const string &value, IEditingAction *source)
CIRef< IEditCommand > GetUpdateMRNAProductNameCmd(const CSeq_feat_Handle fh, const CRef< CSeq_feat > feat)
CSeq_entry_Handle m_CurrentSeqEntry
void SwapFrom(IEditingAction *destination)
CConstRef< objects::CSeq_submit > GetSeqSubmit(void)
void CopyFrom(IEditingAction *destination)
void Action(EActionType action)
vector< string > m_ChangedValues
const map< const CSeqdesc *, CRef< CSeqdesc > > & GetChangedDescriptors(void)
void SwapTo(const string &value, IEditingAction *source)
void ParseFrom(edit::CParseTextOptions parse_options, IEditingAction *destination)
CRef< macro::CRemoveTextOptions > m_remove_options
map< CSeq_feat_Handle, CSeq_entry_Handle > m_CreatedFeatures
void ResetChangedInstances(void)
const vector< string > & GetValues(void)
@ eActionType_RemoveOutside
@ eActionType_ConvertFrom
edit::CParseTextOptions m_parse_options
virtual void SwapContext(IEditingAction *source)
bool IsFrom(EActionType action)
virtual bool IsSetValue(void)=0
const map< CSeq_feat_Handle, CSeq_entry_Handle > & GetCreatedFeatures(void)
virtual void ResetValue(void)=0
CRef< CEditingActionConstraint > m_constraint
void ResetChangedValues(void)
bool IsCreateNew(EActionType action)
const map< const CSeqdesc *, CSeq_entry_Handle > & GetCreatedDescriptors(void)
virtual void ResetScope()
map< const CSeqdesc *, CSeq_entry_Handle > m_DeletedDescriptors
void Edit(const string &find, const string &replace, macro::CMacroFunction_EditStringQual::ESearchLoc edit_loc, bool case_insensitive, bool is_regex)
void ParseTo(const string &value, IEditingAction *source)
virtual string GetValue(void)=0
bool IsNOOP(EActionType action)
void HandleValue(const string &value)
map< CBioseq_Handle, CRef< CSeq_inst > > m_ChangedInstances
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
CChangeUnindexedObjectCommand< objects::CSubmit_block > CChangeSubmitBlockCommand
static auto & RemoveFieldNameFromString
static auto & FixCapitalizationInString
IEditingActionBiosource * CreateActionBiosource(CSeq_entry_Handle seh, string field)
IEditingActionDesc * CreateActionDesc(CSeq_entry_Handle seh, const string &field, CConstRef< objects::CSeq_submit > submit=CConstRef< objects::CSeq_submit >(NULL))
IEditingActionFeat * CreateActionCdsGeneProt(CSeq_entry_Handle seh, string field, const CSeqFeatData::ESubtype subtype, const string &ncRNA_class=kEmptyStr)
IEditingActionFeat * CreateActionFeat(CSeq_entry_Handle seh, string field, const CSeqFeatData::ESubtype subtype, const CSeqFeatData::E_Choice feat_type, const string &ncRNA_class)
IEditingActionFeat * CreateActionRna(CSeq_entry_Handle seh, string field, const CSeqFeatData::ESubtype subtype, const string &ncRNA_class)
IEditingAction * CreateActionMisc(CSeq_entry_Handle seh, const string &field)
CEditingActionSeqid * CreateActionSeqid(CSeq_entry_Handle seh, const string &field)
int CorrectForncRNASubtypes(CSeqFeatData::ESubtype subtype, string &ncRNA_class)
int GetSubtype(CFieldNamePanel *field_name_panel, string &ncRNA_class)
CRef< CCmdComposite > GetReplacementCommand(CConstRef< CObject > oldobj, CRef< CObject > newobj, CScope &scope, const string &cmd_name)
vector< CConstRef< CObject > > GetObjects(CSeq_entry_Handle seh, const string &field, CFieldNamePanel::EFieldType field_type, int subtype, const string &ncRNA_class, CConstRef< CSeq_submit > submit, CRef< CEditingActionConstraint > constraint, vector< CSeq_entry_Handle > *descr_context)
CRef< CObject > GetNewObject(CConstRef< CObject > object)
CIRef< IEditingAction > CreateAction(CSeq_entry_Handle seh, const string &field, CFieldNamePanel::EFieldType field_type, int subtype, const string &ncRNA_class, CConstRef< objects::CSeq_submit > submit)
static void cleanup(void)
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)
void CleanupForTaxnameChange(CObjectInfo oi)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
const CSeq_feat * GetCDSForProduct(const CBioseq &product, CScope *scope)
Get the encoding CDS feature of a given protein sequence.
CConstRef< CSeq_feat > GetmRNAforCDS(const CSeq_feat &cds, CScope &scope)
GetmRNAforCDS A function to find a CSeq_feat representing the appropriate mRNA for a given CDS.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
TClass GetClass(void) const
virtual const CSeq_loc & GetLocation(void) const
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
bool IsSetClass(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
bool HasParentEntry(void) const
Check if current seq-entry has a parent.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
#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 BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
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 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.
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.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
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 TData & GetData(void) const
Get the Data member data.
const TExcept_text & GetExcept_text(void) const
Get the Except_text member data.
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
void SetData(TData &value)
Assign a value to Data data member.
const TProt & GetProt(void) const
Get the variant data.
@ eClass_nuc_prot
nuc acid and coded proteins
const TSource & GetSource(void) const
Get the variant data.
bool IsSource(void) const
Check if variant Source is selected.
TSource & SetSource(void)
Select the variant.
const TSub & GetSub(void) const
Get the Sub member data.
const GenericPointer< typename T::ValueType > T2 value
const CharType(& source)[N]
Utility macros and typedefs for exploring NCBI objects from seqfeat.asn.
#define FOR_EACH_NAME_ON_PROTREF(Itr, Var)
FOR_EACH_NAME_ON_PROTREF EDIT_EACH_NAME_ON_PROTREF.
@ 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...
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