A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/align__tab__export__page2_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/packages/pkg_alignment/align_tab_export_page2.cpp Source File

35 #include <wx/checkbox.h> 36 #include <wx/choice.h> 37 #include <wx/button.h> 38 #include <wx/textctrl.h> 39 #include <wx/stattext.h> 40 #include <wx/listbox.h> 41 #include <wx/checklst.h> 42 #include <wx/valgen.h> 43 #include <wx/valtext.h> 44 #include <wx/msgdlg.h> 45 #include <wx/filedlg.h> 46 #include <wx/bitmap.h> 48 #include <wx/settings.h> 87 

wxPanel::Create( parent,

id

, pos,

size

, style );

92

GetSizer()->SetSizeHints(

this

);

122  wxT

(

"Aligned bases"

),

126  wxT

(

"Mismatches"

),

135  m_Sizer

=

new

wxBoxSizer(wxVERTICAL);

136

itemPanel1->SetSizer(

m_Sizer

);

138

wxFlexGridSizer* itemFlexGridSizer3 =

new

wxFlexGridSizer(0, 2, 0, 0);

139  m_Sizer

->Add(itemFlexGridSizer3, 1, wxGROW|wxALL, 0);

141

wxStaticText* itemStaticText4 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Select alignment:"

), wxDefaultPosition, wxDefaultSize, 0 );

142

itemFlexGridSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

144

wxStaticText* itemStaticText5 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Select fields:"

), wxDefaultPosition, wxDefaultSize, 0 );

145

itemFlexGridSizer3->Add(itemStaticText5, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

147

wxArrayString m_AlignListStrings;

148  m_AlignList

=

new

wxListBox( itemPanel1,

ID_LISTBOX

, wxDefaultPosition, wxDefaultSize, m_AlignListStrings, wxLB_SINGLE );

149

itemFlexGridSizer3->Add(

m_AlignList

, 0, wxGROW|wxGROW|wxALL, 5);

151

wxArrayString m_FieldListStrings;

152  m_FieldList

=

new

wxCheckListBox( itemPanel1,

ID_CHECKLISTBOX

, wxDefaultPosition, wxDefaultSize, m_FieldListStrings, wxLB_SINGLE );

153

itemFlexGridSizer3->Add(

m_FieldList

, 0, wxGROW|wxGROW|wxALL, 5);

155

itemFlexGridSizer3->AddGrowableRow(1);

156

itemFlexGridSizer3->AddGrowableCol(0);

157

itemFlexGridSizer3->AddGrowableCol(1);

164

wxStaticText* loadingText =

new

wxStaticText(

this

,

ID_LOADING_TEXT

,

wxT

(

"Loading alignments from Named Annotations ..."

), wxDefaultPosition, wxDefaultSize, 0);

165

wxFont bold(wxNORMAL_FONT->GetPointSize(), wxNORMAL_FONT->GetFamily(), wxNORMAL_FONT->GetStyle(), wxFONTWEIGHT_BOLD, wxNORMAL_FONT->GetUnderlined(), wxNORMAL_FONT->GetFaceName());

166

loadingText->SetFont(bold);

167

loadingText->SetForegroundColour(*wxBLACK);

168  m_LoadingSizer

->Add(loadingText, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);

171  m_LoadingSizer

->Add(progress, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5);

173

wxStaticText* errorText =

new

wxStaticText(

this

,

ID_LOADING_ERROR

,

"NA DB error"

, wxDefaultPosition, wxDefaultSize, 0);

174

errorText->SetForegroundColour(*wxRED);

175

errorText->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  return

wxPanel::TransferDataToWindow();

231

wxStaticText* loadingText =

dynamic_cast<

wxStaticText*

>

(FindWindow(

ID_LOADING_TEXT

));

232

loadingText->SetLabelText(

"Loading alignment names ..."

);

242  static const string

errTitle(

"Failed to get alignement names for "

);

246  const CSeq_loc

* seqLoc =

dynamic_cast<const CSeq_loc

*

>

(obj.object.GetPointerOrNull());

250  CScope

* scope = obj.scope;

261

vector<string>

names

;

263  CAlign_CI

aln_iter(*scope, *seqLoc, sel);

269  if

(iter->IsNamed()) {

270  if

(iter->GetName().find(

"@@"

) == string::npos) {

271  names

.emplace_back(iter->GetName());

285  catch

(

const

exception& e) {

286  CNcbiDiag

() <<

Error

<<

"["

<< errTitle + seqIdLabel <<

"] Exception: "

<< e.

what

();

289

},

"Get alignment names"

);

294

wxStaticText* loadingText =

dynamic_cast<

wxStaticText*

>

(FindWindow(

ID_LOADING_TEXT

));

295

loadingText->SetLabelText(

"Loading Named Annotations alignments..."

);

302  static const string

errTitle(

"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  static

TAnnotMap cachedAnnots;

324

cachedSeqId.

Reset

();

325

cachedAnnots.clear();

327  LOG_POST

(

Info

<<

"Retrieve NA meta-data for "

<< seqIdLabel);

335

TAnnotMap& cacheRef = cachedAnnots;

338

if (v.second->m_AnnotType ==

"align"

) cacheRef[v.second->m_Name] = v.second;

344

vector<tuple<string, string> >

names

;

349

vector<string> alignNames;

352  CAlign_CI

aln_iter(*scope, *seqLoc, sel);

358  if

(iter->IsNamed() && iter->GetName().find(

"@@"

) == string::npos) {

359  string

name = iter->GetName();

360

TAnnotMap::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

(

const

exception& e) {

375  CNcbiDiag

() <<

Error

<<

"["

<< errTitle + seqIdLabel <<

"] Exception: "

<< e.

what

();

378

},

"Get NA DB alignment names"

);

394

wxArrayString annotNames;

397

annotNames.push_back(

i

);

403  if

(!annotNames.empty()) {

405  if

(!selAlignment.empty())

415  catch

(

const

exception& e) {

428

wxArrayString annotNames;

432  const string

& accession = std::get<0>(

i

);

433  const string

& title = std::get<1>(

i

);

437

annotNames.push_back(title);

439  if

(selAcc == accession)

440

selAlignment = title;

443  if

(!annotNames.empty()) {

445  if

(!selAlignment.empty())

460  catch

(

const

exception& e) {

479

wxStaticText* errorText =

dynamic_cast<

wxStaticText*

>

(FindWindow(

ID_LOADING_ERROR

));

480

errorText->SetLabelText(errMsg);

494

wxMessageBox(

wxT

(

"The location doesn't contain alignments.\n"

)

495  wxT

(

"Please, go back and select another location."

),

wxT

(

"Error"

),

496

wxOK | wxICON_ERROR,

this

);

501  if

(alignName.empty()) {

502

wxMessageBox(

wxT

(

"Please select an alignment"

),

wxT

(

"Error"

),

503

wxOK | wxICON_ERROR,

this

);

510

vector<string> checked;

517  if

(checked.empty()) {

518

wxMessageBox(

wxT

(

"Please, select some fields for export."

),

wxT

(

"Error"

),

519

wxOK | wxICON_ERROR,

this

);

526  return

wxPanel::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