55 bool modified = (
m_Target != new_target);
63 string descr =
" for ";
64 if (
m_Args[0]->GetValue() ==
"All") {
68 descr +=
m_Args[0]->GetValue();
72 if (
m_Args[index]->GetValue() ==
"true") {
73 descr +=
" and retranslate affected coding regions";
75 if (
m_Args[++index]->GetValue() ==
"true") {
76 descr +=
" and adjust overlapping gene";
84 for (
size_t i = index;
i <
m_Args.size(); ++
i) {
85 variables +=
m_Args[
i]->GetName() +
" = %" +
m_Args[
i]->GetValue() +
"%\n";
94 for (
size_t i = index;
i <
m_Args.size(); ++
i) {
95 function +=
", " +
m_Args[
i]->GetName();
109 m_5PartialMap.emplace(
"Only if at 5' end", make_pair(
"at-end",
" when 5' end of location is at end of sequence"));
110 m_5PartialMap.emplace(
"If bad start codon", make_pair(
"bad-start",
" when coding region has no start codon"));
111 m_5PartialMap.emplace(
"If CDS frame > 1", make_pair(
"frame-not-one",
" when coding region frame > 1"));
116 string descr =
"Set 5' partial";
119 descr += it->second.second;
122 if (
m_Args[2]->GetValue() ==
"true") {
123 descr +=
", extend 5' end of feature to end of sequence";
136 string function = macro::CMacroFunction_Set5Partial::GetFuncName();
139 function +=
"(\"" + it->second.first +
"\"";
146 return { macro::CMacroFunction_Set5Partial::GetFuncName() };
157 m_3PartialMap.emplace(
"Only if at 3' end", make_pair(
"at-end",
" when 3' end of location is at end of sequence"));
158 m_3PartialMap.emplace(
"If bad stop codon", make_pair(
"bad-end",
" when coding region has no stop codon"));
163 string descr =
"Set 3' partial";
166 descr += it->second.second;
169 if (
m_Args[2]->GetValue() ==
"true") {
170 descr +=
", extend 3' end of feature to end of sequence";
183 string function = macro::CMacroFunction_Set3Partial::GetFuncName();
186 function +=
"(\"" + it->second.first +
"\"";
193 return { macro::CMacroFunction_Set3Partial::GetFuncName() };
203 m_BothPartialMap.emplace(
"If both ends at end of sequence", make_pair(
"at-end",
"when both ends of location are at end of sequence"));
208 string descr =
"Set both ends partial";
211 descr += it->second.second;
214 if (
m_Args[2]->GetValue() ==
"true") {
215 descr +=
", extend both ends of feature to end of sequence";
228 string function = macro::CMacroFunction_SetBothPartials::GetFuncName();
231 function +=
"(\"" + it->second.first +
"\"";
238 return { macro::CMacroFunction_SetBothPartials::GetFuncName() };
249 m_5PartialMap.emplace(
"If not at 5' end", make_pair(
"not-at-end",
"when 5' end of feature is not at end of sequence"));
250 m_5PartialMap.emplace(
"If good start codon", make_pair(
"good-start",
"when coding region has start codon"));
255 string descr =
"Clear 5' partial ";
258 descr += it->second.second;
271 string function = macro::CMacroFunction_Clear5Partial::GetFuncName();
274 function +=
"(\"" + it->second.first +
"\"";
281 return { macro::CMacroFunction_Clear5Partial::GetFuncName() };
292 m_3PartialMap.emplace(
"If not at 3' end", make_pair(
"not-at-end",
"when 3' end of feature is not at end of sequence"));
293 m_3PartialMap.emplace(
"If good stop codon", make_pair(
"good-end",
"when coding region has stop codon"));
298 string descr =
"Clear 3' partial ";
301 descr += it->second.second;
314 string function = macro::CMacroFunction_Clear3Partial::GetFuncName();
317 function +=
"(\"" + it->second.first +
"\"";
324 return { macro::CMacroFunction_Clear3Partial::GetFuncName() };
334 m_BothPartialMap.emplace(
"If both ends not at end of sequence", make_pair(
"not-at-end",
"when both ends of feature are not at end of sequence"));
339 string descr =
"Clear both ends partial ";
342 descr += it->second.second;
355 string function = macro::CMacroFunction_RemoveBothPartials::GetFuncName();
358 function +=
"(\"" + it->second.first +
"\"";
365 return { macro::CMacroFunction_RemoveBothPartials::GetFuncName() };
382 from_strand[0] =
tolower((
unsigned char)from_strand[0]);
383 to_strand[0] =
tolower((
unsigned char)to_strand[0]);
385 string descr =
"Convert " + from_strand +
" to " + to_strand;
400 from_strand[0] =
tolower((
unsigned char)from_strand[0]);
401 to_strand[0] =
tolower((
unsigned char)to_strand[0]);
406 string function = macro::CMacroFunction_ConvertLocStrand::GetFuncName();
413 return { macro::CMacroFunction_ConvertLocStrand::GetFuncName() };
446 string function = macro::CMacroFunction_ConvertLocType::GetFuncName();
453 return { macro::CMacroFunction_ConvertLocType::GetFuncName() };
468 string descr =
"Extend ";
475 descr +=
" end of feature to end of sequence";
490 function = macro::CMacroFunction_Extend5Feature::GetFuncName();
493 function = macro::CMacroFunction_Extend3Feature::GetFuncName();
502 return { macro::CMacroFunction_Extend5Feature::GetFuncName() };
505 return { macro::CMacroFunction_Extend3Feature::GetFuncName() };
507 return vector<string>{};
virtual string GetFunction(TConstraints &constraints) const
virtual string GetMacroDescription() const
map< string, pair< string, string > > m_3PartialMap
virtual string GetVariables()
virtual vector< string > GetFunctionNames() const
CClear3PartialTreeItemData()
virtual string GetFunction(TConstraints &constraints) const
map< string, pair< string, string > > m_5PartialMap
virtual vector< string > GetFunctionNames() const
CClear5PartialTreeItemData()
virtual string GetMacroDescription() const
virtual string GetVariables()
CClearBothPartialTreeItemData()
virtual vector< string > GetFunctionNames() const
map< string, pair< string, string > > m_BothPartialMap
virtual string GetFunction(TConstraints &constraints) const
virtual string GetMacroDescription() const
virtual string GetVariables()
virtual vector< string > GetFunctionNames() const
CConvertLocTypeTreeItemData()
virtual string GetMacroDescription() const
virtual string GetFunction(TConstraints &constraints) const
virtual string GetVariables()
CConvertStrandTreeItemData()
virtual vector< string > GetFunctionNames() const
virtual string GetVariables()
virtual string GetFunction(TConstraints &constraints) const
virtual string GetMacroDescription() const
CEditFeatLocTreeItemData(const string &description, const string &panel_name, const TArgumentsVector &arguments)
string x_CommonEditFeatLocVars(size_t index) const
virtual bool UpdateTarget()
string x_CommonEditFeatLocDescr(size_t index) const
virtual void x_AddParamPanel(wxWindow *parent)
string x_CommonEditFeatFunc(size_t index) const
const TArgumentsVector * m_Arguments
virtual string GetVariables()
EMActionType m_ActionType
virtual string GetFunction(TConstraints &constraints) const
virtual vector< string > GetFunctionNames() const
CExtendToSeqEndTreeItemData(EMActionType action_type)
virtual string GetMacroDescription() const
vector< string > GetFeatureTypes(bool for_removal=false, bool to_create=false, bool include_all=false) const
static CMacroEditorContext & GetInstance()
virtual string GetMacroDescription() const
virtual vector< string > GetFunctionNames() const
map< string, pair< string, string > > m_3PartialMap
virtual string GetFunction(TConstraints &constraints) const
CSet3PartialTreeItemData()
virtual string GetVariables()
virtual string GetMacroDescription() const
CSet5PartialTreeItemData()
map< string, pair< string, string > > m_5PartialMap
virtual string GetVariables()
virtual string GetFunction(TConstraints &constraints) const
virtual vector< string > GetFunctionNames() const
virtual vector< string > GetFunctionNames() const
CSetBothPartialTreeItemData()
map< string, pair< string, string > > m_BothPartialMap
virtual string GetVariables()
virtual string GetMacroDescription() const
virtual string GetFunction(TConstraints &constraints) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
void x_LoadPanel(wxWindow *parent, const string &panel_name, const TArgumentsVector &arguments)
unique_ptr< CMacroPanelLoader > m_Panel
constructed panel for specifying function arguments
vector< pair< string, string > > TConstraints
const_iterator end() const
const_iterator find(const key_type &key) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
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.
vector< macro::SArgMetaData > TArgumentsVector
CTempString UpdateTargetForFeatures(const string &feature, const string &qualifier, bool for_removal=false)
void UpdateConstraintsForFeatures(TConstraints &constraints, const string &feature)
void WrapInQuotes(string &str)
const TArgumentsVector & GetConvertLocStrandArgs()
const string kPartialOption
const TArgumentsVector & GetSetPartialArgs()
const TArgumentsVector & GetExtendFeatToSeqEndArgs()
const TArgumentsVector & GetConvertLocTypeArgs()
const string kRetranslate
const TArgumentsVector & GetClearPartialArgs()