wxPanel::Create( parent,
id, pos,
size, style );
92GetSizer()->SetSizeHints(
this);
122 wxT(
"Aligned bases"),
126 wxT(
"Mismatches"),
135 m_Sizer=
newwxBoxSizer(wxVERTICAL);
136itemPanel1->SetSizer(
m_Sizer);
138wxFlexGridSizer* itemFlexGridSizer3 =
newwxFlexGridSizer(0, 2, 0, 0);
139 m_Sizer->Add(itemFlexGridSizer3, 1, wxGROW|wxALL, 0);
141wxStaticText* itemStaticText4 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Select alignment:"), wxDefaultPosition, wxDefaultSize, 0 );
142itemFlexGridSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
144wxStaticText* itemStaticText5 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Select fields:"), wxDefaultPosition, wxDefaultSize, 0 );
145itemFlexGridSizer3->Add(itemStaticText5, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
147wxArrayString m_AlignListStrings;
148 m_AlignList=
newwxListBox( itemPanel1,
ID_LISTBOX, wxDefaultPosition, wxDefaultSize, m_AlignListStrings, wxLB_SINGLE );
149itemFlexGridSizer3->Add(
m_AlignList, 0, wxGROW|wxGROW|wxALL, 5);
151wxArrayString m_FieldListStrings;
152 m_FieldList=
newwxCheckListBox( itemPanel1,
ID_CHECKLISTBOX, wxDefaultPosition, wxDefaultSize, m_FieldListStrings, wxLB_SINGLE );
153itemFlexGridSizer3->Add(
m_FieldList, 0, wxGROW|wxGROW|wxALL, 5);
155itemFlexGridSizer3->AddGrowableRow(1);
156itemFlexGridSizer3->AddGrowableCol(0);
157itemFlexGridSizer3->AddGrowableCol(1);
164wxStaticText* loadingText =
newwxStaticText(
this,
ID_LOADING_TEXT,
wxT(
"Loading alignments from Named Annotations ..."), wxDefaultPosition, wxDefaultSize, 0);
165wxFont bold(wxNORMAL_FONT->GetPointSize(), wxNORMAL_FONT->GetFamily(), wxNORMAL_FONT->GetStyle(), wxFONTWEIGHT_BOLD, wxNORMAL_FONT->GetUnderlined(), wxNORMAL_FONT->GetFaceName());
166loadingText->SetFont(bold);
167loadingText->SetForegroundColour(*wxBLACK);
168 m_LoadingSizer->Add(loadingText, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
171 m_LoadingSizer->Add(progress, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5);
173wxStaticText* errorText =
newwxStaticText(
this,
ID_LOADING_ERROR,
"NA DB error", wxDefaultPosition, wxDefaultSize, 0);
174errorText->SetForegroundColour(*wxRED);
175errorText->SetFont(bold);
176 m_LoadingSizer->Add(errorText, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
207 if(fields.empty()) {
221 m_AlignList->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
224 returnwxPanel::TransferDataToWindow();
231wxStaticText* loadingText =
dynamic_cast<wxStaticText*
>(FindWindow(
ID_LOADING_TEXT));
232loadingText->SetLabelText(
"Loading alignment names ...");
242 static const stringerrTitle(
"Failed to get alignement names for ");
246 const CSeq_loc* seqLoc =
dynamic_cast<const CSeq_loc*
>(obj.object.GetPointerOrNull());
250 CScope* scope = obj.scope;
261vector<string>
names;
263 CAlign_CIaln_iter(*scope, *seqLoc, sel);
269 if(iter->IsNamed()) {
270 if(iter->GetName().find(
"@@") == string::npos) {
271 names.emplace_back(iter->GetName());
285 catch(
constexception& e) {
286 CNcbiDiag() <<
Error<<
"["<< errTitle + seqIdLabel <<
"] Exception: "<< e.
what();
289},
"Get alignment names");
294wxStaticText* loadingText =
dynamic_cast<wxStaticText*
>(FindWindow(
ID_LOADING_TEXT));
295loadingText->SetLabelText(
"Loading Named Annotations alignments...");
302 static const stringerrTitle(
"Failed to NA meta-data for ");
306 const CSeq_loc* seqLoc =
dynamic_cast<const CSeq_loc*
>(obj.object.GetPointerOrNull());
310 CScope* scope = obj.scope;
320 staticTAnnotMap cachedAnnots;
324cachedSeqId.
Reset();
325cachedAnnots.clear();
327 LOG_POST(
Info<<
"Retrieve NA meta-data for "<< seqIdLabel);
335TAnnotMap& cacheRef = cachedAnnots;
338if (v.second->m_AnnotType ==
"align") cacheRef[v.second->m_Name] = v.second;
344vector<tuple<string, string> >
names;
349vector<string> alignNames;
352 CAlign_CIaln_iter(*scope, *seqLoc, sel);
358 if(iter->IsNamed() && iter->GetName().find(
"@@") == string::npos) {
359 stringname = iter->GetName();
360TAnnotMap::const_iterator it = cachedAnnots.find(name);
361 if(it != cachedAnnots.end())
362 names.emplace_back(name, it->second->m_Title);
364 names.emplace_back(name, name);
374 catch(
constexception& e) {
375 CNcbiDiag() <<
Error<<
"["<< errTitle + seqIdLabel <<
"] Exception: "<< e.
what();
378},
"Get NA DB alignment names");
394wxArrayString annotNames;
397annotNames.push_back(
i);
403 if(!annotNames.empty()) {
405 if(!selAlignment.empty())
415 catch(
constexception& e) {
428wxArrayString annotNames;
432 const string& accession = std::get<0>(
i);
433 const string& title = std::get<1>(
i);
437annotNames.push_back(title);
439 if(selAcc == accession)
440selAlignment = title;
443 if(!annotNames.empty()) {
445 if(!selAlignment.empty())
460 catch(
constexception& e) {
479wxStaticText* errorText =
dynamic_cast<wxStaticText*
>(FindWindow(
ID_LOADING_ERROR));
480errorText->SetLabelText(errMsg);
494wxMessageBox(
wxT(
"The location doesn't contain alignments.\n")
495 wxT(
"Please, go back and select another location."),
wxT(
"Error"),
496wxOK | wxICON_ERROR,
this);
501 if(alignName.empty()) {
502wxMessageBox(
wxT(
"Please select an alignment"),
wxT(
"Error"),
503wxOK | wxICON_ERROR,
this);
510vector<string> checked;
517 if(checked.empty()) {
518wxMessageBox(
wxT(
"Please, select some fields for export."),
wxT(
"Error"),
519wxOK | wxICON_ERROR,
this);
526 returnwxPanel::TransferDataFromWindow();
static const wxString sFields[]
virtual void SaveSettings() const
virtual bool TransferDataFromWindow()
bool Create(wxWindow *parent, wxWindowID id=ID_CALIGNTABEXPORTPAGE2, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
wxBoxSizer * m_LoadingSizer
virtual void SetRegistryPath(const string &path)
IRegSettings.
void x_ReportError(const string errMsg)
void x_StartAlignNamesJob()
wxBitmap GetBitmapResource(const wxString &name)
wxIcon GetIconResource(const wxString &name)
void x_StartNAAlignNamesJob()
virtual bool TransferDataToWindow()
wxCheckListBox * m_FieldList
virtual void LoadSettings()
void OnIdle(wxIdleEvent &event)
job_future< vector< tuple< string, string > > > m_FutureNANames
map< string, string > m_TitleToAccession
CAlignTabExportParams & GetData()
static bool ShowToolTips()
job_future< vector< string > > m_FutureNames
string GetAlignmentName() const
void SetFields(vector< string > value)
void SetAlignmentName(string value)
vector< string > GetFields() const
const TAnnotNames & GetAnnotNames(void) const
Interface for testing cancellation request in a long lasting operation.
const_iterator begin() const
const_iterator end() const
container_type::value_type value_type
const_iterator find(const key_type &key) const
const_iterator find(const key_type &key) const
const_iterator end() const
static const struct name_t names[]
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#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.
#define NCBI_REPORT_EXCEPTION(title, ex)
Generate a report on the exception.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
void Info(CExceptionArgs_Base &args)
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
void GetAllNAMetaData(TNAMetaDataSet &md_set, const string &context="", ICanceled *canceledCallback=0) const
Get meta-data for a given NAA associated with seq_id.
static const string & GetUnnamedAnnot()
Get the commonly used symbol representing a unnnamed annotation.
static void SetResolveDepth(objects::SAnnotSelector &sel, bool adaptive, int depth=-1)
help function for setting selector resolve depth.
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
SAnnotSelector & SetCollectNames(bool value=true)
Collect available annot names rather than annots.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
virtual bool IsCanceled(void) const =0
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
void Start(void)
Start the timer.
job_function_traits< _Fty >::future job_async(const _Fty &_Fnarg, const string &descr)
const struct ncbi::grid::netcache::search::fields::SIZE size
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