IMPLEMENT_DYNAMIC_CLASS(
CBulkGene, wxDialog )
63wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
74 Create(parent,
id, caption, pos,
size, style);
78wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
79: m_FeatHandles(feat_handles)
83 Create(parent,
id, caption, pos,
size, style);
87 bool CBulkGene::Create( wxWindow* parent, wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
89SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
90SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
91wxDialog::Create( parent,
id, caption, pos,
size, style );
96GetSizer()->SetSizeHints(
this);
122wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
123itemDialog1->SetSizer(itemBoxSizer2);
125wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
126itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
128wxArrayString itemChoiceStrings, itemChoiceStringsWritable;
132wxMessageBox(
wxT(
"No Gene records found"),
wxT(
"Error"), wxOK | wxICON_ERROR);
137 if(values_table->GetNum_rows() < 1)
139wxMessageBox(
wxT(
"No Gene records found"),
wxT(
"Error"), wxOK | wxICON_ERROR);
145itemBoxSizer3->Add(
m_GridPanel, 0, wxALIGN_TOP|wxALL, 5);
148 m_Grid->SetTable(gridAdapter,
true);
149 m_Grid->AutoSizeColumns();
150 intl_height =
m_Grid->GetColLabelSize();
151 m_Grid->SetColLabelSize( 2 * l_height );
159 if((*it)->IsSetHeader() && (*it)->GetHeader().IsSetTitle() )
161 stringtitle = (*it)->GetHeader().GetTitle();
164itemChoiceStrings.Add(wxString(title));
166itemChoiceStringsWritable.Add(wxString(title));
175 if(glyph_col >= 0 && glyph_col+1 <
m_Grid->GetNumberCols())
183itemBoxSizer2->Add(itemStringConstraintPanel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|
wxFIXED_MINSIZE, 0);
188wxBoxSizer* itemBoxSizer13 =
newwxBoxSizer(wxHORIZONTAL);
189itemBoxSizer2->Add(itemBoxSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
191wxButton* itemButton14 =
newwxButton( itemDialog1, wxID_OK,
_(
"Accept"), wxDefaultPosition, wxDefaultSize, 0 );
192itemBoxSizer13->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
194wxButton* itemButton15 =
newwxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
195itemBoxSizer13->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
202id_col->SetHeader().SetField_id(objects::CSeqTable_column_info::eField_id_location_id);
206expand_col->SetHeader().SetTitle(
"");
207expand_col->SetHeader().SetField_name(
"expand");
208expand_col->SetData().SetString();
211locus_col->SetHeader().SetTitle(
"locus");
212locus_col->SetHeader().SetField_name(
"locus");
213locus_col->SetData().SetString();
216locus_tag_col->SetHeader().SetTitle(
"locus_tag");
217locus_tag_col->SetHeader().SetField_name(
"locus_tag");
218locus_tag_col->SetData().SetString();
221desc_col->SetHeader().SetTitle(
"description");
222desc_col->SetHeader().SetField_name(
"description");
223desc_col->SetData().SetString();
226loc_col->SetHeader().SetTitle(
"location");
227loc_col->SetHeader().SetField_name(
"location");
228loc_col->SetData().SetString();
231comment_col->SetHeader().SetTitle(
"comment");
232comment_col->SetHeader().SetField_name(
"comment");
233comment_col->SetData().SetString();
236allele_col->SetHeader().SetTitle(
"allele");
237allele_col->SetHeader().SetField_name(
"allele");
238allele_col->SetData().SetString();
241synonym_col->SetHeader().SetTitle(
"synonym");
242synonym_col->SetHeader().SetField_name(
"synonym");
243synonym_col->SetData().SetString();
247bogus_col->SetHeader().SetTitle(
"");
248bogus_col->SetHeader().SetField_name(
"");
249bogus_col->SetData().SetString();
252 table->SetColumns().push_back(id_col);
253 table->SetColumns().push_back(expand_col);
254 table->SetColumns().push_back(locus_col);
255 table->SetColumns().push_back(locus_tag_col);
256 table->SetColumns().push_back(desc_col);
257 table->SetColumns().push_back(loc_col);
267 table->SetColumns().push_back(comment_col);
268 table->SetColumns().push_back(allele_col);
269 table->SetColumns().push_back(synonym_col);
270 table->SetColumns().push_back(bogus_col);
276 stringlocus,locus_tag,desc,loc,comment, allele, synonym;
278 const CSeq_feat&feat = *fi->GetOriginalSeq_feat();
296id_col->SetData().SetId().push_back(
id);
297expand_col->SetData().SetString().push_back(
"");
298locus_col->SetData().SetString().push_back(locus);
299locus_tag_col->SetData().SetString().push_back(locus_tag);
300desc_col->SetData().SetString().push_back(desc);
301loc_col->SetData().SetString().push_back(loc);
304comment_col->SetData().SetString().push_back(comment);
305allele_col->SetData().SetString().push_back(allele);
306synonym_col->SetData().SetString().push_back(synonym);
307bogus_col->SetData().SetString().push_back(
"");
326 const CSeq_feat&feat = *fi->GetOriginalSeq_feat();
329 stringlocus,locus_tag,desc,loc,comment, allele, synonym;
330 boolmodified =
false;
350 if(row < values_table->GetColumn(
"locus").GetData().GetString().
size())
354 if(new_locus != locus)
356 if(new_locus.empty())
357new_feat->
SetData().SetGene().ResetLocus();
359new_feat->
SetData().SetGene().SetLocus(new_locus);
363 stringnew_locus_tag;
366 if(row < values_table->GetColumn(
"locus_tag").GetData().GetString().
size())
370 if(new_locus_tag != locus_tag)
372 if(new_locus_tag.empty())
373new_feat->
SetData().SetGene().ResetLocus_tag();
375new_feat->
SetData().SetGene().SetLocus_tag(new_locus_tag);
383 if(row < values_table->GetColumn(
"description").GetData().GetString().
size())
387 if(new_desc != desc)
389 if(new_desc.empty())
390new_feat->
SetData().SetGene().ResetDesc();
392new_feat->
SetData().SetGene().SetDesc() = new_desc;
399 if(row < values_table->GetColumn(
"comment").GetData().GetString().
size())
403 if(new_comment != comment)
405 if(new_comment.empty())
415 if(row < values_table->GetColumn(
"allele").GetData().GetString().
size())
418 if(new_allele != allele)
420new_feat->
SetData().SetGene().ResetAllele();
421 if(!new_allele.empty())
422new_feat->
SetData().SetGene().SetAllele(new_allele);
429 if(row < values_table->GetColumn(
"synonym").GetData().GetString().
size())
432 if(new_synonym != synonym)
434new_feat->
SetData().SetGene().ResetSyn();
435vector<string> new_values;
437 for(
const auto&
val: new_values)
439new_feat->
SetData().SetGene().SetSyn().push_back(
val);
444 stringpartial_start_val = partial_start_feat_col->
GetFromFeat(feat);
445 stringnew_partial_start_val;
448 if(row < values_table->GetColumn(
kPartialStart).GetData().GetString().
size())
452 if(new_partial_start_val != partial_start_val)
454 if(new_partial_start_val.empty())
461 stringpartial_stop_val = partial_stop_feat_col->
GetFromFeat(feat);
462 stringnew_partial_stop_val;
465 if(row < values_table->GetColumn(
kPartialStop).GetData().GetString().
size())
469 if(new_partial_stop_val != partial_stop_val)
471 if(new_partial_stop_val.empty())
497 return "Invalid operation in Bulk Gene Edit";
557wxMessageDialog dlg(
this,
_(
"Discard modifications?"),
_(
"Attention"),wxOK|wxCANCEL|wxCENTRE);
558 if(dlg.ShowModal() == wxID_OK)
USING_SCOPE(ncbi::objects)
void CreateControls()
Creates the controls and sizers.
void OnClickOk(wxCommandEvent &event)
CSeqTableGridPanel * m_GridPanel
wxBitmap GetBitmapResource(const wxString &name)
CBulkGene()
Constructors.
virtual const CObject * RowToScopedObjects(int row, TConstScopedObjects &objects, CBioseq_Handle &bsh)
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Gene Editing"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
void Init()
Initialises member variables.
CApplyEditconvertPanel * m_AecrPanel
bool IsReadOnlyColumn(string column_name)
CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >)
CRef< CCmdComposite > GetCommand()
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CRef< objects::CSeq_table > GetValuesTableFromSeqEntry()
vector< CSeq_feat_Handle > m_FeatHandles
void OnClickCancel(wxCommandEvent &event)
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 SetColumnSizesAndChoices()
void InitColumnCollapse(int col)
CRef< objects::CSeq_table > GetValuesTable()
namespace ncbi::objects::
const CSeqTable_column & GetColumn(CTempString column_name) const
IWorkbench is the central interface in the application framework.
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.
void GetLabel(string *label) const
Appends a label suitable for display (e.g., error messages) label must point to an existing string ob...
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
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.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
#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.
bool IsSetSyn(void) const
synonyms for locus Check if a value has been assigned to Syn data member.
const TSyn & GetSyn(void) const
Get the Syn member data.
const TDesc & GetDesc(void) const
Get the Desc member data.
bool IsSetLocus_tag(void) const
systematic gene name (e.g., MI0001, ORF0069) Check if a value has been assigned to Locus_tag data mem...
bool IsSetLocus(void) const
Official gene symbol Check if a value has been assigned to Locus data member.
bool IsSetDesc(void) const
descriptive name Check if a value has been assigned to Desc data member.
bool IsSetAllele(void) const
Official allele designation Check if a value has been assigned to Allele data member.
const TLocus_tag & GetLocus_tag(void) const
Get the Locus_tag member data.
const TLocus & GetLocus(void) const
Get the Locus member data.
const TAllele & GetAllele(void) const
Get the Allele member data.
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 TLocation & GetLocation(void) const
Get the Location member data.
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 TGene & GetGene(void) const
Get the variant data.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
<!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)
#define row(bind, expected)
@ eExistingText_replace_old
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