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

Go to the SVN repository for this file.

1 /* $Id: cn3d_ba_interface.cpp 98993 2023-02-01 14:57:24Z dzhang $
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: Paul Thiessen
27 *
28 * File Description:
29 * Interface to Alejandro's block alignment algorithm
30 *
31 * ===========================================================================
32 */
33 
34 #include <ncbi_pch.hpp>
35 #include <corelib/ncbistd.hpp>
36 #include <corelib/ncbi_limits.h>
37 
43 
45 
46 #ifdef __WXMSW__
47 #include <windows.h>
48 #include <wx/msw/winundef.h>
49 #endif
50 #include <wx/wx.h>
51 #include <wx/numdlg.h>
52 
54 
55 #include "cn3d_ba_interface.hpp"
57 #include "sequence_set.hpp"
58 #include "structure_set.hpp"
59 #include "molecule_identifier.hpp"
61 #include "cn3d_tools.hpp"
62 #include "sequence_viewer.hpp"
63 #include "cn3d_pssm.hpp"
64 #include "progress_meter.hpp"
65 
68 
69 
70 BEGIN_SCOPE(Cn3D)
71 
72 class BlockAlignerOptionsDialog : public wxDialog
73 {
74 public:
77 
78  bool GetValues(BlockAligner::BlockAlignerOptions *options);
79 
80 private:
83  wxCheckBox *cGlobal, *cKeep;
84  wxChoice *cMerge;
85 
86  void OnCloseWindow(wxCloseEvent& event);
87  void OnButton(wxCommandEvent& event);
88  DECLARE_EVENT_TABLE()
89 };
90 
92 {
93  // default options
100 }
101 
102 static void FreezeBlocks(const BlockMultipleAlignment *multiple,
103  const BlockMultipleAlignment *pairwise, DP_BlockInfo *blockInfo)
104 {
105  BlockMultipleAlignment::UngappedAlignedBlockList multipleABlocks, pairwiseABlocks;
106  multiple->GetUngappedAlignedBlocks(&multipleABlocks);
107  pairwise->GetUngappedAlignedBlocks(&pairwiseABlocks);
108 
109  // if a block in the multiple is contained in the pairwise (looking at master coords),
110  // then add a constraint to keep it there
111  BlockMultipleAlignment::UngappedAlignedBlockList::const_iterator
112  m, me = multipleABlocks.end(), p, pe = pairwiseABlocks.end();
113  const Block::Range *multipleRangeMaster, *pairwiseRangeMaster, *pairwiseRangeDependent;
114  int i;
115  for (i=0, m=multipleABlocks.begin(); m!=me; ++i, ++m) {
116  multipleRangeMaster = (*m)->GetRangeOfRow(0);
117  for (p=pairwiseABlocks.begin(); p!=pe; ++p) {
118  pairwiseRangeMaster = (*p)->GetRangeOfRow(0);
119  if (pairwiseRangeMaster->from <= multipleRangeMaster->from &&
120  pairwiseRangeMaster->to >= multipleRangeMaster->to) {
121  pairwiseRangeDependent = (*p)->GetRangeOfRow(1);
122  blockInfo->freezeBlocks[i] = pairwiseRangeDependent->from +
123  (multipleRangeMaster->from - pairwiseRangeMaster->from);
124  break;
125  }
126  }
127  if (p == pe)
128  blockInfo->freezeBlocks[i] = DP_UNFROZEN_BLOCK;
129 // if (blockInfo->freezeBlocks[i] != DP_UNFROZEN_BLOCK)
130 // TESTMSG("block " << (i+1) << " frozen at query pos " << (blockInfo->freezeBlocks[i]+1));
131 // else
132 // TESTMSG("block " << (i+1) << " unfrozen");
133  }
134 }
135 
136 // global stuff for DP block aligner score callback
138 unique_ptr < BlockMultipleAlignment > dpMultiple;
140 
141 // sum of scores for residue vs. PSSM
142 extern "C" {
143 int dpScoreFunction(unsigned int block, unsigned int queryPos)
144 {
145  if (!dpBlocks || !dpMultiple.get() || !dpQuery || block >= dpBlocks->nBlocks ||
146  queryPos > dpQuery->Length() - dpBlocks->blockSizes[block])
147  {
148  ERRORMSG("dpScoreFunction() - bad parameters: block " << block << " queryPos " << queryPos <<
149  " query sequence " << dpQuery->identifier->ToString());
150  return DP_NEGATIVE_INFINITY;
151  }
152 
153  unsigned int i, masterPos = dpBlocks->blockPositions[block], score = 0;
154  for (i=0; i<dpBlocks->blockSizes[block]; ++i)
155  score += dpMultiple->GetPSSM().GetPSSMScore(
157  masterPos + i);
158 
159  return score;
160 }
161 }
162 
164  const Sequence *master, const Sequence *query)
165 {
166  // create new alignment structure
168  (*seqs)[0] = master;
169  (*seqs)[1] = query;
170  unique_ptr<BlockMultipleAlignment>
171  bma(new BlockMultipleAlignment(seqs, master->parentSet->alignmentManager));
172 
173  // unpack result blocks
174  TRACEMSG("result nBlocks " << result->nBlocks << " firstBlock " << result->firstBlock);
175  int s, blockScoreSum = 0;
176  for (unsigned int b=0; b<result->nBlocks; ++b) {
177  UngappedAlignedBlock *newBlock = new UngappedAlignedBlock(bma.get());
178  newBlock->width = blocks->blockSizes[b + result->firstBlock];
179  newBlock->SetRangeOfRow(0,
180  blocks->blockPositions[b + result->firstBlock],
181  blocks->blockPositions[b + result->firstBlock] + newBlock->width - 1);
182  newBlock->SetRangeOfRow(1,
183  result->blockPositions[b],
184  result->blockPositions[b] + newBlock->width - 1);
185  bma->AddAlignedBlockAtEnd(newBlock);
186  s = dpScoreFunction(b + result->firstBlock, result->blockPositions[b]);
187  TRACEMSG("block " << (b + result->firstBlock + 1)
188  << " position: " << (result->blockPositions[b] + 1)
189  << " score: " << s);
190  blockScoreSum += s;
191  }
192  if (blockScoreSum != result->score)
193  ERRORMSG("block aligner reported score doesn't match sum of block scores");
194 
195  // finalize the alignment
196  if (!bma->AddUnalignedBlocks() || !bma->UpdateBlockMapAndColors(false)) {
197  ERRORMSG("Error finalizing new alignment!");
198  return NULL;
199  }
200 
201  // get scores
202  wxString score;
203  score.Printf(" raw score: %i", result->score);
204  bma->SetRowStatusLine(0, WX_TO_STD(score));
205  bma->SetRowStatusLine(1, WX_TO_STD(score));
206 
207  // success
208  return bma.release();
209 }
210 
212  const AlignmentList& toRealign, AlignmentList *newAlignments,
213  int *nRowsAddedToMultiple, SequenceViewer *sequenceViewer)
214 {
215  newAlignments->clear();
216  *nRowsAddedToMultiple = 0;
217 
218  // show options dialog each time block aligner is run
219  if (!SetOptions(NULL)) return false;
220  if (currentOptions.mergeType != mergeNone && !sequenceViewer) {
221  ERRORMSG("merge selected but NULL sequenceViewer");
222  return false;
223  }
224 
225  unsigned int nAln = toRealign.size(), a = 0;
226 
228  multiple->GetUngappedAlignedBlocks(&blocks);
229  if (blocks.size() == 0) {
230  ERRORMSG("Must have at least one aligned block to use the block aligner");
231  return false;
232  }
233 
234  // Make the progress meter after the above check so don't have to clean it up
235  // on the Mac in the event the above test returns prematurely.
236  unique_ptr < ProgressMeter > progress;
237  if (nAln > 1) {
238  long u = wxGetNumberFromUser("How many sequences do you want to realign?", "Max:", "Alignments...", nAln, 1, nAln, NULL);
239  if (u <= 0)
240  return false;
241  nAln = (unsigned int) u;
242  if (nAln > 1)
243  progress.reset(new ProgressMeter(NULL, "Running block alignment...", "Working", nAln));
244  }
245 
246  BlockMultipleAlignment::UngappedAlignedBlockList::const_iterator b, be = blocks.end();
247  unsigned int i;
248 
249  // set up block info
251  unsigned int *loopLengths = new unsigned int[multiple->NRows()];
252  BlockMultipleAlignment::UngappedAlignedBlockList::const_iterator n;
253  const Block::Range *range, *nextRange;
254  for (i=0, b=blocks.begin(); b!=be; ++i, ++b) {
255  range = (*b)->GetRangeOfRow(0);
256  dpBlocks->blockPositions[i] = range->from;
257  dpBlocks->blockSizes[i] = range->to - range->from + 1;
258 
259  // calculate max loop lengths
260  if (i < blocks.size() - 1) {
261  n = b;
262  ++n;
263  for (unsigned int r=0; r<multiple->NRows(); ++r) {
264  range = (*b)->GetRangeOfRow(r);
265  nextRange = (*n)->GetRangeOfRow(r);
266  loopLengths[r] = nextRange->from - range->to - 1;
267  }
268  dpBlocks->maxLoops[i] = DP_CalculateMaxLoopLength(multiple->NRows(), loopLengths,
270  TRACEMSG("allowed gap after block " << (i+1) << ": " << dpBlocks->maxLoops[i]);
271  }
272  }
273  delete loopLengths;
274 
275  // store a copy of the multiple alignment used for DP scoring
276  dpMultiple.reset(multiple->Clone());
277 
278  bool errorsEncountered = false;
279 
280  AlignmentList::const_iterator s, se = toRealign.end();
281  for (s=toRealign.begin(); s!=se; ++s, ++a) {
282  if (multiple && (*s)->GetMaster() != multiple->GetMaster())
283  ERRORMSG("master sequence mismatch");
284 
285  if (a >= nAln) {
286  BlockMultipleAlignment *newAlignment = (*s)->Clone();
287  newAlignment->SetRowDouble(0, -1.0);
288  newAlignment->SetRowDouble(1, -1.0);
289  newAlignment->SetRowStatusLine(0, kEmptyStr);
290  newAlignment->SetRowStatusLine(1, kEmptyStr);
291  newAlignments->push_back(newAlignment);
292  continue;
293  }
294 
295  if (progress.get())
296  progress->SetValue(a);
297 
298  // dependent sequence info
299  dpQuery = (*s)->GetSequenceOfRow(1);
300  int startQueryPosition =
301  ((*s)->alignDependentFrom >= 0 && (*s)->alignDependentFrom < (int)dpQuery->Length()) ?
302  (*s)->alignDependentFrom : 0;
303  int endQueryPosition =
304  ((*s)->alignDependentTo >= 0 && (*s)->alignDependentTo < (int)dpQuery->Length()) ?
305  (*s)->alignDependentTo : dpQuery->Length() - 1;
306  TRACEMSG("query region: " << (startQueryPosition+1) << " to " << (endQueryPosition+1));
307 
308  // set frozen blocks
310  for (i=0; i<blocks.size(); ++i)
312  } else {
313  FreezeBlocks(multiple, *s, dpBlocks);
314  }
315 
316  SetDialogSevereErrors(false);
317 
318  // actually do the block alignment
319  DP_AlignmentResult *dpResult = NULL;
320  int dpStatus;
323  startQueryPosition, endQueryPosition, &dpResult);
324  else
326  startQueryPosition, endQueryPosition, &dpResult);
327 
328  SetDialogSevereErrors(true);
329 
330  // create new alignment from DP result
331  BlockMultipleAlignment *dpAlignment = NULL;
332  if (dpResult) {
333  dpAlignment = UnpackDPResult(dpBlocks, dpResult, multiple->GetMaster(), dpQuery);
334  if (!dpAlignment)
335  ERRORMSG("Couldn't create BlockMultipleAlignment from DP result");
336  }
337 
338  if (dpStatus == STRUCT_DP_FOUND_ALIGNMENT && dpAlignment) {
339 
340  // merge or add alignment to list
342  if (!sequenceViewer->EditorIsOn())
343  sequenceViewer->TurnOnEditor();
344  if (multiple->MergeAlignment(dpAlignment)) {
345  // if merge is successful, we can delete this alignment;
346  delete dpAlignment;
347  dpAlignment = NULL;
348  ++(*nRowsAddedToMultiple);
349  // update scoring alignment/PSSM only if asked to do so after each sequence
351  dpMultiple.reset(multiple->Clone());
352  }
353  }
354  if (dpAlignment)
355  newAlignments->push_back(dpAlignment);
356  }
357 
358  // no alignment or block aligner failed - add old alignment to list so it doesn't get lost
359  else {
360  string status;
361  if (dpStatus == STRUCT_DP_NO_ALIGNMENT) {
362  WARNINGMSG("block aligner found no significant alignment - current alignment unchanged");
363  status = "alignment unchanged";
364  } else {
365  WARNINGMSG("block aligner encountered a problem - current alignment unchanged");
366  errorsEncountered = true;
367  status = "block aligner error!";
368  }
369  BlockMultipleAlignment *newAlignment = (*s)->Clone();
370  newAlignment->SetRowDouble(0, -1.0);
371  newAlignment->SetRowDouble(1, -1.0);
372  newAlignment->SetRowStatusLine(0, status);
373  newAlignment->SetRowStatusLine(1, status);
374  newAlignments->push_back(newAlignment);
375  }
376 
377  // cleanup
378  DP_DestroyAlignmentResult(dpResult);
379  }
380 
381 // Bug fix: the Mac does not like the use of auto_ptr for some reason.
382 // Control is not returned to the parent window properly and most events
383 // involving mouse clicks, menus are subsequently ignored in all windows.
384 // Destroy() and reseting to null do not appear necessary, but I'll leave
385 // them commented out here as a reminder they may be needed later.
386 #ifdef __WXMAC__
387  if (progress.get()) {
388  progress->Close(true);
389 // progressMeter->Destroy();
390 // progressMeter = NULL;
391  }
392 #endif
393 
394  if (errorsEncountered)
395  ERRORMSG("Block aligner encountered problem(s) - see message log for details");
396 
397  // cleanup
399  dpBlocks = NULL;
400  dpMultiple.reset();
401  dpQuery = NULL;
402 
403  return true;
404 }
405 
406 bool BlockAligner::SetOptions(wxWindow* parent)
407 {
409  bool ok = (dialog.ShowModal() == wxOK);
410  if (ok && !dialog.GetValues(&currentOptions))
411  ERRORMSG("Error getting options from dialog!");
412  return ok;
413 }
414 
415 
416 /////////////////////////////////////////////////////////////////////////////////////
417 ////// BlockAlignerOptionsDialog stuff
418 ////// taken (and modified) from block_aligner_dialog.wdr code
419 /////////////////////////////////////////////////////////////////////////////////////
420 
421 #define ID_TEXT 10000
422 #define ID_T_PERCENT 10001
423 #define ID_S_EXT 10002
424 #define ID_T_EXTENSION 10003
425 #define ID_S_PERCENT 10004
426 #define ID_T_CUTOFF 10005
427 #define ID_S_LAMBDA 10006
428 #define ID_C_GLOBAL 10007
429 #define ID_C_KEEP 10008
430 #define ID_C_MERGE 10009
431 #define ID_B_OK 10010
432 #define ID_B_CANCEL 10011
433 
434 BEGIN_EVENT_TABLE(BlockAlignerOptionsDialog, wxDialog)
438 
440  wxWindow* parent, const BlockAligner::BlockAlignerOptions& init) :
441  wxDialog(parent, -1, "Set Block Aligner Options", wxPoint(100,100), wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
442 {
443  wxPanel *panel = new wxPanel(this, -1);
444  wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
445  wxStaticBox *item2 = new wxStaticBox( panel, -1, wxT("Block Aligner Options") );
446  wxStaticBoxSizer *item1 = new wxStaticBoxSizer( item2, wxVERTICAL );
447  wxFlexGridSizer *item3 = new wxFlexGridSizer( 2, 0, 0 ); // 3->2
448  item3->AddGrowableCol( 1 );
449 
450  wxStaticText *item4 = new wxStaticText( panel, ID_TEXT, wxT("Loop percentile:"), wxDefaultPosition, wxDefaultSize, 0 );
451  item3->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
452  fpPercent = new FloatingPointSpinCtrl(panel,
453  0.0, 100.0, 0.1, init.loopPercentile,
454  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
455  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
456  item3->Add(fpPercent->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
457 // item3->Add(fpPercent->GetSpinButton(), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);
458 
459  wxStaticText *item7 = new wxStaticText( panel, ID_TEXT, wxT("Loop extension:"), wxDefaultPosition, wxDefaultSize, 0 );
460  item3->Add( item7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
461  iExtension = new IntegerSpinCtrl(panel,
462  0, 100000, 10, init.loopExtension,
463  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
464  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
465  item3->Add(iExtension->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
466 // item3->Add(iExtension->GetSpinButton(), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);
467 
468  wxStaticText *item10 = new wxStaticText( panel, ID_TEXT, wxT("Loop cutoff (0=none):"), wxDefaultPosition, wxDefaultSize, 0 );
469  item3->Add( item10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
470  iCutoff = new IntegerSpinCtrl(panel,
471  0, 100000, 0, init.loopCutoff,
472  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
473  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
474  item3->Add(iCutoff->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
475 // item3->Add(iCutoff->GetSpinButton(), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);
476 
477  item3->Add( 5, 5, 0, wxALIGN_CENTRE|wxALL, 5 );
478  item3->Add( 5, 5, 0, wxALIGN_CENTRE|wxALL, 5 );
479 // item3->Add( 5, 5, 0, wxALIGN_CENTRE|wxALL, 5 );
480 
481  wxStaticText *item13 = new wxStaticText( panel, ID_TEXT, wxT("Global alignment:"), wxDefaultPosition, wxDefaultSize, 0 );
482  item3->Add( item13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
483  cGlobal = new wxCheckBox( panel, ID_C_GLOBAL, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
484  cGlobal->SetValue(init.globalAlignment);
485  item3->Add( cGlobal, 0, wxALIGN_CENTRE|wxALL, 5 );
486  //item3->Add( 5, 5, 0, wxALIGN_CENTRE, 5 );
487 
488  wxStaticText *item15 = new wxStaticText( panel, ID_TEXT, wxT("Keep existing blocks (global only):"), wxDefaultPosition, wxDefaultSize, 0 );
489  item3->Add( item15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
490  cKeep = new wxCheckBox( panel, ID_C_KEEP, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
491  cKeep->SetValue(init.keepExistingBlocks);
492  item3->Add( cKeep, 0, wxALIGN_CENTRE|wxALL, 5 );
493  //item3->Add( 5, 5, 0, wxALIGN_CENTRE, 5 );
494 
495  wxStaticText *item17 = new wxStaticText( panel, ID_TEXT, wxT("When to merge new alignments:"), wxDefaultPosition, wxDefaultSize, 0 );
496  item3->Add( item17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
497  wxString choices[3] = { "No Merge", "After Each", "After All" };
498  cMerge = new wxChoice( panel, ID_C_MERGE, wxDefaultPosition, wxDefaultSize, 3, choices );
499  cMerge->SetSelection(init.mergeType);
500  item3->Add( cMerge, 0, wxALIGN_CENTRE|wxALL, 5 );
501  //item3->Add( 5, 5, 0, wxALIGN_CENTRE, 5 );
502 
503  item1->Add( item3, 0, wxALIGN_CENTRE, 5 );
504  item0->Add( item1, 0, wxALIGN_CENTRE|wxALL, 5 );
505  wxBoxSizer *item19 = new wxBoxSizer( wxHORIZONTAL );
506  wxButton *item20 = new wxButton( panel, ID_B_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0 );
507  item19->Add( item20, 0, wxALIGN_CENTRE|wxALL, 5 );
508  item19->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 5 );
509  wxButton *item21 = new wxButton( panel, ID_B_CANCEL, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
510  item19->Add( item21, 0, wxALIGN_CENTRE|wxALL, 5 );
511  item0->Add( item19, 0, wxALIGN_CENTRE|wxALL, 5 );
512 
513  panel->SetAutoLayout(true);
514  panel->SetSizer(item0);
515  item0->Fit(this);
516  item0->Fit(panel);
517  item0->SetSizeHints(this);
518 }
519 
521 {
522  delete iCutoff;
523  delete iExtension;
524  delete fpPercent;
525 }
526 
528 {
529  options->globalAlignment = cGlobal->IsChecked();
530  options->keepExistingBlocks = cKeep->IsChecked();
531  options->mergeType = (BlockAligner::EMergeOption) cMerge->GetSelection();
532  return (
533  fpPercent->GetDouble(&(options->loopPercentile)) &&
536  );
537 }
538 
540 {
541  EndModal(wxCANCEL);
542 }
543 
544 void BlockAlignerOptionsDialog::OnButton(wxCommandEvent& event)
545 {
546  if (event.GetId() == ID_B_OK) {
548  if (GetValues(&dummy)) // can't successfully quit if values aren't valid
549  EndModal(wxOK);
550  else
551  wxBell();
552  } else if (event.GetId() == ID_B_CANCEL) {
553  EndModal(wxCANCEL);
554  } else {
555  event.Skip();
556  }
557 }
558 
559 END_SCOPE(Cn3D)
User-defined methods of the data storage class.
unsigned dummy
Definition: block_cipher.h:0
FloatingPointSpinCtrl * fpPercent
void OnCloseWindow(wxCloseEvent &event)
bool GetValues(BlockAligner::BlockAlignerOptions *options)
void OnButton(wxCommandEvent &event)
bool CreateNewPairwiseAlignmentsByBlockAlignment(BlockMultipleAlignment *multiple, const AlignmentList &toRealign, AlignmentList *newAlignments, int *nRowsAddedToMultiple, SequenceViewer *sequenceViewer)
std::list< BlockMultipleAlignment * > AlignmentList
BlockAlignerOptions currentOptions
bool SetOptions(wxWindow *parent)
BlockMultipleAlignment * Clone(void) const
std::vector< const Sequence * > SequenceList
void SetRowDouble(unsigned int row, double value) const
void SetRowStatusLine(unsigned int row, const std::string &value) const
const Sequence * GetMaster(void) const
std::vector< const UngappedAlignedBlock * > UngappedAlignedBlockList
void GetUngappedAlignedBlocks(UngappedAlignedBlockList *blocks) const
bool MergeAlignment(const BlockMultipleAlignment *newAlignment)
void SetRangeOfRow(unsigned int row, int from, int to)
unsigned int width
bool GetDouble(double *value) const
Definition: wx_tools.cpp:289
bool GetUnsignedInteger(unsigned int *value) const
Definition: wx_tools.cpp:181
std::string ToString(void) const
void TurnOnEditor(void)
const MoleculeIdentifier * identifier
unsigned int Length(void) const
string sequenceString
Definition: cav_seqset.hpp:93
StructureSet * parentSet
AlignmentManager * alignmentManager
bool EditorIsOn(void) const
void SetDialogSevereErrors(bool status)
Definition: cn3d_app.cpp:145
USING_SCOPE(objects)
#define ID_C_KEEP
unique_ptr< BlockMultipleAlignment > dpMultiple
DP_BlockInfo * dpBlocks
#define ID_B_CANCEL
#define ID_C_GLOBAL
#define ID_B_OK
static void FreezeBlocks(const BlockMultipleAlignment *multiple, const BlockMultipleAlignment *pairwise, DP_BlockInfo *blockInfo)
#define ID_TEXT
int dpScoreFunction(unsigned int block, unsigned int queryPos)
static BlockMultipleAlignment * UnpackDPResult(DP_BlockInfo *blocks, DP_AlignmentResult *result, const Sequence *master, const Sequence *query)
const Sequence * dpQuery
USING_NCBI_SCOPE
#define ID_C_MERGE
#define TRACEMSG(stream)
Definition: cn3d_tools.hpp:83
#define WARNINGMSG(stream)
Definition: cn3d_tools.hpp:85
#define WX_TO_STD(wxstring)
Definition: cn3d_tools.hpp:285
#define ERRORMSG(stream)
Definition: cn3d_tools.hpp:86
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void DLIST_NAME() init(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:40
#define NULL
Definition: ncbistd.hpp:225
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define kEmptyStr
Definition: ncbistr.hpp:123
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
END_EVENT_TABLE()
int i
yy_size_t n
#define wxT(x)
Definition: muParser.cpp:41
range(_Ty, _Ty) -> range< _Ty >
unsigned int a
Definition: ncbi_localip.c:102
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
unsigned int * freezeBlocks
Definition: struct_dp.h:69
unsigned int * maxLoops
Definition: struct_dp.h:68
unsigned int * blockPositions
Definition: struct_dp.h:66
unsigned int nBlocks
Definition: struct_dp.h:65
unsigned int * blockSizes
Definition: struct_dp.h:67
int DP_LocalBlockAlign(const DP_BlockInfo *blocks, DP_BlockScoreFunction BlockScore, unsigned int queryFrom, unsigned int queryTo, DP_AlignmentResult **alignment)
void DP_DestroyBlockInfo(DP_BlockInfo *blocks)
unsigned int DP_CalculateMaxLoopLength(unsigned int nLoops, const unsigned int *loopLengths, double percentile, unsigned int extension, unsigned int cutoff)
#define STRUCT_DP_FOUND_ALIGNMENT
Definition: struct_dp.h:44
int DP_GlobalBlockAlign(const DP_BlockInfo *blocks, DP_BlockScoreFunction BlockScore, unsigned int queryFrom, unsigned int queryTo, DP_AlignmentResult **alignment)
static const int DP_NEGATIVE_INFINITY
Definition: struct_dp.h:51
static const unsigned int DP_UNFROZEN_BLOCK
Definition: struct_dp.h:61
#define STRUCT_DP_NO_ALIGNMENT
Definition: struct_dp.h:45
void DP_DestroyAlignmentResult(DP_AlignmentResult *alignment)
DP_BlockInfo * DP_CreateBlockInfo(unsigned int nBlocks)
static DP_BlockInfo * blocks
static string query
unsigned char LookupNCBIStdaaNumberFromCharacter(char r)
Definition: su_pssm.cpp:125
else result
Definition: token2.c:20
#define const
Definition: zconf.h:232
Modified on Sat Jul 13 13:37:23 2024 by modify_doxy.py rev. 669887