File: TRestrictionEditor.h

package info (click to toggle)
gentle 1.9+cvs20100605+dfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: squeeze
  • size: 12,264 kB
  • ctags: 5,235
  • sloc: cpp: 41,571; ansic: 3,978; sh: 1,420; makefile: 291
file content (94 lines) | stat: -rwxr-xr-x 4,070 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/** \file
	\brief Contains the TRestrictionEditor class, as well as the TREcache and TFragment helper class
*/
#ifndef _TRESTRICTIONEDITOR_H_
#define _TRESTRICTIONEDITOR_H_

#include "main.h"
#include <wx/spinctrl.h>

class wxNotebook ;
class TRestrictionEnzyme ;

/**	\brief Restriction enzyme site cache
*/
class TREcache
    {
    public :
    TREcache ( wxString a , int b ) { enzyme = a ; cut = b ; } ///< Constructor
    wxString enzyme ; ///< Enzyme name
    int cut ; ///< Position of cut
    } ;

/** \brief A restriction fragment (from, to, length)
*/
class TFragment
	{
	public :
	int from , to , length ;
	double weight ; ///< Used in TProteolysis
	} ;    

bool operator < ( const TFragment &f1 , const TFragment &f2 ) ;
bool operator == ( const TFragment &f1 , const TFragment &f2 ) ;

/** \brief The restriction editor dialog class
*/
class TRestrictionEditor : public wxDialog
    {
    public :
    TRestrictionEditor(MyFrame *parent, const wxString& title, const wxPoint& pos, 
                       const wxSize& size, const long style); ///< Constructor
    ~TRestrictionEditor () ; ///< Destructor

    virtual void initme ( TVector *_v ) ; ///< Initialization
    virtual void initRestrictionPage () ; ///< Sets up the page
    virtual void pR_showGroupEnzymes ( wxString gr ) ; ///< Shows enzymes in selected enzyme group
    virtual wxArrayInt getcuts ( wxString enzyme ) ; ///< Returns the cut positions for the given enzyme
    virtual void pR_showFragments ( int i ) ; ///< Show the resulting fragments
    virtual void add2cocktail ( wxString s ) ; ///< Add enzyme to restriction cocktail
    virtual void del_from_cocktail ( wxString s ) ; ///< Remove enzyme from restriction cocktail
    virtual void refreshCocktail () ; ///< Update cocktail list
    virtual void getFragmentList ( wxArrayInt &cuts , vector <TFragment> &fragments , bool clear = true ) ; ///< Set list of fragments
    virtual void listFragments ( wxListCtrl *list , wxArrayInt &vi ) ; ///< Show fragments in a list
    virtual void listEnzymesInGroup ( wxString gr , wxArrayString &vs ) ; ///< List the enzymes in group
    virtual void iterateFragments ( wxArrayInt cuts , vector <TFragment> &fragments , int depth = 0 ) ;

    virtual void res_ll ( wxListEvent &event ) ; ///<  event handler
    virtual void res_coc_ll ( wxListEvent &event ) ; ///<  event handler
    virtual void res_ll_act ( wxListEvent &event ) ; ///<  event handler
    virtual void res_ll_col ( wxListEvent &event ) ; ///<  event handler
    virtual void res_dd ( wxCommandEvent &event ) ; ///<  event handler
    virtual void res_cb ( wxCommandEvent &event ) ; ///<  event handler
    virtual void res_ac ( wxCommandEvent &event ) ; ///<  event handler
    virtual void res_ct ( wxCommandEvent &event ) ; ///<  event handler
    virtual void res_checkbox ( wxCommandEvent &event ) ; ///<  event handler
    virtual void res_cb_add2gel ( wxCommandEvent &event ) ; ///< "Add to gel" checkbox event handler
    virtual void res_coc_rm ( wxCommandEvent &event ) ; ///<  event handler
    virtual void onOK ( wxCommandEvent &event ) ; ///< OK button event handler
    virtual void onCancel ( wxCommandEvent &event ) ; ///< Cancel button event handler
    virtual void onAddAll ( wxCommandEvent &event ) ; ///< "Add all" button event handler
    virtual void OnCharHook(wxKeyEvent& event) ; ///< Key event handler
    
    // Variables
    wxCheckBox *createFragments , *add2gel , *oneLaneEach , *partialDigestion ;
    wxListCtrl *el , *el2 , *rsl , *rsl2 ;
    wxRadioBox *rb ;
    wxChoice *gl ;
    wxCheckBox *nfst ;
    wxSpinCtrl *nfstv ;
    wxBitmapButton *bb , *bb2 ;
    wxButton *btOK , *btCC ;
    TVector *v ;
    int _w , _h ;
    int numberoffragments ;
    vector <TREcache> cutcache ;
    wxArrayString nocut , cocktail , *remoteCocktail ;
    wxString pre , last_enzyme_selected , last_enzyme_selected_coc ;
    wxArrayInt cocktailFragments ;

    DECLARE_EVENT_TABLE()
    } ;


#endif