/***************************************************************************** # Copyright (C) 1994-2008 by David Gordon. # All rights reserved. # # This software is part of a beta-test version of the Consed/Autofinish # package. It should not be redistributed or # used for any commercial purpose, including commercially funded # sequencing, without written permission from the author and the # University of Washington. # # This software is provided ``AS IS'' and any express or implied # warranties, including, but not limited to, the implied warranties of # merchantability and fitness for a particular purpose, are disclaimed. # In no event shall the authors or the University of Washington be # liable for any direct, indirect, incidental, special, exemplary, or # consequential damages (including, but not limited to, procurement of # substitute goods or services; loss of use, data, or profits; or # business interruption) however caused and on any theory of liability, # whether in contract, strict liability, or tort (including negligence # or otherwise) arising in any way out of the use of this software, even # if advised of the possibility of such damage. # # Building Consed from source is error prone and not simple which is # why I provide executables. Due to time limitations I cannot # provide any assistance in building Consed. Even if you do not # modify the source, you may introduce errors due to using a # different version of the compiler, a different version of motif, # different versions of other libraries than I used, etc. For this # reason, if you discover Consed bugs, I can only offer help with # those bugs if you first reproduce those bugs with an executable # provided by me--not an executable you have built. # # Modifying Consed is also difficult. Although Consed is modular, # some modules are used by many other modules. Thus making a change # in one place can have unforeseen effects on many other features. # It may takes months for you to notice these other side-effects # which may not seen connected at all. It is not feasable for me to # provide help with modifying Consed sources because of the # potentially huge amount of time involved. # #*****************************************************************************/ #include "guiAssemblyViewWhatToShow.h" #include "handleWindowManagerDelete2.h" #include #include #include #include #include "hp_exception_kludge.h" #include "assemblyView.h" #include #include #include #include #include "consedParameters.h" #include #include #include "bIsNumericMaybeWithWhitespace.h" #include "popupErrorMessage2.h" #include "popupErrorMessage.h" #include "soGetErrno.h" #include "consed.h" #define checkIfNumeric( AssemblyViewParameter ) \ szValue = XmTextFieldGetString( wid ## AssemblyViewParameter ## _ );\ soValue = szValue; \ XtFree( szValue ); \ int nPerhaps ## AssemblyViewParameter; \ if ( !bIsNumericMaybeWithWhitespace( soValue, nPerhaps ## AssemblyViewParameter ) ) { \ RWCString soError = #AssemblyViewParameter " must be numeric but instead is: \""; \ soError += soValue; \ soError += "\""; \ popupErrorMessage( soError ); \ return; \ } //checkIfNumeric( PrimersMinMeltingTempForPCR ) // will expand to: // // // szValue = XmTextFieldGetString( widPrimersMinMeltingTempForPCR_ ); // soValue = szValue; // XtFree( szValue ); // int nPerhapsPrimerMinMeltingTempForPCR; // if ( !bIsNumericMaybeWithWhitespace( soValue, nPerhapsPrimerMinMeltingTempForPCR ) ) { // popupErrorMessage( "PrimersMinMeltingTempForPCR must be numeric" ); // return; // } static void cbAssemblyViewOnlyShowSequenceMatchesToAParticularRegionChanged( Widget wid, XtPointer pClientData, XtPointer pCallData ) { guiAssemblyViewWhatToShow* pGuiAV = (guiAssemblyViewWhatToShow*) pClientData; TRY_CATCH_WRAPPER( pGuiAV->assemblyViewOnlyShowSequenceMatchesToAParticularRegionChanged() ); } static void cbAssemblyViewOnlyShowSequenceMatchesToEndsOfContigsChanged( Widget wid, XtPointer pClientData, XtPointer pCallData ) { guiAssemblyViewWhatToShow* pGuiAV = (guiAssemblyViewWhatToShow*) pClientData; TRY_CATCH_WRAPPER( pGuiAV->assemblyViewOnlyShowSequenceMatchesToEndsOfContigsChanged() ); } static void cbFilterSeqMatchesBySizeChanged( Widget wid, XtPointer pClientData, XtPointer pCallData ) { guiAssemblyViewWhatToShow* pGuiAV = (guiAssemblyViewWhatToShow*) pClientData; TRY_CATCH_WRAPPER( pGuiAV->filterSeqMatchesBySizeChanged() ); } static void cbUserPushedRunCrossmatch( Widget wid, XtPointer pClientData, XtPointer pCallData ) { guiAssemblyViewWhatToShow* pGuiAV = (guiAssemblyViewWhatToShow*) pClientData; TRY_CATCH_WRAPPER( pGuiAV->userPushedRunCrossmatch() ); } static void cbReadFileOfReadsToNotShow( Widget wid, XtPointer pClientData, XtPointer pCallData ) { guiAssemblyViewWhatToShow* pGuiAV = (guiAssemblyViewWhatToShow*) pClientData; TRY_CATCH_WRAPPER( pGuiAV->readFileOfReadsToNotShow(); ); } static void cbGuiShowDocumentationForAssemblyView( Widget wid, XtPointer pClientData, XtPointer pCallData ) { guiAssemblyViewWhatToShow* pGuiAV = (guiAssemblyViewWhatToShow*) pClientData; TRY_CATCH_WRAPPER( pGuiAV->pAssemblyView_->showDocumentationForAssemblyView() ); } static void cbDismiss( Widget wid, XtPointer pClientData, XtPointer pCallData ) { guiAssemblyViewWhatToShow* pGAV = (guiAssemblyViewWhatToShow*) pClientData; TRY_CATCH_WRAPPER( delete pGAV; ); } static void cbApply( Widget wid, XtPointer pClientData, XtPointer pCallData ) { guiAssemblyViewWhatToShow* pGAV = (guiAssemblyViewWhatToShow*) pClientData; TRY_CATCH_WRAPPER( pGAV->userPushedApply() ); } guiAssemblyViewWhatToShow :: ~guiAssemblyViewWhatToShow() { XtPopdown( widPopupShell_ ); XtDestroyWidget( widPopupShell_ ); } const int nLeftPositionOfLabels = 30; #ifdef NO_POUND_POUND_MACROS #define makeLabelAndToggleButton( parameterNameWithoutPrefix, label ) \ Widget wid ## parameterNameWithoutPrefix ## Form = \ XtVaCreateManagedWidget( "form", \ xmFormWidgetClass, \ widRowCol, \ XmNshadowThickness, 0, \ NULL ); \ \ wid ## parameterNameWithoutPrefix ## _ = XtVaCreateManagedWidget( \ #parameterNameWithoutPrefix , \ xmToggleButtonWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtraversalOn, False, \ XmNlabelString, xmsEmpty, \ XmNmarginHeight, 0, \ XmNmarginWidth, 0, \ XmNshadowThickness, 0, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_FORM, \ XmNleftOffset, 10, \ XmNset, pAssemblyView_->b ## parameterNameWithoutPrefix ## _, \ NULL ); \ \ Widget wid ## parameterNameWithoutPrefix ## Label = \ XtVaCreateManagedWidget( \ label , \ xmLabelWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNrightAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_WIDGET, \ XmNleftWidget, wid ## parameterNameWithoutPrefix ## _, \ XmNalignment, XmALIGNMENT_BEGINNING, \ NULL ); \ #else #define makeLabelAndToggleButton( parameterNameWithoutPrefix, label ) \ Widget wid ## parameterNameWithoutPrefix ## Form = \ XtVaCreateManagedWidget( "form", \ xmFormWidgetClass, \ widRowCol, \ XmNshadowThickness, 0, \ NULL ); \ \ wid ## parameterNameWithoutPrefix ## _ = XtVaCreateManagedWidget( \ #parameterNameWithoutPrefix , \ xmToggleButtonWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtraversalOn, False, \ XmNlabelString, xmsEmpty, \ XmNmarginHeight, 0, \ XmNmarginWidth, 0, \ XmNshadowThickness, 0, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_FORM, \ XmNleftOffset, 10, \ XmNset, pAssemblyView_->b ## parameterNameWithoutPrefix ## _, \ NULL ); \ \ Widget wid ## parameterNameWithoutPrefix ## Label = \ XtVaCreateManagedWidget( \ ##label , \ xmLabelWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNrightAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_WIDGET, \ XmNleftWidget, wid ## parameterNameWithoutPrefix ## _, \ XmNalignment, XmALIGNMENT_BEGINNING, \ NULL ); \ #endif #ifdef NO_POUND_POUND_MACROS #define makeLabelAndToggleButtonCP( parameterNameWithoutPrefix, label ) \ Widget wid ## parameterNameWithoutPrefix ## Form = \ XtVaCreateManagedWidget( "form", \ xmFormWidgetClass, \ widRowCol, \ XmNshadowThickness, 0, \ NULL ); \ \ wid ## parameterNameWithoutPrefix ## _ = XtVaCreateManagedWidget( \ #parameterNameWithoutPrefix , \ xmToggleButtonWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtraversalOn, False, \ XmNlabelString, xmsEmpty, \ XmNmarginHeight, 0, \ XmNmarginWidth, 0, \ XmNshadowThickness, 0, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_FORM, \ XmNleftOffset, 10, \ XmNset, pCP->b ## parameterNameWithoutPrefix ## _, \ NULL ); \ \ Widget wid ## parameterNameWithoutPrefix ## Label = \ XtVaCreateManagedWidget( \ label , \ xmLabelWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNrightAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_WIDGET, \ XmNleftWidget, wid ## parameterNameWithoutPrefix ## _, \ XmNalignment, XmALIGNMENT_BEGINNING, \ NULL ); \ #else #define makeLabelAndToggleButtonCP( parameterNameWithoutPrefix, label ) \ Widget wid ## parameterNameWithoutPrefix ## Form = \ XtVaCreateManagedWidget( "form", \ xmFormWidgetClass, \ widRowCol, \ XmNshadowThickness, 0, \ NULL ); \ \ wid ## parameterNameWithoutPrefix ## _ = XtVaCreateManagedWidget( \ #parameterNameWithoutPrefix , \ xmToggleButtonWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtraversalOn, False, \ XmNlabelString, xmsEmpty, \ XmNmarginHeight, 0, \ XmNmarginWidth, 0, \ XmNshadowThickness, 0, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_FORM, \ XmNleftOffset, 10, \ XmNset, pCP->b ## parameterNameWithoutPrefix ## _, \ NULL ); \ \ Widget wid ## parameterNameWithoutPrefix ## Label = \ XtVaCreateManagedWidget( \ ##label , \ xmLabelWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNrightAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_WIDGET, \ XmNleftWidget, wid ## parameterNameWithoutPrefix ## _, \ XmNalignment, XmALIGNMENT_BEGINNING, \ NULL ); \ #endif static const int nRightPositionOfLabels = 70; static const int nLeftPositionOfInputFields = 80; #define makeLabelAndIntegerTextField( parameterNameWithoutPrefix, label ) \ Widget wid ## parameterNameWithoutPrefix ## Form = XtVaCreateManagedWidget( \ "form", \ xmFormWidgetClass, \ widRowCol, \ XmNshadowThickness, 0, \ NULL ); \ \ Widget wid ## parameterNameWithoutPrefix ## Label = XtVaCreateManagedWidget( \ ##label , \ xmLabelWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_FORM, \ XmNrightAttachment, XmATTACH_POSITION, \ XmNrightPosition, nRightPositionOfLabels, \ XmNalignment, XmALIGNMENT_END, \ NULL ); \ \ char sz ## parameterNameWithoutPrefix ## [200]; \ sprintf( sz ## parameterNameWithoutPrefix, "%d", \ consedParameters::pGetConsedParameters()->n ## parameterNameWithoutPrefix ## _ ); \ \ \ wid ## parameterNameWithoutPrefix ## _ = XtVaCreateManagedWidget( \ #parameterNameWithoutPrefix , \ xmTextFieldWidgetClass, \ wid ## parameterNameWithoutPrefix ## Form, \ XmNtraversalOn, True, \ XmNtopAttachment, XmATTACH_FORM, \ XmNbottomAttachment, XmATTACH_FORM, \ XmNleftAttachment, XmATTACH_POSITION, \ XmNleftPosition, nLeftPositionOfInputFields, \ XmNrightAttachment, XmATTACH_FORM, \ XmNvalue, sz ## parameterNameWithoutPrefix , \ NULL ); \ \ XtAddCallback( wid ## parameterNameWithoutPrefix ## _, \ XmNactivateCallback, \ (XtCallbackProc )XmProcessTraversal, \ (XtPointer) XmTRAVERSE_NEXT_TAB_GROUP ); static char szTitleFwdRevPairs[] = "Which Fwd/Rev Pairs to Show in Assembly View"; static char szTitleSequenceMatches[] = "Which Sequence Matches to Show in Assembly View"; void guiAssemblyViewWhatToShow :: popup() { XmString xmsEmpty = XmStringCreateSimple( "" ); widPopupShell_ = XtVaCreatePopupShell( "What to Show in Assembly View", topLevelShellWidgetClass, pAssemblyView_->widPopupShell_, XmNtitle, ( cType_ == cFWD_REV_PAIRS ? szTitleFwdRevPairs : szTitleSequenceMatches ), XmNtransient, False, XmNdeleteResponse, XmDO_NOTHING, NULL ); handleWindowManagerDelete2( widPopupShell_, cbDismiss, this ); // the immediate child of the application shell is a main window (so // there can be a menu bar) Widget widMainWin = XtVaCreateManagedWidget( "mainwin", xmMainWindowWidgetClass, widPopupShell_, XmNancestorSensitive, True, NULL ); // put menu bar on the main window int nArgs = 0; Arg aArg[30]; Widget widMenuBar = XmCreateMenuBar( widMainWin, "menubar", aArg, nArgs ); XtManageChild( widMenuBar ); // create help menu button nArgs = 0; Widget widHelpMenu = XmCreatePulldownMenu( widMenuBar, "Help", aArg, nArgs ); nArgs = 0; XtSetArg( aArg[ nArgs ], XmNsubMenuId, widHelpMenu ); ++nArgs; Widget widHelpCascade = XmCreateCascadeButton( widMenuBar, "Help", aArg, nArgs ); XtManageChild( widHelpCascade ); XtVaSetValues( widMenuBar, XmNmenuHelpWidget, widHelpCascade, NULL ); // now add help menu item Widget widShowDocumentation = XtVaCreateManagedWidget( "Show Documentation for Assembly View", xmPushButtonWidgetClass, widHelpMenu, NULL ); XtAddCallback( widShowDocumentation, XmNactivateCallback, cbGuiShowDocumentationForAssemblyView, this ); Widget widForm = XtVaCreateManagedWidget( "form", xmFormWidgetClass, widMainWin, XmNancestorSensitive, True, NULL ); widDismiss_ = XtVaCreateManagedWidget( "Dismiss", xmPushButtonWidgetClass, widForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 10, XmNtraversalOn, False, XmNleftAttachment, XmATTACH_POSITION, XmNleftPosition, ( cType_ == cFWD_REV_PAIRS ? 70 : 40), XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, ( cType_ == cFWD_REV_PAIRS ? 90 : 60), NULL ); XtAddCallback( widDismiss_, XmNactivateCallback, cbDismiss, this ); if ( cType_ == cFWD_REV_PAIRS ) { widApply_ = XtVaCreateManagedWidget( "Apply", xmPushButtonWidgetClass, widForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 10, XmNtraversalOn, False, XmNleftAttachment, XmATTACH_POSITION, XmNleftPosition, 10, XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, 30, NULL ); XtAddCallback( widApply_, XmNactivateCallback, cbApply, this ); Widget widInconsistentFwdRevPairFilterLabel = XtVaCreateManagedWidget( "Show Inconsistent Forward/Reverse Pairs:", xmLabelWidgetClass, widForm, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNalignment, XmALIGNMENT_END, NULL ); Widget widInconsistentFwdRevPairFilterRadioBox = XmCreateRadioBox( widForm, "radio", NULL, 0 ); XtVaSetValues( widInconsistentFwdRevPairFilterRadioBox, XmNtraversalOn, True, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widInconsistentFwdRevPairFilterLabel, XmNorientation, XmHORIZONTAL, NULL ); widAllInconsistentFwdRevPairs_ = XtVaCreateManagedWidget( "all", xmToggleButtonWidgetClass, widInconsistentFwdRevPairFilterRadioBox, XmNtraversalOn, False, XmNset, ( pAssemblyView_->nShowWhichInconsistentFwdRevPairs_ == assemblyView::nALL_INCONSISTENT_FWD_REV_PAIRS ), NULL ); widNoInconsistentFwdRevPairs_ = XtVaCreateManagedWidget( "none", xmToggleButtonWidgetClass, widInconsistentFwdRevPairFilterRadioBox, XmNtraversalOn, False, XmNset, ( pAssemblyView_->nShowWhichInconsistentFwdRevPairs_ == assemblyView::nNO_INCONSISTENT_FWD_REV_PAIRS ), NULL ); widFilteredInconsistentFwdRevPairs_ = XtVaCreateManagedWidget( "only filtered", xmToggleButtonWidgetClass, widInconsistentFwdRevPairFilterRadioBox, XmNtraversalOn, False, XmNset, ( pAssemblyView_->nShowWhichInconsistentFwdRevPairs_ == assemblyView::nFILTERED_INCONSISTENT_FWD_REV_PAIRS ), NULL ); XtManageChild( widInconsistentFwdRevPairFilterRadioBox ); RWCString soLabel = "Do not show templates (in file "; soLabel += pCP->filAssemblyViewFileOfTemplatesToNotShow_; soLabel += ")"; Widget widDoNotShowTemplatesInFileLabel = XtVaCreateManagedWidget( soLabel.data(), xmLabelWidgetClass, widForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, widInconsistentFwdRevPairFilterRadioBox, XmNleftAttachment, XmATTACH_FORM, XmNalignment, XmALIGNMENT_BEGINNING, NULL ); Widget widDoNotShowRadioBox = XmCreateRadioBox( widForm, "radio", NULL, 0 ); XtVaSetValues( widDoNotShowRadioBox, XmNtraversalOn, True, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, widDoNotShowTemplatesInFileLabel, XmNleftAttachment, XmATTACH_FORM, XmNorientation, XmHORIZONTAL, NULL ); Widget widDoNotShowTemplatesInFileNo = XtVaCreateManagedWidget( "show all templates", xmToggleButtonWidgetClass, widDoNotShowRadioBox, XmNtraversalOn, False, XmNset, ( pAssemblyView_->bDoNotShowTemplatesInDoNotShowTemplatesFile_ ? false : true ), NULL ); widDoNotShowTemplatesInFileYes_ = XtVaCreateManagedWidget( "do not show specified templates", xmToggleButtonWidgetClass, widDoNotShowRadioBox, XmNtraversalOn, False, XmNset, ( pAssemblyView_->bDoNotShowTemplatesInDoNotShowTemplatesFile_ ? true : false ), NULL ); XtManageChild( widDoNotShowRadioBox ); Widget widReadFileOfReadsToNotShow = XtVaCreateManagedWidget( "re-read file", xmPushButtonWidgetClass, widForm, XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, XmNtopWidget, widDoNotShowTemplatesInFileYes_, XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET, XmNbottomWidget, widDoNotShowTemplatesInFileYes_, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widDoNotShowRadioBox, XmNleftOffset, 10, XmNtraversalOn, False, NULL ); XtAddCallback( widReadFileOfReadsToNotShow, XmNactivateCallback, cbReadFileOfReadsToNotShow, this ); Widget widRowCol = XtVaCreateManagedWidget( "rowcol", xmRowColumnWidgetClass, widForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, widDoNotShowRadioBox, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, widDismiss_, XmNorientation, XmVERTICAL, XmNnumColumns, 1, XmNpacking, XmPACK_COLUMN, NULL ); makeLabelAndToggleButton( ShowDepth, "show consistent fwd/rev pair depth" ); makeLabelAndToggleButton( ShowEachConsistentFwdRevPair, "show each consistent fwd/rev pair within contigs" ); makeLabelAndToggleButton( ShowGapSpanningFwdRevPairs, "show gap-spanning fwd/rev pairs" ); makeLabelAndToggleButton( ShowConsistentFwdRevPairsBetweenDifferentScaffolds, "show consistent fwd/rev pairs between diff scaffolds" ); makeLabelAndToggleButton( ShowLegsOnSquaresForConsistentFwdRevPairs, "show legs on squares for consistent fwd/rev pairs" ); } else if ( cType_ == cSEQUENCE_MATCHES ) { Widget widCrossmatchFrame = XtVaCreateManagedWidget( "crossmatch_frame", xmFrameWidgetClass, widForm, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL ); Widget widForm2 = XtVaCreateManagedWidget( "crossmatch_form", xmFormWidgetClass, widCrossmatchFrame, NULL ); Widget widRunCrossmatch = XtVaCreateManagedWidget( "run crossmatch", xmPushButtonWidgetClass, widForm2, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 10, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 10, NULL ); XtAddCallback( widRunCrossmatch, XmNactivateCallback, cbUserPushedRunCrossmatch, this ); Widget widLabelMinmatch = XtVaCreateManagedWidget( "with -minmatch", xmLabelWidgetClass, widForm2, XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, XmNtopWidget, widRunCrossmatch, XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET, XmNbottomWidget, widRunCrossmatch, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widRunCrossmatch, XmNleftOffset, 10, NULL ); char szMinmatch[200]; sprintf( szMinmatch, "%d", pCP->nAssemblyViewCrossMatchMinmatch_ ); widMinmatch_ = XtVaCreateManagedWidget( "minmatch", xmTextFieldWidgetClass, widForm2, XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, XmNtopWidget, widRunCrossmatch, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widLabelMinmatch, XmNleftOffset, 0, XmNcolumns, 5, XmNvalue, szMinmatch, NULL ); Widget widLabelMinscore = XtVaCreateManagedWidget( "-minscore", xmLabelWidgetClass, widForm2, XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, XmNtopWidget, widRunCrossmatch, XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET, XmNbottomWidget, widRunCrossmatch, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widMinmatch_, XmNleftOffset, 10, NULL ); char szMinscore[200]; sprintf( szMinscore, "%d", pCP->nAssemblyViewCrossMatchMinscore_ ); widMinscore_ = XtVaCreateManagedWidget( "minscore", xmTextFieldWidgetClass, widForm2, XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, XmNtopWidget, widRunCrossmatch, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widLabelMinscore, XmNleftOffset, 0, XmNcolumns, 5, XmNvalue, szMinscore, NULL ); Widget widLabelOtherOptions = XtVaCreateManagedWidget( "other crossmatch options:", xmLabelWidgetClass, widForm2, XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET, XmNleftWidget, widLabelMinmatch, NULL ); widOtherCrossmatchOptions_ = XtVaCreateManagedWidget( "other_crossmatch_options", xmTextFieldWidgetClass, widForm2, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, widMinscore_, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 10, NULL ); XtVaSetValues( widLabelOtherOptions, XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, XmNtopWidget, widOtherCrossmatchOptions_, XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET, XmNbottomWidget, widOtherCrossmatchOptions_, NULL ); Dimension dimWidth; XtVaGetValues( widLabelOtherOptions, XmNwidth, &dimWidth, NULL ); XtVaSetValues( widOtherCrossmatchOptions_, XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET, XmNleftWidget, widLabelMinmatch, XmNleftOffset, ( dimWidth + 10 ), NULL ); Widget widFrame2 = XtVaCreateManagedWidget( "frame2", xmFrameWidgetClass, widForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, widCrossmatchFrame, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, widDismiss_, NULL ); Widget widForm3 = XtVaCreateManagedWidget( "form3", xmFormWidgetClass, widFrame2, NULL ); widApply_ = XtVaCreateManagedWidget( "Apply", xmPushButtonWidgetClass, widForm3, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 10, XmNtraversalOn, False, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 10, NULL ); XtAddCallback( widApply_, XmNactivateCallback, cbApply, this ); Widget widRowCol = XtVaCreateManagedWidget( "rowcol", xmRowColumnWidgetClass, widForm3, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, widApply_, XmNorientation, XmVERTICAL, XmNnumColumns, 1, XmNpacking, XmPACK_COLUMN, NULL ); // do not show any sequence matches Widget widDoNotShowAnySeqMatchesForm = XtVaCreateManagedWidget( "doNotShowAnySeqMatchesForm", xmFormWidgetClass, widRowCol, XmNshadowThickness, 0, NULL ); widDoNotShowAnySeqMatches_ = XtVaCreateManagedWidget( "doNotShowAnySeqMatches", xmToggleButtonWidgetClass, widDoNotShowAnySeqMatchesForm, XmNtraversalOn, False, XmNlabelString, xmsEmpty, XmNmarginHeight, 0, XmNmarginWidth, 0, XmNshadowThickness, 0, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 10, XmNset, !pCP->bAssemblyViewShowSequenceMatches_, NULL ); Widget widDoNotShowAnySeqMatchesLabel = XtVaCreateManagedWidget( "do not show any sequence matches at all", xmLabelWidgetClass, widDoNotShowAnySeqMatchesForm, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widDoNotShowAnySeqMatches_, NULL ); // filter sequence matches by copy size Widget widFilterSeqMatchesBySizeForm = XtVaCreateManagedWidget( "filterSeqMatchesBySizeForm", xmFormWidgetClass, widRowCol, XmNshadowThickness, 0, NULL ); widFilterSeqMatchesBySize_ = XtVaCreateManagedWidget( "filterSeqMatchesBySize", xmToggleButtonWidgetClass, widFilterSeqMatchesBySizeForm, XmNtraversalOn, False, XmNlabelString, xmsEmpty, XmNmarginHeight, 0, XmNmarginWidth, 0, XmNshadowThickness, 0, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 10, XmNset, pCP->bAssemblyViewFilterSequenceMatchesBySize_, NULL ); XtAddCallback( widFilterSeqMatchesBySize_, XmNvalueChangedCallback, cbFilterSeqMatchesBySizeChanged, this ); Widget widFilterSeqMatchesBySizeLabel = XtVaCreateManagedWidget( "filter seq matches by size", xmLabelWidgetClass, widFilterSeqMatchesBySizeForm, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widFilterSeqMatchesBySize_, XmNalignment, XmALIGNMENT_BEGINNING, NULL ); Widget widMinSizeLabel = XtVaCreateManagedWidget( "min size:", xmLabelWidgetClass, widFilterSeqMatchesBySizeForm, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widFilterSeqMatchesBySizeLabel, // XmNsensitive, pCP->bAssemblyViewFilterSequenceMatchesBySize_, NULL ); char szMinSize[200]; sprintf( szMinSize, "%d", pCP->nAssemblyViewSequenceMatchesMinSize_ ); widSeqMatchesMinSize_ = XtVaCreateManagedWidget( "seqMatchesMinSize", xmTextFieldWidgetClass, widFilterSeqMatchesBySizeForm, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widMinSizeLabel, XmNcolumns, 7, XmNvalue, szMinSize, XmNsensitive, pCP->bAssemblyViewFilterSequenceMatchesBySize_, NULL ); Widget widMaxSizeLabel = XtVaCreateManagedWidget( "max size:", xmLabelWidgetClass, widFilterSeqMatchesBySizeForm, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widSeqMatchesMinSize_, // XmNsensitive, pCP->bAssemblyViewFilterSequenceMatchesBySize_, NULL ); char szMaxSize[200]; sprintf( szMaxSize, "%d", pCP->nAssemblyViewSequenceMatchesMaxSize_ ); widSeqMatchesMaxSize_ = XtVaCreateManagedWidget( "seqMatchesMaxSize", xmTextFieldWidgetClass, widFilterSeqMatchesBySizeForm, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widMaxSizeLabel, XmNrightAttachment, XmATTACH_FORM, XmNcolumns, 7, XmNvalue, szMaxSize, XmNsensitive, pCP->bAssemblyViewFilterSequenceMatchesBySize_, NULL ); // consed.assemblyViewOKToShowSequenceMatchesBetweenContigs makeLabelAndToggleButtonCP( AssemblyViewOKToShowSequenceMatchesBetweenContigs, "ok to show sequence matches between contigs" ); makeLabelAndToggleButtonCP( AssemblyViewOKToShowSequenceMatchesWithinContigs, "ok to show sequence matches within contigs" ); makeLabelAndToggleButtonCP( AssemblyViewOKToShowDirectSequenceMatches, "ok to show direct sequence matches" ); makeLabelAndToggleButtonCP( AssemblyViewOKToShowInvertedSequenceMatches, "ok to show inverted sequence matches" ); makeLabelAndToggleButtonCP( AssemblyViewOnlyShowSequenceMatchesToAParticularRegion, "only show sequence matches to this region:" ); XtAddCallback( widAssemblyViewOnlyShowSequenceMatchesToAParticularRegion_, XmNvalueChangedCallback, cbAssemblyViewOnlyShowSequenceMatchesToAParticularRegionChanged, this ); Widget widOnlyShowSequenceMatchesToAParticularRegionForm2 = XtVaCreateManagedWidget( "onlyShowSequenceMatchesToAParticularRegionForm2", xmFormWidgetClass, widRowCol, XmNshadowThickness, 0, NULL ); Widget widOnlyShowSequenceMatchesToAParticularRegionContigLabel = XtVaCreateManagedWidget( "contig:", xmLabelWidgetClass, widOnlyShowSequenceMatchesToAParticularRegionForm2, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 40, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL ); widOnlyShowSequenceMatchesToAParticularRegionContig_ = XtVaCreateManagedWidget( "contig", xmTextFieldWidgetClass, widOnlyShowSequenceMatchesToAParticularRegionForm2, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widOnlyShowSequenceMatchesToAParticularRegionContigLabel, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNcolumns, 10, XmNvalue, pCP->soAssemblyViewOnlyShowSequenceMatchesToThisContig_.data(), XmNsensitive, False, // default NULL ); Widget widOnlyShowSequenceMatchesToAParticularRegionLeftLabel = XtVaCreateManagedWidget( "left pos:", xmLabelWidgetClass, widOnlyShowSequenceMatchesToAParticularRegionForm2, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widOnlyShowSequenceMatchesToAParticularRegionContig_, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL ); widOnlyShowSequenceMatchesToAParticularRegionLeft_ = XtVaCreateManagedWidget( "left pos", xmTextFieldWidgetClass, widOnlyShowSequenceMatchesToAParticularRegionForm2, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widOnlyShowSequenceMatchesToAParticularRegionLeftLabel, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNcolumns, 7, XmNvalue, RWCString( (long) pCP->nAssemblyViewOnlyShowSequenceMatchesToThisRegionLeft_ ).data(), XmNsensitive, False, // default NULL ); Widget widOnlyShowSequenceMatchesToAParticularRegionRightLabel = XtVaCreateManagedWidget( "right pos:", xmLabelWidgetClass, widOnlyShowSequenceMatchesToAParticularRegionForm2, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widOnlyShowSequenceMatchesToAParticularRegionLeft_, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL ); widOnlyShowSequenceMatchesToAParticularRegionRight_ = XtVaCreateManagedWidget( "right pos", xmTextFieldWidgetClass, widOnlyShowSequenceMatchesToAParticularRegionForm2, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widOnlyShowSequenceMatchesToAParticularRegionRightLabel, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNcolumns, 7, XmNvalue, RWCString( (long) pCP->nAssemblyViewOnlyShowSequenceMatchesToThisRegionRight_ ).data(), XmNsensitive, False, // default NULL ); makeLabelAndToggleButtonCP( AssemblyViewOnlyShowSequenceMatchesToEndsOfContigs, "only show sequence matches to ends of contigs" ); XtAddCallback( widAssemblyViewOnlyShowSequenceMatchesToEndsOfContigs_, XmNvalueChangedCallback, cbAssemblyViewOnlyShowSequenceMatchesToEndsOfContigsChanged, this ); Widget widOnlyShowSequenceMatchesToEndsOfContigsForm2 = XtVaCreateManagedWidget( "onlyShowSequenceMatchesToEndsOfContigsForm2", xmFormWidgetClass, widRowCol, XmNshadowThickness, 0, NULL ); Widget widOnlyShowSequenceMatchesToEndsOfContigsDistanceLabel = XtVaCreateManagedWidget( "max distance from end of contig:", xmLabelWidgetClass, widOnlyShowSequenceMatchesToEndsOfContigsForm2, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 40, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL ); RWCString soInitialValue = RWCString( (long) pCP->nAssemblyViewOnlyShowSequenceMatchesToEndsOfContigsThisFar_ ); widOnlyShowSequenceMatchesToEndsOfContigsDistance_ = XtVaCreateManagedWidget( "distance", xmTextFieldWidgetClass, widOnlyShowSequenceMatchesToEndsOfContigsForm2, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widOnlyShowSequenceMatchesToEndsOfContigsDistanceLabel, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNcolumns, 10, XmNvalue, soInitialValue.data(), XmNsensitive, ( pCP->bAssemblyViewOnlyShowSequenceMatchesToEndsOfContigs_ ? True : False ), NULL ); // filter sequence matches by similarity Widget widFilterSeqMatchesBySimilarityForm = XtVaCreateManagedWidget( "filterSeqMatchesBySimilarityForm", xmFormWidgetClass, widRowCol, XmNshadowThickness, 0, NULL ); Widget widFilterSeqMatchesBySimilarityLabel = XtVaCreateManagedWidget( "minimum % similarity:", xmLabelWidgetClass, widFilterSeqMatchesBySimilarityForm, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNalignment, XmALIGNMENT_BEGINNING, NULL ); char szMinSimilarity[200]; sprintf( szMinSimilarity, "%d", pCP->nAssemblyViewSequenceMatchesMinimumSimilarity_ ); widSeqMatchesMinSimilarity_ = XtVaCreateManagedWidget( "seqMatchesMinSimilarity", xmTextFieldWidgetClass, widFilterSeqMatchesBySimilarityForm, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widFilterSeqMatchesBySimilarityLabel, // XmNrightAttachment, XmATTACH_FORM, XmNcolumns, 7, XmNvalue, szMinSimilarity, NULL ); // bCompareContigsUseBandedRatherThanFullSmithWaterman_ Widget widCompareContigsUseBandedRatherThanFullSmithWatermanForm = XtVaCreateManagedWidget( "compareContigsUseBandedRatherThanFullSmithWatermanForm", xmFormWidgetClass, widRowCol, XmNshadowThickness, 0, NULL ); Widget widCompareContigsUseBandedRatherThanFullSmithWatermanLabel = XtVaCreateManagedWidget( "Type of Smith/Waterman alignment:", xmLabelWidgetClass, widCompareContigsUseBandedRatherThanFullSmithWatermanForm, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNalignment, XmALIGNMENT_BEGINNING, NULL ); Widget widCompareContigsUseBandedRatherThanFullSmithWatermanRadioBox = XmCreateRadioBox( widCompareContigsUseBandedRatherThanFullSmithWatermanForm, "radio", NULL, 0 ); XtVaSetValues( widCompareContigsUseBandedRatherThanFullSmithWatermanRadioBox, XmNtraversalOn, True, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, widCompareContigsUseBandedRatherThanFullSmithWatermanLabel, XmNorientation, XmHORIZONTAL, XmNshadowThickness, 0, XmNborderWidth, 0, XmNmarginWidth, 0, NULL ); widCompareContigsUseBandedRatherThanFullSmithWatermanTrue_ = XtVaCreateManagedWidget( "Banded", xmToggleButtonWidgetClass, widCompareContigsUseBandedRatherThanFullSmithWatermanRadioBox, XmNset, pCP->bCompareContigsUseBandedRatherThanFullSmithWaterman_, NULL ); Widget widCompareContigsUseBandedRatherThanFullSmithWatermanFalse = XtVaCreateManagedWidget( "Full (takes a long time)", xmToggleButtonWidgetClass, widCompareContigsUseBandedRatherThanFullSmithWatermanRadioBox, XmNset, !pCP->bCompareContigsUseBandedRatherThanFullSmithWaterman_, NULL ); XtManageChild( widCompareContigsUseBandedRatherThanFullSmithWatermanRadioBox ); } XtPopup( widPopupShell_, XtGrabNone ); XmStringFree( xmsEmpty ); } void guiAssemblyViewWhatToShow :: userPushedApply() { if ( cType_ == cFWD_REV_PAIRS ) { pAssemblyView_->bShowDepth_ = ( XmToggleButtonGetState( widShowDepth_ ) == True ? true : false ); pAssemblyView_->bShowEachConsistentFwdRevPair_ = ( XmToggleButtonGetState( widShowEachConsistentFwdRevPair_ ) == True ? true : false ); pAssemblyView_->bShowGapSpanningFwdRevPairs_ = ( XmToggleButtonGetState( widShowGapSpanningFwdRevPairs_ ) == True ? true : false ); if ( XmToggleButtonGetState( widFilteredInconsistentFwdRevPairs_ ) == True ) { pAssemblyView_->nShowWhichInconsistentFwdRevPairs_ = assemblyView::nFILTERED_INCONSISTENT_FWD_REV_PAIRS; } else if ( XmToggleButtonGetState( widAllInconsistentFwdRevPairs_ ) == True ) { pAssemblyView_->nShowWhichInconsistentFwdRevPairs_ = assemblyView::nALL_INCONSISTENT_FWD_REV_PAIRS; } else if ( XmToggleButtonGetState( widNoInconsistentFwdRevPairs_ ) == True ) { pAssemblyView_->nShowWhichInconsistentFwdRevPairs_ = assemblyView::nNO_INCONSISTENT_FWD_REV_PAIRS; } pAssemblyView_->bShowConsistentFwdRevPairsBetweenDifferentScaffolds_ = ( XmToggleButtonGetState( widShowConsistentFwdRevPairsBetweenDifferentScaffolds_ ) == True ? true : false ); pAssemblyView_->bShowLegsOnSquaresForConsistentFwdRevPairs_ = ( XmToggleButtonGetState( widShowLegsOnSquaresForConsistentFwdRevPairs_ ) == True ? true : false ); bool bOldDoNotShowTemplatesInDoNotShowTemplatesFile = pAssemblyView_->bDoNotShowTemplatesInDoNotShowTemplatesFile_; pAssemblyView_->bDoNotShowTemplatesInDoNotShowTemplatesFile_ = ( XmToggleButtonGetState( widDoNotShowTemplatesInFileYes_ ) == True ? true : false ); if ( bOldDoNotShowTemplatesInDoNotShowTemplatesFile != pAssemblyView_->bDoNotShowTemplatesInDoNotShowTemplatesFile_ ) { ConsEd::pGetAssembly()->figureOutConsistentForwardReversePairDepthOfAllContigs( pAssemblyView_->bDoNotShowTemplatesInDoNotShowTemplatesFile_ ); } } else if ( cType_ == cSEQUENCE_MATCHES ) { pCP->bAssemblyViewShowSequenceMatches_ = ( XmToggleButtonGetState( widDoNotShowAnySeqMatches_ ) == True ? false : true ); pCP->bAssemblyViewFilterSequenceMatchesBySize_ = ( XmToggleButtonGetState( widFilterSeqMatchesBySize_ ) == True ? true : false ); char* szValue; RWCString soValue; checkIfNumeric( SeqMatchesMinSize ); pCP->nAssemblyViewSequenceMatchesMinSize_ = nPerhapsSeqMatchesMinSize; checkIfNumeric( SeqMatchesMaxSize ); pCP->nAssemblyViewSequenceMatchesMaxSize_ = nPerhapsSeqMatchesMaxSize; pCP->bAssemblyViewOKToShowSequenceMatchesBetweenContigs_ = ( XmToggleButtonGetState( widAssemblyViewOKToShowSequenceMatchesBetweenContigs_ ) == True ? true : false ); pCP->bAssemblyViewOKToShowSequenceMatchesWithinContigs_ = ( XmToggleButtonGetState( widAssemblyViewOKToShowSequenceMatchesWithinContigs_ ) == True ? true : false ); pCP->bAssemblyViewOKToShowDirectSequenceMatches_ = ( XmToggleButtonGetState( widAssemblyViewOKToShowDirectSequenceMatches_ ) == True ? true : false ); pCP->bAssemblyViewOKToShowInvertedSequenceMatches_ = ( XmToggleButtonGetState( widAssemblyViewOKToShowInvertedSequenceMatches_ ) == True ? true : false ); pCP->bAssemblyViewOnlyShowSequenceMatchesToAParticularRegion_ = ( XmToggleButtonGetState( widAssemblyViewOnlyShowSequenceMatchesToAParticularRegion_ ) == True ? true : false ); // allow blank contigs if we aren't using the contig name anyway // (not only show sequences matches to a particular region) if ( pCP->bAssemblyViewOnlyShowSequenceMatchesToAParticularRegion_ ) { szValue = XmTextFieldGetString( widOnlyShowSequenceMatchesToAParticularRegionContig_ ); RWCString soContigName = szValue; XtFree( szValue ); if ( ConsEd::pGetAssembly()->pGetContigByName( soContigName ) ) { pCP->soAssemblyViewOnlyShowSequenceMatchesToThisContig_ = soContigName; } else { RWCString soContigName2; if ( soContigName.bStartsWithCaseInsensitive( "contig" ) ) { soContigName2 = "Contig" + soContigName.soGetRestOfString( 6 ); } else { soContigName2 = "Contig" + soContigName; } if ( ConsEd::pGetAssembly()->pGetContigByName( soContigName2 ) ) { pCP->soAssemblyViewOnlyShowSequenceMatchesToThisContig_ = soContigName2; } else { popupErrorMessage2( widPopupShell_, "Contig %s does not exist", soContigName.data() ); return; } } checkIfNumeric( OnlyShowSequenceMatchesToAParticularRegionLeft ); checkIfNumeric( OnlyShowSequenceMatchesToAParticularRegionRight ); if ( nPerhapsOnlyShowSequenceMatchesToAParticularRegionLeft > nPerhapsOnlyShowSequenceMatchesToAParticularRegionRight ) { int nTemp = nPerhapsOnlyShowSequenceMatchesToAParticularRegionLeft; nPerhapsOnlyShowSequenceMatchesToAParticularRegionLeft = nPerhapsOnlyShowSequenceMatchesToAParticularRegionRight; nPerhapsOnlyShowSequenceMatchesToAParticularRegionRight = nTemp; } pCP->nAssemblyViewOnlyShowSequenceMatchesToThisRegionLeft_ = nPerhapsOnlyShowSequenceMatchesToAParticularRegionLeft; pCP->nAssemblyViewOnlyShowSequenceMatchesToThisRegionRight_ = nPerhapsOnlyShowSequenceMatchesToAParticularRegionRight; } pCP->bAssemblyViewOnlyShowSequenceMatchesToEndsOfContigs_ = ( XmToggleButtonGetState( widAssemblyViewOnlyShowSequenceMatchesToEndsOfContigs_ ) == True ? true : false ); if ( pCP->bAssemblyViewOnlyShowSequenceMatchesToEndsOfContigs_ ) { checkIfNumeric( OnlyShowSequenceMatchesToEndsOfContigsDistance ); pCP->nAssemblyViewOnlyShowSequenceMatchesToEndsOfContigsThisFar_ = nPerhapsOnlyShowSequenceMatchesToEndsOfContigsDistance; } checkIfNumeric( SeqMatchesMinSimilarity ); pCP->nAssemblyViewSequenceMatchesMinimumSimilarity_ = nPerhapsSeqMatchesMinSimilarity; pCP->bCompareContigsUseBandedRatherThanFullSmithWaterman_ = ( XmToggleButtonGetState( widCompareContigsUseBandedRatherThanFullSmithWatermanTrue_ ) == True ) ? true : false; } pAssemblyView_->drawEverything( true, // bCalculatePositions true ); // bFirstErase } void guiAssemblyViewWhatToShow :: readFileOfReadsToNotShow() { pAssemblyView_->readFileOfTemplatesToNotShow( pCP->filAssemblyViewFileOfTemplatesToNotShow_ ); pAssemblyView_->markFwdRevPairsForThoseNotToShow(); } void guiAssemblyViewWhatToShow :: userPushedRunCrossmatch() { // we will only allow crossmatch to be run on an ace file that is // saved. if ( ConsEd::pGetAssembly()->bChanged() ) { popupErrorMessage2( widPopupShell_, "You have changed the assembly since the last time the ace file was saved. Please save the assembly before trying to run crossmatch to show repeats." ); return; } // first get the options the user typed in RWCString soTotalOptions; char* szValue; RWCString soValue; checkIfNumeric( Minmatch ); soTotalOptions += "-minmatch "; soTotalOptions += soValue; checkIfNumeric( Minscore ); soTotalOptions += " -minscore "; soTotalOptions += soValue; szValue = XmTextFieldGetString( widOtherCrossmatchOptions_ ); soTotalOptions += " "; soTotalOptions += szValue; XtFree( szValue ); // not including -tags since that is already in the script RWCString soCommand = pCP->filAssemblyViewFindSequenceMatchesForConsedScript_ + " " + ConsEd::pGetAssembly()->filGetAceFileFullPathname() + " " + soTotalOptions; cout << "about to execute " << soCommand << endl; cout.flush(); int nRetStat = system( (char*) soCommand.data() ); if ( nRetStat != 0 ) { RWCString soErrorMessage = "Something wrong running command "; soErrorMessage += soCommand; soErrorMessage += " "; soErrorMessage += soGetErrno(); popupErrorMessage2( widPopupShell_, soErrorMessage ); return; } // crossmatch ran successfully--read the output in and display it pAssemblyView_->bAlreadyReadCrossMatchOutput_ = false; pAssemblyView_->drawEverything( true, // bFirstCalculatePositions true ); // bEraseFirst } void guiAssemblyViewWhatToShow :: filterSeqMatchesBySizeChanged() { bool bSensitive = ( XmToggleButtonGetState( widFilterSeqMatchesBySize_ ) == True ) ? true : false; XtVaSetValues( widSeqMatchesMaxSize_, XmNsensitive, bSensitive, NULL ); XtVaSetValues( widSeqMatchesMinSize_, XmNsensitive, bSensitive, NULL ); } void guiAssemblyViewWhatToShow :: assemblyViewOnlyShowSequenceMatchesToAParticularRegionChanged() { bool bSensitive = ( XmToggleButtonGetState( widAssemblyViewOnlyShowSequenceMatchesToAParticularRegion_ ) == True ) ? true : false ; XtVaSetValues( widOnlyShowSequenceMatchesToAParticularRegionContig_, XmNsensitive, bSensitive, NULL ); XtVaSetValues( widOnlyShowSequenceMatchesToAParticularRegionLeft_, XmNsensitive, bSensitive, NULL ); XtVaSetValues( widOnlyShowSequenceMatchesToAParticularRegionRight_, XmNsensitive, bSensitive, NULL ); } void guiAssemblyViewWhatToShow :: assemblyViewOnlyShowSequenceMatchesToEndsOfContigsChanged() { bool bSensitive = ( XmToggleButtonGetState( widAssemblyViewOnlyShowSequenceMatchesToEndsOfContigs_ ) == True ) ? true : false; XtVaSetValues( widOnlyShowSequenceMatchesToEndsOfContigsDistance_, XmNsensitive, bSensitive, NULL ); }