IMPLEMENT_DYNAMIC_CLASS(
CBulkCDS, wxDialog )
55BEGIN_EVENT_TABLE(
CBulkCDS, wxDialog )
70wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
81 Create(parent,
id, caption, pos,
size, style);
85wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
86: m_FeatHandles(feat_handles)
90 Create(parent,
id, caption, pos,
size, style);
94 bool CBulkCDS::Create( wxWindow* parent, wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
96SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
97SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
98wxDialog::Create( parent,
id, caption, pos,
size, style );
103GetSizer()->SetSizeHints(
this);
129wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
130itemDialog1->SetSizer(itemBoxSizer2);
132wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
133itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
135wxArrayString itemChoiceStrings, itemChoiceStringsWritable;
139wxMessageBox(
wxT(
"No CDS records found"),
wxT(
"Error"), wxOK | wxICON_ERROR);
144 if(values_table->GetNum_rows() < 1)
146wxMessageBox(
wxT(
"No CDS records found"),
wxT(
"Error"), wxOK | wxICON_ERROR);
152itemBoxSizer3->Add(
m_GridPanel, 0, wxALIGN_TOP|wxALL, 5);
155 m_Grid->SetTable(gridAdapter,
true);
156 m_Grid->AutoSizeColumns();
157 intl_height =
m_Grid->GetColLabelSize();
158 m_Grid->SetColLabelSize( 2 * l_height );
165 if((*it)->IsSetHeader() && (*it)->GetHeader().IsSetTitle() )
167 stringtitle = (*it)->GetHeader().GetTitle();
170itemChoiceStrings.Add(wxString(title));
172itemChoiceStringsWritable.Add(wxString(title));
181 if(glyph_col >= 0 && glyph_col+1 <
m_Grid->GetNumberCols())
187wxBoxSizer* itemBoxSizer4 =
newwxBoxSizer(wxHORIZONTAL);
188itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
193wxBoxSizer* itemBoxSizer5 =
newwxBoxSizer(wxHORIZONTAL);
194itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
203wxBoxSizer* itemBoxSizer13 =
newwxBoxSizer(wxHORIZONTAL);
204itemBoxSizer2->Add(itemBoxSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
206wxButton* itemButton14 =
newwxButton( itemDialog1, wxID_OK,
_(
"Accept"), wxDefaultPosition, wxDefaultSize, 0 );
207itemBoxSizer13->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
209wxButton* itemButton15 =
newwxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
210itemBoxSizer13->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
217id_col->SetHeader().SetField_id(objects::CSeqTable_column_info::eField_id_location_id);
221expand_col->SetHeader().SetTitle(
"");
222expand_col->SetHeader().SetField_name(
"expand");
223expand_col->SetData().SetString();
226name_col->SetHeader().SetTitle(
"protein name");
227name_col->SetHeader().SetField_name(
"protein_name");
228name_col->SetData().SetString();
231desc_col->SetHeader().SetTitle(
"protein description");
232desc_col->SetHeader().SetField_name(
"protein_description");
233desc_col->SetData().SetString();
236loc_col->SetHeader().SetTitle(
"location");
237loc_col->SetHeader().SetField_name(
"location");
238loc_col->SetData().SetString();
241comment_col->SetHeader().SetTitle(
"comment");
242comment_col->SetHeader().SetField_name(
"comment");
243comment_col->SetData().SetString();
246ec_number_col->SetHeader().SetTitle(
"ec number");
247ec_number_col->SetHeader().SetField_name(
"ec_number");
248ec_number_col->SetData().SetString();
251activity_col->SetHeader().SetTitle(
"activity");
252activity_col->SetHeader().SetField_name(
"activity");
253activity_col->SetData().SetString();
257bogus_col->SetHeader().SetTitle(
"");
258bogus_col->SetHeader().SetField_name(
"");
259bogus_col->SetData().SetString();
262 table->SetColumns().push_back(id_col);
263 table->SetColumns().push_back(expand_col);
264 table->SetColumns().push_back(name_col);
265 table->SetColumns().push_back(desc_col);
266 table->SetColumns().push_back(loc_col);
276 table->SetColumns().push_back(comment_col);
277 table->SetColumns().push_back(ec_number_col);
278 table->SetColumns().push_back(activity_col);
279 table->SetColumns().push_back(bogus_col);
292 if(!fi->IsSetProduct())
continue;
295 if(!prot_bsh || !prot_bsh.
IsProtein())
continue;
300 stringname,desc,loc,comment;
303 CFeat_CIprot_feat_ci(prot_bsh, sel);
308 if(
prot.IsSetName())
309name =
prot.GetName().front();
310 if(
prot.IsSetDesc())
311desc =
prot.GetDesc();
317 if( fi->GetOriginalSeq_feat()->IsSetLocation() )
318fi->GetOriginalSeq_feat()->GetLocation().GetLabel(&loc);
320 if(fi->GetOriginalSeq_feat()->IsSetComment())
321comment = fi->GetOriginalSeq_feat()->GetComment();
325ec_feat_action->
SetFeat(*fi);
326 constvector<string>& ec_values = ec_feat_action->
GetValues();
327 stringec_number =
NStr::Join(ec_values,
"|");
330act_feat_action->
SetFeat(*fi);
331 constvector<string>& act_values = act_feat_action->
GetValues();
332 stringactivity =
NStr::Join(act_values,
"|");
334id_col->SetData().SetId().push_back(
id);
335expand_col->SetData().SetString().push_back(
"");
336name_col->SetData().SetString().push_back(name);
337desc_col->SetData().SetString().push_back(desc);
338loc_col->SetData().SetString().push_back(loc);
341comment_col->SetData().SetString().push_back(comment);
342ec_number_col->SetData().SetString().push_back(ec_number);
343activity_col->SetData().SetString().push_back(activity);
344bogus_col->SetData().SetString().push_back(
"");
370 boolnot_asked =
true;
373 if(!fi->IsSetProduct())
continue;
376 if(!prot_bsh || !prot_bsh.
IsProtein())
continue;
379new_cds->
Assign(*fi->GetOriginalSeq_feat());
381 stringname,desc,loc;
382 stringsave_old_name;
385 CFeat_CIprot_feat_ci(prot_bsh, sel);
392 boolmodified =
false;
394 if(
prot.IsSetName())
395name =
prot.GetName().front();
396 if(
prot.IsSetDesc())
397desc =
prot.GetDesc();
404 if(row < values_table->GetColumn(
"protein_name").GetData().GetString().
size())
408 if(new_name != name)
410 if(new_name.empty())
411new_feat->
SetData().SetProt().ResetName();
414 if(new_feat->
SetData().SetProt().SetName().empty())
415new_feat->
SetData().SetProt().SetName().push_back(new_name);
417new_feat->
SetData().SetProt().SetName().front() = new_name;
423save_old_name = name;
430 if(row < values_table->GetColumn(
"protein_description").GetData().GetString().
size())
434 if(new_desc != desc)
436 if(new_desc.empty())
437new_feat->
SetData().SetProt().ResetDesc();
439new_feat->
SetData().SetProt().SetDesc() = new_desc;
445ec_feat_action->
SetFeat(*fi);
446 constvector<string>& ec_values = ec_feat_action->
GetValues();
447 stringold_ec_number =
NStr::Join(ec_values,
"|");
448 stringnew_ec_number;
451 if(row < values_table->GetColumn(
"ec_number").GetData().GetString().
size())
454 if(new_ec_number != old_ec_number)
462new_feat->
SetData().SetProt().ResetEc();
463vector<string> new_values;
465 for(
const auto&
val: new_values)
469new_feat->
SetData().SetProt().SetEc().push_back(
val);
476act_feat_action->
SetFeat(*fi);
477 constvector<string>& act_values = act_feat_action->
GetValues();
478 stringold_activity =
NStr::Join(act_values,
"|");
482 if(row < values_table->GetColumn(
"activity").GetData().GetString().
size())
485 if(new_activity != old_activity)
488new_feat->
SetData().SetProt().ResetActivity();
489vector<string> new_values;
491 for(
const auto&
val: new_values)
495new_feat->
SetData().SetProt().SetActivity().push_back(
val);
507 if( fi->GetOriginalSeq_feat()->IsSetLocation() )
508fi->GetOriginalSeq_feat()->GetLocation().GetLabel(&loc);
510 boolchanged_feat =
false;
519 if(row < values_table->GetColumn(
"comment").GetData().GetString().
size())
523 if(!save_old_name.empty())
525 if(new_comment.empty())
526new_comment = save_old_name;
531 string msg=
"Do you want to overwrite existing comment values?";
532 intanswer = wxMessageBox(
ToWxString(
msg),
wxT(
"Existing Text"), wxYES_NO | wxCANCEL | wxICON_QUESTION,
this);
533 if(answer == wxCANCEL)
537 else if(answer == wxYES)
545 if(dlg.ShowModal() == wxID_OK) {
558 if(new_comment != comment)
560 if(new_comment.empty())
564changed_feat =
true;
568 stringpartial_start_val = partial_start_feat_col->
GetFromFeat(*fi->GetOriginalSeq_feat());
569 stringnew_partial_start_val;
572 if(row < values_table->GetColumn(
kPartialStart).GetData().GetString().
size())
576 if(new_partial_start_val != partial_start_val)
578 if(new_partial_start_val.empty())
582changed_feat =
true;
585 stringpartial_stop_val = partial_stop_feat_col->
GetFromFeat(*fi->GetOriginalSeq_feat());
586 stringnew_partial_stop_val;
589 if(row < values_table->GetColumn(
kPartialStop).GetData().GetString().
size())
593 if(new_partial_stop_val != partial_stop_val)
595 if(new_partial_stop_val.empty())
599changed_feat =
true;
627new_mrna->
Assign(*orig_mrna);
629new_mrna->
SetData().SetRna().SetRnaProductName(prot_name, remainder);
647 return "Invalid operation in Bulk CDS Edit";
707wxMessageDialog dlg(
this,
_(
"Discard modifications?"),
_(
"Attention"),wxOK|wxCANCEL|wxCENTRE);
708 if(dlg.ShowModal() == wxID_OK)
USING_SCOPE(ncbi::objects)
vector< CSeq_feat_Handle > m_FeatHandles
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("CDS Editing"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void CreateControls()
Creates the controls and sizers.
CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >)
void OnClickCancel(wxCommandEvent &event)
CSeqTableGridPanel * m_GridPanel
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void GetUpdateMRNAProductNameCmd(CRef< CSeq_feat > cds, CScope &scope, const string &prot_name, CRef< CCmdComposite > composite)
void Init()
Initialises member variables.
wxCheckBox * m_CopyProtNameToComment
virtual const CObject * RowToScopedObjects(int row, TConstScopedObjects &objects, CBioseq_Handle &bsh)
CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
CRef< CCmdComposite > GetCommand()
CApplyEditconvertPanel * m_AecrPanel
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CRef< objects::CSeq_table > GetValuesTableFromSeqEntry()
CStringConstraintSelect * m_StringConstraintPanel
void OnClickOk(wxCommandEvent &event)
bool IsReadOnlyColumn(string column_name)
void AddCommand(IEditCommand &command)
objects::edit::EExistingText GetExistingTextHandler()
void AllowAdditionalQual(bool val)
static CRef< CFeatureSeqTableColumnBase > Create(const string &sTitle, objects::CSeqFeatData::ESubtype subtype=objects::CSeqFeatData::eSubtype_any)
virtual void ClearInFeature(objects::CSeq_feat &in_out_feat)
virtual string GetFromFeat(const objects::CSeq_feat &in_out_feat)
virtual bool AddToFeature(objects::CSeq_feat &in_out_feat, const string &newValue, objects::edit::EExistingText existing_text)
CConstRef< objects::CSeq_submit > m_SeqSubmit
Seq-loc and seq-align mapper exceptions.
void MakeColumnReadOnly(int pos, bool val=true)
void InitColumnCollapse(int col)
CRef< objects::CSeq_table > GetValuesTable()
namespace ncbi::objects::
const CProt_ref * GetProtXref(void) const
get protein (if present) from Seq-feat.xref list
void RemoveQualifier(const string &qual_name)
Remove all qualifiers with the given name; do nothing if no such qualifier exists.
void SetProtXref(CProt_ref &value)
const CSeqTable_column & GetColumn(CTempString column_name) const
virtual void SetFeat(CSeq_feat_Handle fh)
void SetTopSeqEntry(CSeq_entry_Handle seh)
const vector< string > & GetValues(void)
IWorkbench is the central interface in the application framework.
CIRef< IEditingAction > CreateAction(CSeq_entry_Handle seh, const string &field, CFieldNamePanel::EFieldType field_type, int subtype, const string &ncRNA_class=kEmptyStr, CConstRef< objects::CSeq_submit > submit=CConstRef< objects::CSeq_submit >(NULL))
const string kPartialStart
const string kPartialStop
const char * kSequenceIdColLabel
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
vector< SConstScopedObject > TConstScopedObjects
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
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)
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
bool IsProtein(void) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
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 string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
void SetHeader(THeader &value)
Assign a value to Header data member.
vector< CRef< CSeqTable_column > > TColumns
const TString & GetString(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
bool IsSetComment(void) const
Check if a value has been assigned to Comment data member.
void SetComment(const TComment &value)
Assign a value to Comment data member.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
void ResetComment(void)
Reset Comment data member.
const TComment & GetComment(void) const
Get the Comment member data.
const TProt & GetProt(void) const
Get the variant data.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
const struct ncbi::grid::netcache::search::fields::SIZE size
CRef< CSeqTable_column > AddStringColumnToTable(CRef< CSeq_table > table, string label)
void AddValueToColumn(CRef< CSeqTable_column > column, string value, size_t row, edit::EExistingText existing_text=edit::eExistingText_replace_old)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define row(bind, expected)
@ 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...
wxString ToWxString(const string &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