wxWindowID
id,
constwxString& caption,
81 constwxPoint& pos,
constwxSize&
size,
longstyle )
82: m_UpdSeqInput(&updseq_in)
86 "Sequence can not be updated: check sequences");
90 string msg(
"Sequence is identical to update sequence");
91wxMessageBox(
ToWxString(
msg),
wxT(
"Info"), wxOK | wxICON_INFORMATION);
95 Create(parent,
id, caption, pos,
size, style);
104 bool CUpdateSeq_Dlg::Create( wxWindow* parent, wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
107SetExtraStyle(wxWS_EX_BLOCK_EVENTS | wxWS_EX_VALIDATE_RECURSIVELY);
108CDialog::Create( parent,
id, caption, pos,
size, style );
112GetSizer()->SetSizeHints(
this);
151wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
152itemDialog1->SetSizer(itemBoxSizer2);
158wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
159itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW | wxALL, 2);
161wxHyperlinkCtrl* itemHyperlinkCtrl =
newwxHyperlinkCtrl(itemDialog1, wxID_HELP,
_(
"Help"),
162 wxT(
"https://www.ncbi.nlm.nih.gov/tools/gbench/manual9/#update-sequence"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE);
163itemHyperlinkCtrl->SetForegroundColour(wxColour(192, 192, 192));
164itemBoxSizer3->Add(itemHyperlinkCtrl, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5);
166itemBoxSizer3->AddStretchSpacer();
168wxButton* itemButton1 =
newwxButton( itemDialog1, wxID_OK,
_(
"Update Sequence"), wxDefaultPosition, wxDefaultSize, 0 );
169itemBoxSizer3->Add(itemButton1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
170itemButton1->Disable();
172wxButton* itemButton2 =
newwxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
173itemBoxSizer3->Add(itemButton2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
203 boolaccept_atleast_one = (
subject.GetBioseqLength() <
query.GetBioseqLength());
210 if(align_vector.size() > 1) {
211 LOG_POST(
Info<<
"More than one alignment was found");
214 if(align_vector.empty())
215 LOG_POST(
Info<<
"Could not form alignment between old and update sequence");
218 size_tbest_align = 0;
219 for(
size_t i= 0;
i< align_vector.size(); ++
i) {
220 for(
size_tj =
i+ 1; j < align_vector.size(); ++j) {
224 _ASSERT(best_align < align_vector.size());
225 result= align_vector[best_align];
234 "Generate alignment for sequence update");
240 stringerrMsg =
"Failed: ";
245FindWindow(wxID_OK)->Enable();
251 catch(
constexception& e) {
252errMsg += e.
what();
257 if(!errMsg.empty()) {
270 string msg=
"The protein sequence associated with this nucleotide sequence has protein features." 271 "The protein sequence and features will be updated when the nucleotide sequence is updated.";
virtual void EndModal(int retCode)
virtual void SetRegistryPath(const string &path)
class CRegistryReadView provides a nested hierarchical view at a particular key.
CRegistryReadView GetReadView(const string §ion) const
CRegistryWriteView GetWriteView(const string §ion)
Sequence update exception class.
SUpdateSeqParams GetData()
void LoadSettings(const CRegistryReadView &view)
bool GetUpdateProteins() const
void SaveSettings(CRegistryWriteView view) const
void UpdatePanel(bool running, const CUpdateSeq_Input *updseq_in=nullptr)
Function updates the panel with new (old, update) sequence pair.
void SetUpdateProteins(bool value)
void SetData(const SUpdateSeqParams ¶ms)
~CUpdateSeq_Dlg()
Destructor.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void x_CalculateAlignment()
CRef< CUpdateSeq_Input > m_UpdSeqInput
virtual void x_SaveSettings(CRegistryWriteView view) const
virtual void x_LoadSettings(const CRegistryReadView &view)
override these functions in derived classes
void OnIdle(wxIdleEvent &event)
CUpdateSeq_Dlg()
Constructors.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void SetData(const SUpdateSeqParams ¶ms)
void Init()
Initialises member variables.
job_future< CConstRef< objects::CSeq_align > > m_Future
void CreateControls()
Creates the controls and sizers.
void OnUpdateSequence(wxCommandEvent &event)
static bool ShowToolTips()
Should we show tooltips?
SUpdateSeqParams GetData() const
CUpdateSeqPanel * m_UpdSeqPanel
bool Create(wxWindow *parent, wxWindowID id=ID_CUPDATESEQ_DLG, const wxString &caption=_("Update Sequence"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
Sets up the old and the update sequences, and generates the alignment between them.
bool IsReadyForUpdate(void) const
void SetAlignment(const objects::CSeq_align *align)
bool OldSeqHasProteinFeats() const
bool HaveIdenticalResidues(void) const
const objects::CBioseq_Handle & GetUpdateBioseq(void) const
const objects::CBioseq_Handle & GetOldBioseq(void) const
Interface for testing cancellation request in a long lasting operation.
Stores parameters regarding the type of sequence update, on how to handle existing features and on ho...
static bool CompareAlignments(const objects::CSeq_align &align_first, const objects::CSeq_align &align_sec)
Returns true if the first alignment is 'better' than the second one Compares the Blast scores and in ...
static vector< CConstRef< objects::CSeq_align > > RunBlast2Seq(const objects::CBioseq_Handle &subject, const objects::CBioseq_Handle &query, bool accept_atleast_one, ICanceled *canceled=nullptr)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
void Info(CExceptionArgs_Base &args)
EDialogReturnValue NcbiMessageBox(const string &message, TDialogType type=eDialog_Ok, EDialogIcon icon=eIcon_Exclamation, const string &title="Error", EDialogTextMode text_mode=eRaw)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
virtual bool IsCanceled(void) const =0
job_function_traits< _Fty >::future job_async(const _Fty &_Fnarg, const string &descr)
void ReportUsage(const wxString &dialog_name)
Report opening & accepting events in the editing package.
const struct ncbi::grid::netcache::search::fields::SIZE size
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static CConstRef< CSeq_align > s_CreateAlign(CBioseq_Handle subject, CBioseq_Handle query, ICanceled &canceled)
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