NCBI C++ ToolKit
blast_search_params_panel.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /*$Id: blast_search_params_panel.cpp 47464 2023-04-20 00:19:10Z evgeniev $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Andrey Yazhuk
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
36 
38 
46 
48 
49 #include <wx/sizer.h>
50 #include <wx/button.h>
51 #include <wx/image.h>
52 #include <wx/statbox.h>
53 #include <wx/stattext.h>
54 #include <wx/checkbox.h>
55 #include <wx/combobox.h>
56 #include <wx/choice.h>
57 #include <wx/msgdlg.h>
58 
59 
60 
61 ////@begin XPM images
62 ////@end XPM images
63 
65 
66 
67 IMPLEMENT_DYNAMIC_CLASS( CBLASTSearchParamsPanel, CAlgoToolManagerParamsPanel )
68 
70 ////@begin CBLASTSearchParamsPanel event table entries
71  EVT_CHOICE( ID_REPEAT_TYPE, CBLASTSearchParamsPanel::OnRepeatTypeSelected )
72 
73  EVT_CHOICE( ID_WMTI_CHOICE, CBLASTSearchParamsPanel::OnWindowmaskerTaxIdSelected )
74 
76 
78 
79 ////@end CBLASTSearchParamsPanel event table entries
81 
82 
84  : m_AutoDelete(this)
85 {
86  Init();
87 }
88 
89 
91  wxWindow* parent,
92  wxWindowID id,
93  const wxPoint& pos,
94  const wxSize& size,
95  long style)
96  : m_AutoDelete(this)
97 {
98  Init();
99  Create(parent, id, pos, size, style);
100 }
101 
102 
103 bool CBLASTSearchParamsPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
104 {
105  wxPanel::Create( parent, id, pos, size, style );
106 
107  Hide();
108 
109  CreateControls();
110  if (GetSizer())
111  {
112  GetSizer()->SetSizeHints(this);
113  }
114  Centre();
115 
116  return true;
117 }
118 
119 
121 {
122 ////@begin CBLASTSearchParamsPanel destruction
123 ////@end CBLASTSearchParamsPanel destruction
124 }
125 
127 {
128 ////@begin CBLASTSearchParamsPanel member initialisation
136  m_RepeatType = NULL;
140  m_WMStatic = NULL;
141  m_WMTaxIds = NULL;
142  m_WMDownload = NULL;
145 ////@end CBLASTSearchParamsPanel member initialisation
146 
147  m_Params = NULL;
148 }
149 
150 
152 {
153 ////@begin CBLASTSearchParamsPanel content construction
154  CBLASTSearchParamsPanel* itemCAlgoToolManagerParamsPanel1 = this;
155 
156  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
157  itemCAlgoToolManagerParamsPanel1->SetSizer(itemBoxSizer2);
158 
159  wxStaticText* itemStaticText3 = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_STATIC, _("Selected options:"), wxDefaultPosition, wxDefaultSize, 0 );
160  itemBoxSizer2->Add(itemStaticText3, 0, wxALIGN_LEFT|wxALL, 5);
161 
162  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
163  itemBoxSizer2->Add(itemBoxSizer4, 0, wxGROW|wxALL, 5);
164 
165  wxStaticBox* itemStaticBoxSizer5Static = new wxStaticBox(itemCAlgoToolManagerParamsPanel1, wxID_ANY, _("General Parameters"));
166  wxStaticBoxSizer* itemStaticBoxSizer5 = new wxStaticBoxSizer(itemStaticBoxSizer5Static, wxVERTICAL);
167  itemBoxSizer4->Add(itemStaticBoxSizer5, 1, wxGROW|wxALL, 5);
168 
169  m_GeneralSizer = new wxFlexGridSizer(0, 2, 0, 0);
170  itemStaticBoxSizer5->Add(m_GeneralSizer, 1, wxGROW, 5);
171 
172  wxStaticText* itemStaticText7 = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_STATIC, _("Word size:"), wxDefaultPosition, wxDefaultSize, 0 );
173  m_GeneralSizer->Add(itemStaticText7, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
174 
175  wxTextCtrl* itemTextCtrl8 = new wxTextCtrl( itemCAlgoToolManagerParamsPanel1, ID_WORDSIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
176  m_GeneralSizer->Add(itemTextCtrl8, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5);
177 
178  wxStaticText* itemStaticText9 = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_STATIC, _("e-value:"), wxDefaultPosition, wxDefaultSize, 0 );
179  m_GeneralSizer->Add(itemStaticText9, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
180 
181  wxTextCtrl* itemTextCtrl10 = new wxTextCtrl( itemCAlgoToolManagerParamsPanel1, ID_E_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
182  m_GeneralSizer->Add(itemTextCtrl10, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5);
183 
184  m_ThreshLabel = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_STATIC, _("Threshold:"), wxDefaultPosition, wxDefaultSize, 0 );
185  m_GeneralSizer->Add(m_ThreshLabel, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
186 
187  m_ThreshInput = new wxTextCtrl( itemCAlgoToolManagerParamsPanel1, ID_THRESHOLD, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
188  m_GeneralSizer->Add(m_ThreshInput, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5);
189 
190  m_QueryGenCodeLabel = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_ANY, _("Query genetic code:"), wxDefaultPosition, wxDefaultSize, 0 );
191  m_GeneralSizer->Add(m_QueryGenCodeLabel, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
192 
193  wxArrayString m_QueryGenCodeComboStrings;
194  m_QueryGenCodeCombo = new wxComboBox( itemCAlgoToolManagerParamsPanel1, ID_GEN_CODE, wxEmptyString, wxDefaultPosition, wxSize(itemCAlgoToolManagerParamsPanel1->ConvertDialogToPixels(wxSize(100, -1)).x, -1), m_QueryGenCodeComboStrings, wxCB_READONLY );
195  m_GeneralSizer->Add(m_QueryGenCodeCombo, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
196 
197  m_DbGenCodeLabel = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_ANY, _("DB genetic code:"), wxDefaultPosition, wxDefaultSize, 0 );
198  m_GeneralSizer->Add(m_DbGenCodeLabel, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
199 
200  wxArrayString m_DbGenCodeComboStrings;
201  m_DbGenCodeCombo = new wxComboBox( itemCAlgoToolManagerParamsPanel1, ID_COMBOBOX, wxEmptyString, wxDefaultPosition, wxSize(itemCAlgoToolManagerParamsPanel1->ConvertDialogToPixels(wxSize(100, -1)).x, -1), m_DbGenCodeComboStrings, wxCB_READONLY );
202  m_GeneralSizer->Add(m_DbGenCodeCombo, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
203 
204  m_GeneralSizer->AddGrowableCol(1);
205 
206  wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL);
207  itemBoxSizer4->Add(itemBoxSizer17, 1, wxALIGN_TOP, 5);
208 
209  wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox(itemCAlgoToolManagerParamsPanel1, wxID_ANY, _("Filtering Parameters"));
210  wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(itemStaticBoxSizer18Static, wxVERTICAL);
211  itemBoxSizer17->Add(itemStaticBoxSizer18, 0, wxGROW|wxALL, 5);
212 
213  wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxVERTICAL);
214  itemStaticBoxSizer18->Add(itemBoxSizer19, 1, wxGROW, 5);
215 
216  wxCheckBox* itemCheckBox20 = new wxCheckBox( itemCAlgoToolManagerParamsPanel1, ID_LOW_COMPLEXITY, _("Filter low complexity regions"), wxDefaultPosition, wxDefaultSize, 0 );
217  itemCheckBox20->SetValue(false);
218  itemBoxSizer19->Add(itemCheckBox20, 0, wxALIGN_LEFT|wxALL, 5);
219 
220  wxStaticText* itemStaticText21 = new wxStaticText( itemCAlgoToolManagerParamsPanel1, ID_STATIC_REPEAT_TYPE, _("Species specific repeats for:"), wxDefaultPosition, wxDefaultSize, 0 );
221  itemBoxSizer19->Add(itemStaticText21, 0, wxALIGN_LEFT|wxALL, 5);
222 
223  wxArrayString m_RepeatTypeStrings;
224  m_RepeatType = new wxChoice( itemCAlgoToolManagerParamsPanel1, ID_REPEAT_TYPE, wxDefaultPosition, wxDefaultSize, m_RepeatTypeStrings, 0 );
225  itemBoxSizer19->Add(m_RepeatType, 0, wxALIGN_LEFT|wxALL, 5);
226 
227  m_LCRegionsCheck = new wxCheckBox( itemCAlgoToolManagerParamsPanel1, ID_MASK_LOWERCASE, _("Mask lowercase regions"), wxDefaultPosition, wxDefaultSize, 0 );
228  m_LCRegionsCheck->SetValue(false);
229  itemBoxSizer19->Add(m_LCRegionsCheck, 0, wxALIGN_LEFT|wxALL, 5);
230 
231  m_RepeatsCheck = new wxCheckBox( itemCAlgoToolManagerParamsPanel1, ID_MASK_REPEATS, _("Mask repeats"), wxDefaultPosition, wxDefaultSize, 0 );
232  m_RepeatsCheck->SetValue(false);
233  itemBoxSizer19->Add(m_RepeatsCheck, 0, wxALIGN_LEFT|wxALL, 5);
234 
235  wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxVERTICAL);
236  itemBoxSizer2->Add(itemBoxSizer25, 0, wxGROW|wxALL, 5);
237 
238  wxStaticText* itemStaticText26 = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_STATIC, _("BLAST algorithm requires at most one filtering database. It may be either "), wxDefaultPosition, wxDefaultSize, 0 );
239  itemStaticText26->Wrap(500);
240  itemBoxSizer25->Add(itemStaticText26, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT, 5);
241 
242  wxStaticText* itemStaticText27 = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_STATIC, _("Species Specific Repeats database above or Windowmasker Filtering below."), wxDefaultPosition, wxDefaultSize, 0 );
243  itemBoxSizer25->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT, 5);
244 
245  wxStaticBox* itemStaticBoxSizer28Static = new wxStaticBox(itemCAlgoToolManagerParamsPanel1, wxID_ANY, _("Windowmasker filtering"));
246  m_WMStaticBoxSizer = new wxStaticBoxSizer(itemStaticBoxSizer28Static, wxHORIZONTAL);
247  itemBoxSizer2->Add(m_WMStaticBoxSizer, 0, wxGROW|wxALL, 5);
248 
249  m_WMStatic = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_STATIC, _("Windowmasker tax ID:"), wxDefaultPosition, wxDefaultSize, 0 );
250  m_WMStaticBoxSizer->Add(m_WMStatic, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
251 
252  wxArrayString m_WMTaxIdsStrings;
253  m_WMTaxIds = new wxChoice( itemCAlgoToolManagerParamsPanel1, ID_WMTI_CHOICE, wxDefaultPosition, wxDefaultSize, m_WMTaxIdsStrings, 0 );
254  m_WMStaticBoxSizer->Add(m_WMTaxIds, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
255 
256  m_WMStaticBoxSizer->Add(7, 8, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
257 
258  m_WMDownload = new wxButton( itemCAlgoToolManagerParamsPanel1, ID_BUTTON, _("Configure..."), wxDefaultPosition, wxDefaultSize, 0 );
259  m_WMStaticBoxSizer->Add(m_WMDownload, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
260 
261  wxStaticBox* itemStaticBoxSizer33Static = new wxStaticBox(itemCAlgoToolManagerParamsPanel1, wxID_ANY, _("Advanced Parameters"));
262  wxStaticBoxSizer* itemStaticBoxSizer33 = new wxStaticBoxSizer(itemStaticBoxSizer33Static, wxHORIZONTAL);
263  itemBoxSizer2->Add(itemStaticBoxSizer33, 0, wxGROW|wxALL, 5);
264 
265  wxTextCtrl* itemTextCtrl34 = new wxTextCtrl( itemCAlgoToolManagerParamsPanel1, ID_ADV_TEXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
266  itemStaticBoxSizer33->Add(itemTextCtrl34, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
267 
268  m_CompartCheck = new wxCheckBox( itemCAlgoToolManagerParamsPanel1, ID_COMPARTMENTS, _("Link related hits together"), wxDefaultPosition, wxDefaultSize, 0 );
269  m_CompartCheck->SetValue(false);
271  m_CompartCheck->SetToolTip(_("BLAST returns separate alignments for each query, and these separate alignments \ncan further be ordered into sets offering consistent non-overlapping query and subject \ncoverage. The sequence viewer offers the ability to evaluate the original BLAST hits \non-the-fly and link together alignments that meet a strict definition of non-overlapping \nquery and subject coverage.\n"));
272  itemBoxSizer2->Add(m_CompartCheck, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 15);
273 
274  wxBoxSizer* itemBoxSizer36 = new wxBoxSizer(wxHORIZONTAL);
275  itemBoxSizer2->Add(itemBoxSizer36, 0, wxGROW|wxALL, 5);
276 
277  wxStaticText* itemStaticText37 = new wxStaticText( itemCAlgoToolManagerParamsPanel1, wxID_STATIC, _("Job Title:"), wxDefaultPosition, wxDefaultSize, 0 );
278  itemBoxSizer36->Add(itemStaticText37, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
279 
280  wxTextCtrl* itemTextCtrl38 = new wxTextCtrl( itemCAlgoToolManagerParamsPanel1, ID_TITLE_TEXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
281  itemBoxSizer36->Add(itemTextCtrl38, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
282 
283  itemBoxSizer2->Add(7, 8, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
284 
285  m_chbStandalone = new wxCheckBox( itemCAlgoToolManagerParamsPanel1, ID_STANDALONE, _("Run tool as standalone"), wxDefaultPosition, wxDefaultSize, 0 );
286  m_chbStandalone->SetValue(false);
287  itemBoxSizer2->Add(m_chbStandalone, 0, wxALIGN_LEFT|wxALL, 15);
288 
289  // Set validators
290  itemTextCtrl8->SetValidator( CNumberValidator(& m_WordSize, 0, 100) );
291  itemTextCtrl10->SetValidator( CFloatTextValidator(& m_eValue) );
292  m_ThreshInput->SetValidator( CNumberValidator(& m_Threshold, 0, 100) );
293  m_QueryGenCodeCombo->SetValidator( wxGenericValidator(& m_QueryGeneticCode) );
294  m_DbGenCodeCombo->SetValidator( wxGenericValidator(& m_DbGeneticCode) );
295  itemCheckBox20->SetValidator( wxGenericValidator(& m_FilterLowComplex) );
296  m_LCRegionsCheck->SetValidator( wxGenericValidator(& m_MaskLCRegions) );
297  m_RepeatsCheck->SetValidator( wxGenericValidator(& m_MaskRepeats) );
298  itemTextCtrl34->SetValidator( wxGenericValidator(& m_AdvParams) );
299  itemTextCtrl38->SetValidator( wxGenericValidator(& m_JobTitle) );
300 ////@end CBLASTSearchParamsPanel content construction
301 
303 
304  wxStaticText* loadingText = new wxStaticText(this, ID_LOADING_TEXT, wxT("Windomasker tax ID: none. Loading..."), wxDefaultPosition, wxDefaultSize, 0);
305  wxFont bold(wxNORMAL_FONT->GetPointSize(), wxNORMAL_FONT->GetFamily(), wxNORMAL_FONT->GetStyle(), wxFONTWEIGHT_BOLD, wxNORMAL_FONT->GetUnderlined(), wxNORMAL_FONT->GetFaceName());
306  loadingText->SetFont(bold);
307  loadingText->SetForegroundColour(*wxBLACK);
308  m_WMStaticBoxSizer->Add(loadingText, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
309  m_WMStaticBoxSizer->Hide(loadingText);
310 
311  m_WMStaticBoxSizer->Add(1, m_WMDownload->GetSize().GetHeight(), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
312 
313  CIndProgressBar* progress = new CIndProgressBar(this, ID_LOADING_PROGRESS, wxDefaultPosition, 100);
314  m_WMStaticBoxSizer->Add(progress, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5);
315  m_WMStaticBoxSizer->Hide(progress);
316 
317  m_RepeatType->Append(wxT("none"));
319  ITERATE (CBLASTParams::TRepeatLibs, iter, libs) {
320  m_RepeatType->Append(ToWxString(*iter));
321  }
322 }
323 
324 
326 {
327  vector<string> labels;
329 
330  wxArrayString arr;
331  ToArrayString(labels, arr);
332 
333  m_QueryGenCodeCombo->Clear();
334  m_QueryGenCodeCombo->Append(arr);
335 
336  m_DbGenCodeCombo->Clear();
337  m_DbGenCodeCombo->Append(arr);
338 
339 }
340 
341 
343 {
344  return true;
345 }
346 
347 
348 wxBitmap CBLASTSearchParamsPanel::GetBitmapResource( const wxString& name )
349 {
350  // Bitmap retrieval
351 ////@begin CBLASTSearchParamsPanel bitmap retrieval
352  wxUnusedVar(name);
353  return wxNullBitmap;
354 ////@end CBLASTSearchParamsPanel bitmap retrieval
355 }
356 
357 
358 wxIcon CBLASTSearchParamsPanel::GetIconResource( const wxString& name )
359 {
360  // Icon retrieval
361 ////@begin CBLASTSearchParamsPanel icon retrieval
362  wxUnusedVar(name);
363  return wxNullIcon;
364 ////@end CBLASTSearchParamsPanel icon retrieval
365 }
366 
367 
369 {
370  m_Params = params;
371 }
372 
373 
374 // hide / show some of the controls depending on the program
376 {
378 
379  bool en_query_gc = CBLASTParams::NeedsQueryGeneticCode(prg);
380  bool en_db_gc = CBLASTParams::NeedsDbGeneticCode(prg);
381  bool en_thresh = CBLASTParams::NeedsThreshold(prg);
382 
383  m_ThreshLabel->Show(en_thresh);
384  m_ThreshInput->Show(en_thresh);
385 
386  m_QueryGenCodeLabel->Show(en_query_gc);
387  m_QueryGenCodeCombo->Show(en_query_gc);
388 
389  m_DbGenCodeLabel->Show(en_db_gc);
390  m_DbGenCodeCombo->Show(en_db_gc);
391 
393  m_LCRegionsCheck->Show(false);
394  m_RepeatsCheck->Show(false);
395  }
396  else {
397  m_LCRegionsCheck->Show(true);
398  m_RepeatsCheck->Show(true);
399  }
400 
403 
404  m_RepeatType->Show(!m_Local);
405  FindWindow(ID_STATIC_REPEAT_TYPE)->Show(!m_Local);
406 
407  GetSizer()->Show(m_WMStaticBoxSizer, m_Params->IsNucInput());
408  m_WMDownload->Enable(m_Local);
409 
410  Layout();
411 }
412 
414 {
415  switch (m_Params->GetSubjectType()) {
417  m_Local = false;
418  break;
419  default:
420  m_Local = true;
421  break;
422  }
423 
426 
428  m_Threshold = prg_params.m_Threshold;
429  }
430 
431  m_WordSize = prg_params.m_WordSize;
432  m_eValue = prg_params.m_eValue;
434 
436  int code_id = prg_params.m_QueryGeneticCode;
438  }
439 
441  int code_id = prg_params.m_DbGeneticCode;
443  }
444 
445  if(m_Local) {
446  m_MaskLCRegions = prg_params.m_MaskLowercase;
447  m_MaskRepeats = prg_params.m_MaskRepeats;
448  }
449 
450  int pos = m_RepeatType->FindString(ToWxString(prg_params.m_RepeatLib));
451  if (pos == wxNOT_FOUND) {
452  pos = m_RepeatType->FindString(wxT("none"));
453  }
454  if (pos != wxNOT_FOUND) {
455  m_RepeatType->SetSelection(pos);
456  }
457 
460 
463 
465 
467 
468  if (m_Params->IsNucInput())
469  x_InitTaxons();
470 
471  return wxPanel::TransferDataToWindow();
472 }
473 
474 
476 {
477  if (m_Local) {
478  int selectTaxId = m_Params->GetCurrParams().m_WM_TaxId;
479  if (CTaxIdHelper::GetInstance().FillControl(this, *m_WMTaxIds, true, selectTaxId)) {
480  x_ShowWM(true);
481  return;
482  }
483  }
484  else {
485  int selectTaxId = (m_RepeatType->GetSelection() != 0) ?
487  if (CTaxIdHelper::GetInstance().FillControl(this, *m_WMTaxIds, false, selectTaxId)) {
488  x_ShowWM(true);
489  return;
490  }
491  }
492  x_ShowWM(false);
493 }
494 
496 {
497  if (m_Local && local) {
498  int selectTaxId = m_Params->GetCurrParams().m_WM_TaxId;
499  CTaxIdHelper::GetInstance().FillControl(this, *m_WMTaxIds, true, selectTaxId);
500  x_ShowWM(true);
501  }
502  if (!m_Local && !local) {
503  int selectTaxId = (m_RepeatType->GetSelection() != 0) ?
505  CTaxIdHelper::GetInstance().FillControl(this, *m_WMTaxIds, false, selectTaxId);
506  x_ShowWM(true);
507  }
508 }
509 
511 {
512  m_WMStaticBoxSizer->Show(FindWindow(ID_LOADING_TEXT), !show);
513  m_WMStaticBoxSizer->Show(FindWindow(ID_LOADING_PROGRESS), !show);
514 
515  m_WMStaticBoxSizer->Show(m_WMStatic, show);
516  m_WMStaticBoxSizer->Show(m_WMTaxIds, show);
517  m_WMStaticBoxSizer->Show(m_WMDownload, show);
518  GetSizer()->Layout();
519 }
520 
522 {
523  if(wxPanel::TransferDataFromWindow()) {
526 
527  if(m_Local) {
528  prg_params.m_MaskLowercase = m_MaskLCRegions;
529  prg_params.m_MaskRepeats = m_MaskRepeats;
530  }
531 
533  prg_params.m_Threshold = static_cast<int>(m_Threshold);
534  }
535 
536  prg_params.m_WordSize = static_cast<int>(m_WordSize);
537  prg_params.m_eValue = m_eValue;
539 
541  string s = ToStdString(m_QueryGeneticCode);
543  }
544 
546  string s = ToStdString(m_DbGeneticCode);
548  }
549 
550  prg_params.m_RepeatLib =
551  m_Local ? "none" : ToStdString(m_RepeatType->GetStringSelection());
554 
557 
558  m_Params->FindCompartments( m_CompartCheck->GetValue() );
559 
560  int taxId = 0, index = m_WMTaxIds->GetSelection();
561  if (wxNOT_FOUND != index)
562  taxId = (int)(intptr_t)m_WMTaxIds->GetClientData(index);
563  prg_params.m_WM_TaxId = taxId;
564 
565  if( taxId != 0 ){
567  m_Params->SetWM_Dir( ToStdString(storage.GetPath()) );
568  }
569 
570  return true;
571  }
572  return false;
573 }
574 
575 
577 {
578  if (!m_Local && event.GetSelection() != 0)
579  m_WMTaxIds->Select(0);
580 }
581 
583 {
584  if (!m_Local && event.GetSelection() != 0)
585  m_RepeatType->Select(0);
586 }
587 
588 
589 void CBLASTSearchParamsPanel::OnWMDownload(wxCommandEvent& event)
590 {
592  x_InitTaxons();
593 }
594 
596 {
597  if (!m_Params)
598  return;
600  wxBusyCursor wait;
602 }
603 
605 {
606  if (m_chbStandalone->GetValue()) {
607  m_LCRegionsCheck->SetValue(false);
608  m_RepeatsCheck->SetValue(false);
609  m_LCRegionsCheck->Enable(false);
610  m_RepeatsCheck->Enable(false);
611  } else {
612  m_LCRegionsCheck->Enable(true);
613  m_RepeatsCheck->Enable(true);
614  }
615 }
616 
618 {
620 }
621 
EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX, CAdjustFeaturesForGaps::OnKnownUnknownSelected) EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX1
Declares the CBlastServices class.
EProgram
This enumeration is to evolve into a task/program specific list that specifies sets of default parame...
Definition: blast_types.hpp:56
CAlgoToolManagerParamsPanel.
CBLASTParams - save user-specified parameters and preferences.
bool FillControl(ICallback *callback, wxControlWithItems &ctrl, bool local, int selectTaxId)
static CTaxIdHelper & GetInstance()
wxString GetPath() const
static CWinMaskerFileStorage & GetInstance()
access the application-wide singleton
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
static bool NeedsThreshold(blast::EProgram program)
static void GetGeneticCodeLabels(vector< string > &labels)
void StandaloneRequested(bool req)
bool Create(wxWindow *parent, wxWindowID id=ID_CBLASTSEARCHPARAMSPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(), long style=wxTAB_TRAVERSAL)
void FindCompartments(bool req)
static string GetGeneticCodeLabel(int code_id)
wxBitmap GetBitmapResource(const wxString &name)
void OnRepeatTypeSelected(wxCommandEvent &event)
static bool NeedsQueryGeneticCode(blast::EProgram program)
static TRepeatLibs GetAllRepeatLibs()
SProgParams & GetCurrParams()
returns params for the current program
void SetParams(CBLASTParams *params)
bool IsCompartmentsRequested() const
void OnStandaloneClick(wxCommandEvent &event)
bool m_MaskLowercase
mask Lowercase features
static int GetGeneticCodeByLabel(const string &label)
wxIcon GetIconResource(const wxString &name)
blast::EProgram & GetCurrProgram()
returns the current program for the currently selected input type
bool m_MaskRepeats
mask Repeat features
virtual void TaxonsLoaded(bool local)
static bool NeedsDbGeneticCode(blast::EProgram program)
void OnWMDownload(wxCommandEvent &event)
ESubjectType GetSubjectType() const
void SetWM_Dir(const string &wm_dir_path)
void RestoreDefaults()
override in derived classes
bool IsStandaloneRequested() const
string & GetAdvancedParams()
void OnWindowmaskerTaxIdSelected(wxCommandEvent &event)
int intptr_t
Definition: ncbitype.h:185
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
END_EVENT_TABLE()
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
static static static wxID_ANY
describes parameters for a BLAST program
#define ID_BUTTON
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
void ToArrayString(const vector< string > &out, wxArrayString &in)
Definition: wx_utils.cpp:353
#define local
Definition: zutil.h:33
Modified on Fri Sep 20 14:57:55 2024 by modify_doxy.py rev. 669887