1 #ifndef GUI_WIDGETS_EDIT___MACRO_EDITOR_CONTEXT__HPP
2 #define GUI_WIDGETS_EDIT___MACRO_EDITOR_CONTEXT__HPP
35 #include <wx/string.h>
36 #include <boost/bimap.hpp>
37 #include <boost/bimap/set_of.hpp>
98 using TBimapStrings = boost::bimap<boost::bimaps::set_of<string, PNocase>,
99 boost::bimaps::set_of<string, PNocase>>;
101 static string FindInBimapOrEmpty(
const string&
type,
const TBimapStrings& str_bimap);
105 string GetAsnPathToFieldName(
const string& feat,
const string& qual);
106 string GetAsnPathToFeature(
const string& feat_name)
const;
108 string GetAsnPathToAuthorFieldName(
const string& author_name);
110 string GetAsnMolinfoValue(
const string& molinfo_field,
const string& choice);
112 vector<string> GetFeatureTypes(
bool for_removal =
false,
bool to_create =
false,
bool include_all =
false)
const;
113 vector<string> GetFeatQualifiers()
const;
114 pair<int, int> GetFeatureType(
const string& name)
const;
116 vector<string> GetLegalQualifiers(
const string& feat_name)
const;
118 vector<string> GetRNATypes()
const;
119 vector<string> GetncRNAClassTypes(
bool include_any =
true)
const;
120 vector<string> GetRNAProductnames(
const string& rna_type)
const;
121 vector<string> GetBondTypes()
const;
122 vector<string> GetSiteTypes()
const;
123 string GetConversionDescr(
const string& from_feat,
const string& to_feat);
129 string GetGUIMolinfoValue(
const string& macro_field,
const string& molinfo_field);
130 string GetGUIAuthorName(
const string& author_part);
132 string GetGUIAffilField(
const string& macro_field);
133 string GetGUIDateField(
const string& macro_field);
134 string GetGUIDescriptor(
const string& macro_field);
137 string GetGUIFeatQualifier(
const string& macro_field);
145 static string s_GetGUIMappedMiscDescr(
const string&
value);
146 static string s_GetGUIMappedStructCommField(
const string&
value);
147 static bool s_IsGeneQualifier(
const string& field);
151 vector<string> x_GetProteinFieldnames()
const;
152 vector<string> x_GetBsrcTextFieldnames(
bool complete =
false)
const;
153 vector<string> x_GetBsrcTaxFieldnames()
const;
154 vector<string> x_GetAllBsrcFieldnames()
const;
155 vector<string> x_GetSetClassFieldnames(
bool all =
true)
const;
156 vector<string> x_GetDescriptorFieldnames()
const;
157 vector<string> x_GetStrCommFieldnames()
const;
160 string x_GetAsnPathToBsrcTax();
161 string x_GetAsnPathToBsrcText();
162 string x_GetAsnPathToAllBsrc();
163 string x_GetAsnPathToMolinfo(
const string& target);
164 string x_GetAsnPathToPub();
165 string x_GetAsnPathToAffilFields();
166 string x_GetAsnPathToMiscDescr(
const string& target);
167 string x_GetAsnPathToDescriptors();
168 string x_GetAsnPathToSet();
169 string x_GetAsnPathToMiscFields();
170 string x_GetAsnPathToDBLinkField(
const string& target);
172 string x_GetAsnPathtoGene();
173 string x_GetAsnPathToCDS();
174 string x_GetAsnPathToRna();
175 string x_GetAsnPathToProtein();
176 string x_GetAsnPathToCdsGeneProt();
177 string x_GetAsnPathToFeatQuals();
178 string x_GetAsnPathToFeatQuals(
const string& feat,
const string& qual);
179 string x_GetAsnPathToRnaFieldName(
const string& rna_type,
const string& field);
191 string x_GetGUIFieldForGene();
192 string x_GetGUIFieldForProtein();
193 string x_GetGUIFieldForRNA();
194 string x_GetGUIFieldForCDS();
203 vector<string> m_SourceTextKeys{
"strain",
"host",
"isolate",
"isolation-source"};
204 vector<string> m_SourceTaxKeys{
"taxname",
"common",
"lineage" };
209 vector<string> m_MiscKeywords{
"Definition line",
"Comment descriptor",
"Keyword" };
210 vector<string> m_MiscKeywordsToRmv{
"Definition line",
"Comment descriptor",
"Keyword",
"Genome Project ID"};
211 vector<string> m_DescrKeywords{
"Biosource",
"molinfo",
"publication",
"structured comment",
"title" };
212 vector<string> m_GeneKeywords{
"gene locus",
"gene description",
"gene comment",
213 "gene allele",
"gene maploc",
"gene locus tag",
"gene synonym" };
214 vector<string> m_RnaKeywords{
"rna product",
"product name",
"rna comment",
"ncRNA class",
"rna codons-recognized",
215 "rna tag-peptide",
"rna anticodon",
"gene locus"};
216 vector<string> m_ProteinKeywords{
"product name",
"protein name",
"product description",
"protein description",
217 "EC number",
"protein activity",
"product comment",
"protein comment" };
218 vector<string> m_FeatQualKeywords{
"cds product",
"product name",
"cds interference",
"anticodon",
"note",
"EC",
"rna",
"misc-feature",
"gene" };
220 vector<string> m_ParseToBsrcKeywords{
"local id",
"definition line",
"defline",
"taxname",
"strain",
"isolate"};
221 vector<string> m_ParseTpCdsGeneProtKeywords{
"local id",
"definition line",
"cds comment",
"gene locus",
"protein name",
"mRNA product",
"mat_peptide" };
222 vector<string> m_BsrcAutodefWords{
"clone",
"cultivar",
"culture-collection",
"haplogroup",
"isolate",
"strain",
"specimen-voucher" };
231 bool m_UseMacroName{
false };
235 : m_Column(col), m_MacroName(macro_name), m_GUIName(
label), m_UseMacroName(use_macro_name) {}
238 return (m_UseMacroName) ? m_MacroName : m_GUIName;
242 m_Column = m_MacroName = m_GUIName =
kEmptyStr;
243 m_UseMacroName =
false;
CMacroEditorContext & operator=(const CMacroEditorContext &)=delete
boost::bimap< boost::bimaps::set_of< string, PNocase >, boost::bimaps::set_of< string, PNocase > > TBimapStrings
vector< string > m_EmptyKeywords
const vector< string > & GetParseToBsrcKeywords() const
vector< string > m_DBLinkKeywords
vector< string > m_Featuretypes
const vector< string > & GetParseToCdsGeneProtKeywords() const
TBimapStrings m_DescriptorMap
vector< string > m_SourceKeywords
static CMacroEditorContext & GetInstance()
CMacroEditorContext(const CMacroEditorContext &)=delete
map< string, pair< int, int > > m_FeatureMap
vector< string > m_PubdescKeywords
vector< string > m_CdsGeneProtKeywords
const vector< string > & GetBsrcKeywords() const
vector< string > m_MolinfoKeywords
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_GUIWIDGETS_EDIT_EXPORT
static const char label[]
Macro engine for macro execution.
const GenericPointer< typename T::ValueType > T2 value
const string & GetFieldName() const
SFieldFromTable(const string &col, const string ¯o_name, const string &label, bool use_macro_name)