51 #include <wx/msgdlg.h>
68 function +=
"(\"pcr-primers..forward..seq\");\n";
70 function +=
"(\"pcr-primers..reverse..seq\");";
96 vector<string> fields{
"altitude",
"collection-date",
"lat-lon" };
102 return "Fix " +
m_Args[0]->GetValue() +
" format";
107 string rt_var =
"obj";
132 return "Fix capitalization in " +
m_ArgList[
kField].GetValue() +
" source qualifier";
139 if (path.find(
',') !=
NPOS) {
140 vector<string> tokens;
145 string rt_var =
"obj";
148 function += CMacroFunction_FixSourceQualCaps::GetFuncName() +
"(" + rt_var +
");";
155 return { CMacroFunction_Resolve::GetFuncName(), CMacroFunction_FixSourceQualCaps::GetFuncName() };
167 string rt_var =
"obj";
169 function += CMacroFunction_FixMouseStrain::GetFuncName() +
CTempString(
"(" + rt_var +
");");
175 return { CMacroFunction_Resolve::GetFuncName(), CMacroFunction_FixMouseStrain::GetFuncName() };
192 string descr =
"Fix pub ";
195 descr +=
"affiliation";
198 descr +=
"affiliation country";
201 descr +=
"affiliation except institute and department";
213 descr +=
" (punctuation only)";
225 string rt_var =
"obj";
252 function +=
"(" + rt_var +
", " +
kPunctonly +
");";
293 function += CMacroFunction_FixAuthorCaps::GetFuncName();
294 function +=
"(" + rt_var +
");";
312 x_LoadPanel(parent, CMacroFunction_RetranslateCDS::GetFuncName(), args);
322 return CMacroFunction_RetranslateCDS::GetFuncName() +
"(" +
kObeyStopCodon +
");";
327 return { CMacroFunction_RetranslateCDS::GetFuncName() };
340 x_LoadPanel(parent, CMacroFunction_RestoreRNAEditing::GetFuncName(), args);
350 return CMacroFunction_RestoreRNAEditing::GetFuncName() +
"(" +
kProteinName +
");";
355 return { CMacroFunction_RestoreRNAEditing::GetFuncName() };
385 string function = CMacroFunction_UpdateReplacedECNumbers::GetFuncName();
392 return { CMacroFunction_UpdateReplacedECNumbers::GetFuncName() };
404 x_LoadPanel(parent, CMacroFunction_AddGeneXref::GetFuncName(), args);
413 bool modified = (
m_Target != new_target);
421 return "Add gene Xrefs from overlapping gene features for " +
m_ArgList[
kFeatType].GetValue() +
" features";
427 return CMacroFunction_AddGeneXref::GetFuncName() +
"();";
432 return { CMacroFunction_AddGeneXref::GetFuncName() };
452 bool modified = (
m_Target != new_target);
460 string descr =
"Remove";
464 if (suppr_type !=
"any") {
465 descr +=
" " + suppr_type;
467 if (necess_type !=
"any") {
468 descr +=
" " + necess_type;
493 string type = dlg_type;
531 descr +=
" when taxnames are inconsistent";
540 constraints.emplace_back(
"class", new_constraint);
542 constraints.emplace_back(
kEmptyStr, CMacroFunction_InconsistentTaxa::GetFuncName() +
CTempString(
"()"));
566 static vector<string> s_test_names;
568 if (s_test_names.empty()) {
570 s_test_names.reserve(
tests.size());
571 for (
auto tn :
tests) {
581 string descr =
"Perform autofix for ";
583 descr +=
m_Args.front()->GetValue();
585 descr +=
" discrepancy report test";
599 unsigned int count = 0;
601 if (!variables.empty()) {
614 function += CMacroFunction_DiscrepancyAutofix::GetFuncName() +
"();";
618 function += CMacroFunction_DiscrepancyAutofix::GetFuncName();
623 if (!
function.
empty()) {
626 function += CMacroFunction_DiscrepancyAutofix::GetFuncName();
637 return { CMacroFunction_DiscrepancyAutofix::GetFuncName() };
660 string descr =
"Autodef ";
662 bool is_complete =
false;
672 descr +=
"complete ";
684 misc_feat_rule =
"look for non-coding product in misc-feature comment";
687 misc_feat_rule =
"use misc-feature comment before first semicolon";
690 if (misc_feat_rule !=
"Delete") {
691 descr +=
", " + misc_feat_rule;
704 misc_feat_rule =
"NonCodingProductFeat";
707 misc_feat_rule =
"CommentFeat";
709 variables +=
kMiscFeatRule +
" = \"" + misc_feat_rule +
"\"";
715 bool is_complete =
false;
736 vector<string> modifiers;
739 if (!modifiers.empty()) {
740 for (
auto& it : modifiers) {
741 function +=
", \"" + it +
"\"";
765 x_LoadPanel(parent, CMacroFunction_ConvertRawToDeltabyNs::GetFuncName(), args);
771 string descr =
"Add assembly gaps ";
772 bool is_assembly_gap =
false;
773 string gap_type, linkage, linkage_evidence;
776 if (!is_assembly_gap) {
780 descr +=
"with gap_type '" + gap_type +
"', ";
781 if (!linkage.empty()) {
782 descr +=
"with linkage '" + linkage +
"', ";
785 descr +=
"with no linkage, ";
788 if (!linkage_evidence.empty()) {
789 descr +=
"with linkage_evidence '" + linkage_evidence +
"'";
792 descr +=
"with no linkage evidence";
795 descr +=
", adjust coding regions";
798 descr +=
", keep gap length";
815 int linkage_evidence = -1;
842 function = CMacroFunction_ConvertRawToDeltabyNs::GetFuncName();
843 function +=
"(" + gap_vars.front();
844 for (
size_t index = 1; index < gap_vars.size(); ++index) {
845 function +=
", " + gap_vars[index];
853 return { CMacroFunction_ConvertRawToDeltabyNs::GetFuncName() };
872 catch (
const exception&) {
883 catch (
const exception&) {
902 x_LoadPanel(parent, CMacroFunction_AddGapFeaturesByNs::GetFuncName(), args);
908 string descr =
"Add gaps";
909 bool is_assembly_gap =
false;
910 string gap_type, linkage, linkage_evidence;
913 if (is_assembly_gap) {
918 descr +=
", adjust coding regions";
921 descr +=
", keep gap length";
953 function = CMacroFunction_AddGapFeaturesByNs::GetFuncName();
954 function +=
"(" + gap_vars.front();
955 for (
size_t index = 1; index < 6; ++index) {
956 function +=
", " + gap_vars[index];
964 return { CMacroFunction_AddGapFeaturesByNs::GetFuncName() };
981 bool is_refseq =
false;
989 bool modified = (new_target !=
m_Target);
997 string descr =
"Set exception to '";
1001 descr +=
", copy exception to note";
1006 feat_product[0] =
tolower((
unsigned char)feat_product[0]);
1007 descr +=
" where feature product is " + feat_product;
1025 feat_product[0] =
tolower((
unsigned char)feat_product[0]);
1029 new_constraint +=
"(\"product\")";
1032 new_constraint =
"NOT " + new_constraint;
1034 constraints.emplace_back(
"product is " + feat_product, new_constraint);
1040 function +=
"(\"except-text\", \"comment\", \"eAppend\", \";\");\n";
1044 function +=
"(\"except-text\", " +
kExceptionType +
", \"eReplace\");\n";
1047 function +=
"(\"except\", true);";
1073 return "Convert gaps of estimated length " +
m_ArgList[
kGapSizeCnv].GetValue() +
" to unknown length gaps";
1086 return CMacroFunction_ToUnknownLengthGap::GetFuncName() +
"(" +
kGapSizeCnv +
");";
1091 return { CMacroFunction_ToUnknownLengthGap::GetFuncName() };
1111 return "Update protein sequences from file, match by ID";
1117 if (filename.empty())
1121 function +=
"(\"" + filename +
"\", \"match_by_id\");";
1138 if (it != fn.m_FArgs.end()) {
User-defined methods of the data storage class.
static const char * kGapType
virtual string GetMacroDescription() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetFunction(TConstraints &constraints) const
virtual string GetVariables()
CAddAssemblyGapsNTreeItemData()
virtual vector< string > GetFunctionNames() const
virtual vector< string > GetFunctionNames() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetVariables()
virtual string GetMacroDescription() const
virtual string GetFunction(TConstraints &constraints) const
virtual string GetMacroDescription() const
virtual string GetFunction(TConstraints &constraints) const
virtual vector< string > GetFunctionNames() const
virtual void x_AddParamPanel(wxWindow *parent)
CAddGeneXrefTreeItemData(const string &description)
virtual bool UpdateTarget()
virtual vector< string > GetFunctionNames() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetVariables()
virtual string GetFunction(TConstraints &constraints) const
virtual string GetMacroDescription() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetMacroDescription() const
CConvertClassTreeItemData()
virtual vector< string > GetFunctionNames() const
virtual string GetFunction(TConstraints &constraints) const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetVariables()
virtual string GetMacroDescription() const
CConvertGapsTreeItemData()
virtual vector< string > GetFunctionNames() const
virtual string GetFunction(TConstraints &constraints) const
CDiscrepancyAutofixTreeItemData(const string &description)
CDiscrepancyAutofixTreeItemData.
virtual string GetMacroDescription() const
vector< string > m_TestVars
virtual vector< string > GetFunctionNames() const
virtual string GetFunction(TConstraints &constraints) const
virtual string GetVariables()
virtual void x_AddParamPanel(wxWindow *parent)
CFixCapsLastNameTreeItemData(const string &description)
virtual string GetFunction(TConstraints &constraints) const
virtual vector< string > GetFunctionNames() const
CFixMouseStrainTreeItemData(const string &description)
virtual string GetFunction(TConstraints &constraints) const
virtual vector< string > GetFunctionNames() const
CTempString x_GetFncName() const
virtual vector< string > GetFunctionNames() const
virtual string GetFunction(TConstraints &constraints) const
CFixPrimerTreeItemData(const string &description, bool fixI)
virtual string GetFunction(TConstraints &constraints) const
CFixPubCapsTreeItemData(const string &description, EMacroFieldType type)
virtual string GetVariables()
virtual string GetMacroDescription() const
virtual vector< string > GetFunctionNames() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetMacroDescription() const
virtual vector< string > GetFunctionNames() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetFunction(TConstraints &constraints) const
CFixSrcQualsTreeItemData(const string &description)
EMacroFieldType m_FieldType
for actions such as appply/edit/etc.
vector< string > x_GetPubFunctions() const
vector< string > GetFeatureTypes(bool for_removal=false, bool to_create=false, bool include_all=false) const
string GetAsnPathToFieldName(const string &field, EMacroFieldType type, const string &target=kEmptyStr)
static CMacroEditorContext & GetInstance()
vector< string > GetFieldNames(EMacroFieldType type) const
string GetFilename() const
void SetFilename(const string &fname)
@ ePubFieldType_AffilCountry
static string GetLabelForType(EPubFieldType field_type)
void SetKeepGapLength(bool value)
bool GetAdjustCDS() const
void GetMinMax(long &min_known, long &max_known, long &min_unknown, long &max_unknown)
void SetAssemblyParams(bool is_assembly_gap, const string &gap_type, const string &linkage, const string &linkage_evidence)
bool GetKeepGapLength() const
void SetMinMax(const long min_known, const long max_known, const long min_unknown, const long max_unknown)
void SetAdjustCDS(bool value)
void GetAssemblyParams(bool &is_assembly_gap, int &gap_type, int &linkage, int &linkage_evidence)
virtual bool UpdateTarget()
virtual vector< string > GetFunctionNames() const
virtual string GetFunction(TConstraints &constraints) const
CRemoveGeneXrefTreeItemData(const string &description)
virtual string GetVariables()
virtual string GetMacroDescription() const
virtual void x_AddParamPanel(wxWindow *parent)
string x_TranslateType(const string &dlg_type) const
virtual vector< string > GetFunctionNames() const
virtual string GetFunction(TConstraints &constraints) const
virtual string GetVariables()
CRestoreRNAEditingTreeItemData(const string &description)
virtual void x_AddParamPanel(wxWindow *parent)
CRetranslateCDSTreeItemData(const string &description)
virtual vector< string > GetFunctionNames() const
virtual string GetFunction(TConstraints &constraints) const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetVariables()
static vector< string > GetListOfLegalExceptions(bool include_refseq)
Produces the list of legal exceptions.
virtual vector< string > GetFunctionNames() const
virtual string GetVariables()
CSetExceptionsTreeItemData()
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetFunction(TConstraints &constraints) const
virtual bool UpdateTarget()
virtual string GetMacroDescription() const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetFunction(TConstraints &constraints) const
bool SetData(const vector< CFuncWithArgs > &func_info)
virtual vector< string > GetFunctionNames() const
CMacroUpdProteinPanel * m_UpdateProtPanel
CUpdateProteinsTreeItemData()
virtual string GetMacroDescription() const
virtual vector< string > GetFunctionNames() const
virtual string GetVariables()
CUpdateReplacedECTreeItemData(const string &description)
virtual string GetMacroDescription() const
virtual string GetFunction(TConstraints &constraints) const
virtual void x_AddParamPanel(wxWindow *parent)
CRawSeqToDeltaByNPanel * m_RawSeqToDeltaPanel
bool m_WithAssemblyParams
bool SetData(const vector< CFuncWithArgs > &func_info)
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
eTestNames GetDiscrepancyCaseName(string_view)
TTestNamesSet GetDiscrepancyTests(TGroup group)
bool Empty(const CNcbiOstrstream &src)
static DbTestEntry * tests
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static const char * sm_Equal
static CTempString GetFuncName()
static CTempString GetFuncName()
static const char * sm_PubAuthors
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
#define ENUM_METHOD_NAME(EnumName)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool StringToBool(const CTempString str)
Convert string to bool.
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)
Convert Int8 to string.
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 const string BoolToString(bool value)
Convert bool to string.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static long StringToLong(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to long.
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 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.
static string & ToLower(string &str)
Convert string to lower case – string& version.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
vector< macro::SArgMetaData > TArgumentsVector
Functions used in the DO/DONE section affecting the top seq-entry.
@ eAddGapFeaturesByNPanel
string GetResolveFuncForPubQualConst(const string &field, const string &rt_var, TConstraints &constraints, EMacroFieldType field_type)
CTempString UpdateTargetForFeatures(const string &feature, const string &qualifier, bool for_removal=false)
void UpdateConstraintsForFeatures(TConstraints &constraints, const string &feature)
string GetResolveFuncForQual(const string &container, const string &field, const string &rt_var, TConstraints &constraints, bool remove_constraint=true)
Generates the definition of rt_var based on input "field".
void OnAutodefCompleteSelected(CArgumentList &list, CArgument &arg)
string GetResolveFuncForPubQual(const string &field, string &rt_var, TConstraints &constraints)
void OnMiscFeatRuleSelected(CArgumentList &list, CArgument &arg)
const vector< string > & GetAddAssemblyGapsNArgs()
const TArgumentsVector & GetUpdateRpldECNumbersArgs()
const string kWhereFeatProduct
const TArgumentsVector & GetRemoveGeneXrefArgs()
const string kMiscFeatRule
const string kExceptionType
const TArgumentsVector & GetSetArgs()
const string kListFeatRule
const string kProteinName
const string kAutodefCompl
const string kLinkEvidence
const string kKeepGapLength
const TArgumentsVector & GetSetExceptionArgs()
const string kSuppressingType
const TArgumentsVector & GetFixPubCapsArgs()
const string kDelMultRepl
const string kNecessaryType
const TArgumentsVector & GetAutodefArgs()
const TArgumentsVector & GetOptionalArgs()
const TArgumentsVector & GetDiscrReportArgs()
const TArgumentsVector & GetConvertSetArgs()
const string kSourceField
const string kDelImproper
const string kMoveExplanation
const string kObeyStopCodon
constexpr bool empty(list< Ts... >) noexcept
C++ wrappers for the Perl-compatible regular expression (PCRE) library.