File: TProteolysis.h

package info (click to toggle)
gentle 1.9+cvs20100605+dfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,224 kB
  • ctags: 6,214
  • sloc: cpp: 41,569; ansic: 3,978; sh: 1,420; makefile: 243
file content (97 lines) | stat: -rw-r--r-- 3,560 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
95
96
97
#ifndef _PROTEOLYSIS_H_
#define _PROTEOLYSIS_H_

#include "main.h"

class TProtease ;

class TProteolysisGel : public wxScrolledWindow
	{
	public :
	TProteolysisGel(wxWindow* parent, wxWindowID id = -1 ) ;
	virtual void OnDraw(wxDC& dc) ; ///< Redraw
    virtual void OnEvent(wxMouseEvent& event); ///< Mouse event handler
    
    wxArrayInt screen , logical ;
	
	DECLARE_EVENT_TABLE()
	} ;

typedef vector <TProtease*> TProteaseArray ;
typedef vector <TProteaseCut*> TProteaseCutArray ;
	
class TProteolysisSuggestion
	{
	public :
	TProteaseArray proteases ;
	wxString name , desc ;
	int grade ;
	} ;

bool operator < ( const TProteolysisSuggestion &c1 , const TProteolysisSuggestion &c2 ) ;
bool operator == ( const TProteolysisSuggestion &c1 , const TProteolysisSuggestion &c2 ) ;

class TProteolysis : public wxDialog
	{
	public :
	TProteolysis(TAminoAcids *_parent, const wxString& title ) ; ///< Constructor
	virtual ~TProteolysis () ; ///< Destructor

	void OnOK ( wxCommandEvent &ev ) ; ///< OK button event handler
	void OnCancel ( wxCommandEvent &ev ) ; ///< Cancel button event handler
	void OnAll ( wxCommandEvent &ev ) ; ///< "All" button event handler
	void OnNone ( wxCommandEvent &ev ) ; ///< "None" button event handler
	void OnReport ( wxCommandEvent &ev ) ; ///< "Report" button event handler
	void OnProtease ( wxCommandEvent &ev ) ; ///< Protease list event handler
	void OnIgnore ( wxCommandEvent &ev ) ; ///< Ignore list event handler
	void OnSepFragments ( wxCommandEvent &ev ) ; ///< Separate fragments event handler
	void OnSepResults ( wxCommandEvent &ev ) ; ///< Separation results event handler
	void OnCuts ( wxCommandEvent &ev ) ; ///< Cut list event handler
	void OnShowGel ( wxCommandEvent &ev ) ; // Show/refresh gel
	void OnPartial ( wxCommandEvent &ev ) ; // Toggle partial digestion
	void OnCharHook(wxKeyEvent& event) ; ///< Key event handler
	void OnSortResults(wxCommandEvent& event) ; ///< Sort results event handler
	void OnNumProts(wxCommandEvent& event) ; ///< Number of proteases event handler
	void OnResults ( wxCommandEvent &ev ) ; ///< Fragment list checkbox changed
	
	void draw_gel ( wxDC &dc ) ; ///< Draw the virtual gel
	void select_fragments ( const wxArrayInt &ai ) ;

	private :
	void recalc () ;
	void calc_cut_list () ;
	void calc_fragment_list () ;
	void calc_spearation () ;
	void calc_spearation_sub ( int depth , TProteaseArray &prop , vector <TFragment> &tobe , int start = 0 ) ;
	void show_gel () ;
	void show_fragment_list () ;
	double get_weight ( int from , int to ) ;
	int get_y ( double y , int h , double min , double max ) ;
	void determine_cuts ( TProteaseArray &prop , TProteaseCutArray &apc ) ;
	void remove_ignored_cuts ( TProteaseCutArray &apc ) ;
	void sort_cuts ( TProteaseCutArray &apc ) ;
	void add_final_piece ( TProteaseCutArray &apc ) ;
	void find_cutting_proteases () ;
	
	TAminoAcids *parent ;
	TVector *v ;
	TStorage *ls ;
	wxCheckListBox *proteases , *ignore , *cuts , *results , *sep_fragments ;
	wxListBox *sep_results ;
	wxRadioBox *sep_num_prot ;
	wxCheckBox *show_uncut , *create_fragments, *create_labels , *use_proteases , *partial_digestion ;
	TProteolysisGel *gel ;
	TProteaseCutArray pc ;
	wxTextCtrl *sep_desc ;
	vector <TFragment> fragments ;
	wxRadioBox *sortresults ;
	vector <TProteolysisSuggestion> suggestions ;
	vector <TProtease*> pr_cache , cutting_proteases ;
	vector <TProteaseCutArray> pc_cache ;
	int max_dep ;
	
	DECLARE_EVENT_TABLE()
	} ;


#endif