(parent,
id, caption, pos,
size, style);
103SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
109GetSizer()->SetSizeHints(
this);
157wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
158itemCBulkCmdDlg1->SetSizer(itemBoxSizer2);
163wxStaticText* itemStaticText4 =
newwxStaticText( itemCBulkCmdDlg1, wxID_STATIC,
_(
"From"), wxDefaultPosition, wxDefaultSize, 0 );
164 m_FeatureChoiceSizer->Add(itemStaticText4, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
166wxStaticText* itemStaticText5 =
newwxStaticText( itemCBulkCmdDlg1, wxID_STATIC,
_(
"To"), wxDefaultPosition, wxDefaultSize, 0 );
167 m_FeatureChoiceSizer->Add(itemStaticText5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
169wxStaticText* itemStaticText6 =
newwxStaticText( itemCBulkCmdDlg1, wxID_STATIC,
_(
"Conversion Function"), wxDefaultPosition, wxDefaultSize, 0 );
170 m_FeatureChoiceSizer->Add(itemStaticText6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
186itemBoxSizer2->Add(
m_OptionsSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
188wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
189itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
193itemBoxSizer3->Add(
m_LeaveOriginal, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
197itemBoxSizer3->Add(
m_AddUnverified, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
203itemBoxSizer2->Add(
m_OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
250 m_ErrorMessage=
"You must select a supported conversion function.";
260 stringfield_name =
"";
273vector<CConstRef<CObject> > objs;
276 boolignore_selected =
true;
277 if(!sel_objs.empty()) {
278 boolany_feat =
false;
279vector<CConstRef<CObject> > sel_no_match;
286objs.push_back(it->object);
288sel_no_match.push_back(it->object);
293 if(objs.empty() && any_feat) {
294 if(!sel_no_match.empty()) {
295 intanswer = wxMessageBox(
wxT(
"Selected features do not match constraint - apply to selected feature anyway?"),
296 wxT(
"Error"), wxYES_NO | wxICON_QUESTION,
this);
297 if(answer == wxYES) {
301 intanswer = wxMessageBox(
wxT(
"No selected features are of the correct type. Search all features?"),
302 wxT(
"Error"), wxYES_NO | wxICON_QUESTION,
this);
303 if(answer == wxNO) {
316vector<CConstRef<CObject> > these_objs = col->
GetObjects(*bi);
319objs.push_back (*it);
326 if(objs.size() == 0) {
331 boolany_change =
false;
340 if(
f->IsSetLocation())
343 if(bioseq_to_offset.
find(bsh) == bioseq_to_offset.
end())
344bioseq_to_offset[bsh] = 1;
349 cmd->AddCommand(*subcmd);
365 if(seh && already_done.
find(seh) == already_done.
end())
367already_done.
insert(seh);
372new_desc->SetUser(*user);
381 for(CEnumeratedTypeValues::TValues::const_iterator
i= qual_names.begin();
i!= qual_names.end(); ++
i)
383 stringqual_name =
i->first;
386qual_name =
"locus";
391res.
insert(
"product");
398 if(!string_constraint)
401 boolnegation = string_constraint->GetNegation();
406 stringfield_name = feat_type +
" "+ *qi;
412vector<string> val_list;
416vector<string> add = col->
GetVals(**it);
417val_list.insert(val_list.end(), add.begin(), add.end());
419 if(!val_list.empty())
422res = res && string_constraint->DoesListMatch(val_list);
424res = res || string_constraint->DoesListMatch(val_list);
495 if((*it)->IsBool()) {
496wxCheckBox* opt =
newwxCheckBox(
this,
wxID_ANY,
ToWxString((*it)->GetLabel()), wxDefaultPosition, wxDefaultSize, 0 );
498opt->SetValue((*it)->GetBool()->GetDefaultVal());
500}
else if((*it)->IsString()) {
501 intremaining = num_cols - col;
503 for(
int i= 0;
i< remaining;
i++) {
505 m_OptionsSizer->Add(5, 15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
509wxStaticText*
label=
newwxStaticText(
this, wxID_STATIC,
ToWxString((*it)->GetLabel()), wxDefaultPosition, wxDefaultSize, 0 );
511 constvector<string>& suggested_values = (*it)->GetString()->GetSuggestedValues();
512 if(suggested_values.size() == 0) {
513wxTextCtrl*
val=
newwxTextCtrl(
this,
wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, -1), 0 );
514 m_OptionsSizer->Add(
val, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
515 val->SetValue((*it)->GetString()->GetDefaultVal());
516}
else if((*it)->GetString()->GetOnlySuggested()) {
517wxArrayString choice_strings;
518 ITERATE(vector<string>, sit, suggested_values) {
521wxChoice*
val=
newwxChoice(
this,
wxID_ANY, wxDefaultPosition, wxDefaultSize, choice_strings, 0 );
522 m_OptionsSizer->Add(
val, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
523 val->SetStringSelection((*it)->GetString()->GetDefaultVal());
525wxArrayString choice_strings;
526 ITERATE(vector<string>, sit, suggested_values) {
529wxComboBox*
val=
newwxComboBox(
this,
wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, choice_strings, 0 );
530 m_OptionsSizer->Add(
val, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
531 val->SetStringSelection((*it)->GetString()->GetDefaultVal());
535col = col % num_cols;
556 size_toption_pos = 0;
558 for(
size_tpos = 0; pos <
m_OptionsSizer->GetItemCount() && option_pos < options.size(); pos++) {
560wxCheckBox* checkbox =
dynamic_cast<wxCheckBox*
>(w);
562 if(options[option_pos]->IsBool()) {
563options[option_pos]->SetBool()->SetVal(checkbox->GetValue());
567wxTextCtrl*
val=
dynamic_cast<wxTextCtrl*
>(w);
569 if(options[option_pos]->IsString()) {
570options[option_pos]->SetString()->SetVal(
ToStdString(
val->GetValue()));
574wxComboBox* combo =
dynamic_cast<wxComboBox*
>(w);
576 if(options[option_pos]->IsString()) {
577options[option_pos]->SetString()->SetVal(
ToStdString(combo->GetStringSelection()));
581wxChoice* choice =
dynamic_cast<wxChoice*
>(w);
583 if(options[option_pos]->IsString()) {
584options[option_pos]->SetString()->SetVal(
ToStdString(choice->GetStringSelection()));
User-defined methods of the data storage class.
bool IsGeneralIdProtPresent(objects::CSeq_entry_Handle tse)
TConstScopedObjects GetSelectedObjects()
objects::CSeq_entry_Handle m_TopSeqEntry
bool Create(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxFrameNameStr)
bool GetTopLevelSeqEntryAndProcessor()
void UpdateChildrenFeaturePanels(wxSizer *sizer)
virtual CRef< CCmdComposite > GetCommand()
void ProcessUpdateFeatEvent(wxCommandEvent &event)
wxCheckBox * m_AddUnverified
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxFlexGridSizer * m_OptionsSizer
bool DoesObjectAllQualsMatchFieldConstraint(const CObject &object, const set< string > &qual_list, CRef< edit::CStringConstraint > string_constraint, CRef< CScope > scope)
void CreateControls()
Creates the controls and sizers.
COkCancelPanel * m_OkCancel
CFeatureTypePanel * m_FeatureTypeFrom
void Init()
Initialises member variables.
void x_AddUnverified(objects::CBioseq_Handle bsh, CRef< CCmdComposite > cmd, set< objects::CSeq_entry_Handle > &already_done)
CConvertFeatDlg()
Constructors.
wxFlexGridSizer * m_FeatureChoiceSizer
~CConvertFeatDlg()
Destructor.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
virtual string GetErrorMessage()
wxCheckBox * m_LeaveOriginal
bool Create(wxWindow *parent, wxWindowID id=10147, const wxString &caption=_("Convert Features"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxTextCtrl * m_FunctionDescriptionTxt
virtual void UpdateEditor()
CStringConstraintPanel * m_Constraint
set< string > GetQualList(void)
CFeatureTypePanel * m_FeatureTypeTo
CRef< CConvertFeatureBase > m_Converter
static bool ShowToolTips()
Should we show tooltips?
static CRef< CConvertFeatureBase > Create(objects::CSeqFeatData::ESubtype subtype_from, objects::CSeqFeatData::ESubtype subtype_to)
void SetCreateGeneralOnly(bool flag)
virtual bool CanConvertFrom(objects::CSeqFeatData::ESubtype subtype)
void SetOffset(int *offset)
virtual CRef< CCmdComposite > Convert(const objects::CSeq_feat &orig, bool keep_orig, objects::CScope &scope)
const TOptions & GetOptions() const
virtual string GetDescription()
vector< CRef< CConversionOption > > TOptions
void SetListAllFeats(bool flag)
virtual string GetFieldName(const bool subfield=false)
Returns the name of the field as selected in the panel.
void ListPresentFeaturesFirst(const objects::CSeq_entry_Handle &entry, vector< const objects::CFeatListItem * > *featlist=nullptr)
vector< CConstRef< CObject > > GetRelatedObjects(const CObject &object, CRef< objects::CScope > scope)
vector< string > GetVals(const CObject &object)
vector< CConstRef< CObject > > GetObjects(objects::CBioseq_Handle bsh)
@ eSubtype_transit_peptide_aa
@ eSubtype_sig_peptide_aa
@ 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::
CRef< edit::CStringConstraint > GetStringConstraint()
void SetObjectType(EObjectType obj_type)
void AddUnverifiedFeature()
IWorkbench is the central interface in the application framework.
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator find(const key_type &key) const
const_iterator end() const
static const string kConversionNotSupported
static CSeqFeatData::ESubtype s_GetFeatureSubtypeFromString(const string &key)
#define ID_CF_LEAVE_ORIGINAL
#define ID_CF_FEATURETYPEFROM
#define ID_CF_ADD_UNVERIFIED
#define ID_CF_FUNCTION_DESC
#define ID_CF_FEATURETYPETO
const string kPartialStart
#define EVT_UPDATE_FEATURE_LIST(id, fn)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
list< pair< string, TEnumValueType > > TValues
vector< SConstScopedObject > TConstScopedObjects
#define ENUM_METHOD_NAME(EnumName)
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
#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 bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another 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.
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 const char label[]
EFeat_qual_legal
Access to EFeat_qual_legal's attributes (values, names) as defined in spec.
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)
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