OnCloseWindow(wxCloseEvent& event);
87 voidOnButton(wxCommandEvent& event);
111BlockMultipleAlignment::UngappedAlignedBlockList::const_iterator
112m, me = multipleABlocks.end(), p, pe = pairwiseABlocks.end();
113 const Block::Range*multipleRangeMaster, *pairwiseRangeMaster, *pairwiseRangeDependent;
115 for(
i=0, m=multipleABlocks.begin(); m!=me; ++
i, ++m) {
116multipleRangeMaster = (*m)->GetRangeOfRow(0);
117 for(p=pairwiseABlocks.begin(); p!=pe; ++p) {
118pairwiseRangeMaster = (*p)->GetRangeOfRow(0);
119 if(pairwiseRangeMaster->
from<= multipleRangeMaster->
from&&
120pairwiseRangeMaster->
to>= multipleRangeMaster->
to) {
121pairwiseRangeDependent = (*p)->GetRangeOfRow(1);
123(multipleRangeMaster->
from- pairwiseRangeMaster->
from);
148 ERRORMSG(
"dpScoreFunction() - bad parameters: block "<< block <<
" queryPos "<< queryPos <<
170unique_ptr<BlockMultipleAlignment>
175 ints, blockScoreSum = 0;
176 for(
unsigned int b=0;
b<
result->nBlocks; ++
b) {
185bma->AddAlignedBlockAtEnd(newBlock);
188<<
" position: "<< (
result->blockPositions[
b] + 1)
192 if(blockScoreSum !=
result->score)
193 ERRORMSG(
"block aligner reported score doesn't match sum of block scores");
196 if(!bma->AddUnalignedBlocks() || !bma->UpdateBlockMapAndColors(
false)) {
197 ERRORMSG(
"Error finalizing new alignment!");
203score.Printf(
" raw score: %i",
result->score);
204bma->SetRowStatusLine(0,
WX_TO_STD(score));
205bma->SetRowStatusLine(1,
WX_TO_STD(score));
208 returnbma.release();
215newAlignments->clear();
216*nRowsAddedToMultiple = 0;
221 ERRORMSG(
"merge selected but NULL sequenceViewer");
225 unsigned intnAln = toRealign.size(),
a= 0;
229 if(
blocks.size() == 0) {
230 ERRORMSG(
"Must have at least one aligned block to use the block aligner");
236unique_ptr < ProgressMeter > progress;
238 longu = wxGetNumberFromUser(
"How many sequences do you want to realign?",
"Max:",
"Alignments...", nAln, 1, nAln,
NULL);
241nAln = (
unsigned int) u;
243progress.reset(
new ProgressMeter(
NULL,
"Running block alignment...",
"Working", nAln));
246BlockMultipleAlignment::UngappedAlignedBlockList::const_iterator
b, be =
blocks.end();
251 unsigned int*loopLengths =
new unsigned int[multiple->
NRows()];
252BlockMultipleAlignment::UngappedAlignedBlockList::const_iterator
n;
254 for(
i=0,
b=
blocks.begin();
b!=be; ++
i, ++
b) {
255range = (*b)->GetRangeOfRow(0);
263 for(
unsigned int r=0;
r<multiple->
NRows(); ++
r) {
264range = (*b)->GetRangeOfRow(
r);
265nextRange = (*n)->GetRangeOfRow(
r);
266loopLengths[
r] = nextRange->
from- range->
to- 1;
278 boolerrorsEncountered =
false;
280AlignmentList::const_iterator s, se = toRealign.end();
281 for(s=toRealign.begin(); s!=se; ++s, ++
a) {
283 ERRORMSG(
"master sequence mismatch");
291newAlignments->push_back(newAlignment);
296progress->SetValue(
a);
299 dpQuery= (*s)->GetSequenceOfRow(1);
300 intstartQueryPosition =
301((*s)->alignDependentFrom >= 0 && (*s)->alignDependentFrom < (
int)
dpQuery->
Length()) ?
302(*s)->alignDependentFrom : 0;
303 intendQueryPosition =
304((*s)->alignDependentTo >= 0 && (*s)->alignDependentTo < (
int)
dpQuery->
Length()) ?
306 TRACEMSG(
"query region: "<< (startQueryPosition+1) <<
" to "<< (endQueryPosition+1));
323startQueryPosition, endQueryPosition, &dpResult);
326startQueryPosition, endQueryPosition, &dpResult);
335 ERRORMSG(
"Couldn't create BlockMultipleAlignment from DP result");
348++(*nRowsAddedToMultiple);
355newAlignments->push_back(dpAlignment);
362 WARNINGMSG(
"block aligner found no significant alignment - current alignment unchanged");
363status =
"alignment unchanged";
365 WARNINGMSG(
"block aligner encountered a problem - current alignment unchanged");
366errorsEncountered =
true;
367status =
"block aligner error!";
374newAlignments->push_back(newAlignment);
387 if(progress.get()) {
388progress->Close(
true);
394 if(errorsEncountered)
395 ERRORMSG(
"Block aligner encountered problem(s) - see message log for details");
409 bool ok= (dialog.ShowModal() == wxOK);
411 ERRORMSG(
"Error getting options from dialog!");
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 441wxDialog(parent, -1, "Set
BlockAligner Options", wxPoint(100,100), wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
443wxPanel *panel =
newwxPanel(
this, -1);
444wxBoxSizer *item0 =
newwxBoxSizer( wxVERTICAL );
445wxStaticBox *item2 =
newwxStaticBox( panel, -1,
wxT(
"Block Aligner Options") );
446wxStaticBoxSizer *item1 =
newwxStaticBoxSizer( item2, wxVERTICAL );
447wxFlexGridSizer *item3 =
newwxFlexGridSizer( 2, 0, 0 );
448item3->AddGrowableCol( 1 );
450wxStaticText *item4 =
newwxStaticText( panel,
ID_TEXT,
wxT(
"Loop percentile:"), wxDefaultPosition, wxDefaultSize, 0 );
451item3->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
4530.0, 100.0, 0.1,
init.loopPercentile,
454wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
455wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
456item3->Add(fpPercent->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
459wxStaticText *item7 =
newwxStaticText( panel,
ID_TEXT,
wxT(
"Loop extension:"), wxDefaultPosition, wxDefaultSize, 0 );
460item3->Add( item7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
4620, 100000, 10,
init.loopExtension,
463wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
464wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
465item3->Add(iExtension->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
468wxStaticText *item10 =
newwxStaticText( panel,
ID_TEXT,
wxT(
"Loop cutoff (0=none):"), wxDefaultPosition, wxDefaultSize, 0 );
469item3->Add( item10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
4710, 100000, 0,
init.loopCutoff,
472wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
473wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
474item3->Add(iCutoff->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
477item3->Add( 5, 5, 0, wxALIGN_CENTRE|wxALL, 5 );
478item3->Add( 5, 5, 0, wxALIGN_CENTRE|wxALL, 5 );
481wxStaticText *item13 =
newwxStaticText( panel,
ID_TEXT,
wxT(
"Global alignment:"), wxDefaultPosition, wxDefaultSize, 0 );
482item3->Add( item13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
483cGlobal =
newwxCheckBox( panel,
ID_C_GLOBAL,
wxT(
""), wxDefaultPosition, wxDefaultSize, 0 );
484cGlobal->SetValue(
init.globalAlignment);
485item3->Add( cGlobal, 0, wxALIGN_CENTRE|wxALL, 5 );
488wxStaticText *item15 =
newwxStaticText( panel,
ID_TEXT,
wxT(
"Keep existing blocks (global only):"), wxDefaultPosition, wxDefaultSize, 0 );
489item3->Add( item15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
490cKeep =
newwxCheckBox( panel,
ID_C_KEEP,
wxT(
""), wxDefaultPosition, wxDefaultSize, 0 );
491cKeep->SetValue(
init.keepExistingBlocks);
492item3->Add( cKeep, 0, wxALIGN_CENTRE|wxALL, 5 );
495wxStaticText *item17 =
newwxStaticText( panel,
ID_TEXT,
wxT(
"When to merge new alignments:"), wxDefaultPosition, wxDefaultSize, 0 );
496item3->Add( item17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
497wxString choices[3] = {
"No Merge",
"After Each",
"After All"};
498cMerge =
newwxChoice( panel,
ID_C_MERGE, wxDefaultPosition, wxDefaultSize, 3, choices );
499cMerge->SetSelection(
init.mergeType);
500item3->Add( cMerge, 0, wxALIGN_CENTRE|wxALL, 5 );
503item1->Add( item3, 0, wxALIGN_CENTRE, 5 );
504item0->Add( item1, 0, wxALIGN_CENTRE|wxALL, 5 );
505wxBoxSizer *item19 =
newwxBoxSizer( wxHORIZONTAL );
506wxButton *item20 =
newwxButton( panel,
ID_B_OK,
wxT(
"OK"), wxDefaultPosition, wxDefaultSize, 0 );
507item19->Add( item20, 0, wxALIGN_CENTRE|wxALL, 5 );
508item19->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 5 );
509wxButton *item21 =
newwxButton( panel,
ID_B_CANCEL,
wxT(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
510item19->Add( item21, 0, wxALIGN_CENTRE|wxALL, 5 );
511item0->Add( item19, 0, wxALIGN_CENTRE|wxALL, 5 );
513panel->SetAutoLayout(
true);
514panel->SetSizer(item0);
517item0->SetSizeHints(
this);
546 if(event.GetId() ==
ID_B_OK) {
User-defined methods of the data storage class.
FloatingPointSpinCtrl * fpPercent
void OnCloseWindow(wxCloseEvent &event)
IntegerSpinCtrl * iExtension
IntegerSpinCtrl * iCutoff
bool GetValues(BlockAligner::BlockAlignerOptions *options)
~BlockAlignerOptionsDialog(void)
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
unsigned int NRows(void) const
bool MergeAlignment(const BlockMultipleAlignment *newAlignment)
void SetRangeOfRow(unsigned int row, int from, int to)
bool GetDouble(double *value) const
bool GetUnsignedInteger(unsigned int *value) const
std::string ToString(void) const
const MoleculeIdentifier * identifier
unsigned int Length(void) const
AlignmentManager * alignmentManager
bool EditorIsOn(void) const
void SetDialogSevereErrors(bool status)
unique_ptr< BlockMultipleAlignment > dpMultiple
static void FreezeBlocks(const BlockMultipleAlignment *multiple, const BlockMultipleAlignment *pairwise, DP_BlockInfo *blockInfo)
int dpScoreFunction(unsigned int block, unsigned int queryPos)
static BlockMultipleAlignment * UnpackDPResult(DP_BlockInfo *blocks, DP_AlignmentResult *result, const Sequence *master, const Sequence *query)
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void DLIST_NAME() init(DLIST_LIST_TYPE *list)
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
unsigned int
A callback function used to compare two keys in a database.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
unsigned int loopExtension
unsigned int * freezeBlocks
unsigned int * blockPositions
unsigned int * blockSizes
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
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
static const unsigned int DP_UNFROZEN_BLOCK
#define STRUCT_DP_NO_ALIGNMENT
void DP_DestroyAlignmentResult(DP_AlignmentResult *alignment)
DP_BlockInfo * DP_CreateBlockInfo(unsigned int nBlocks)
static DP_BlockInfo * blocks
unsigned char LookupNCBIStdaaNumberFromCharacter(char r)
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