source: tags/svn.1.5.4/SL/GUI_ALIVIEW/ColumnStat.hxx

Last change on this file was 7623, checked in by westram, 13 years ago
  • merge from dev [7450] [7452] [7456] [7457] [7458] [7459] [7460] [7461] [7464] [7465] [7466] [7467] [7468] [7469] [7482]
    • tweaked compiler options
      • activated -Weffc++
        • postfilter warnings where Scott Meyers' advices are too general.
          • base classes should not always have virtual destructors, since that renders tiny classes useless and
          • members should not always be initialized via initialization list, since that often violates the DRY principle
        • fix gcc's inability to detect that Noncopyable implements a private copy-ctor and op=
        • this slows down complete ARB recompilation by ~5%
    • added -Wold-style-cast (inactive)
    • removed -Wno-non-template-friend added in [7447]
  • postcompile.pl
    • added option —original to show unmodified compiler output
  • declared op= for classes which had a copy-ctor
  • moved op= macros to arbtools.h
  • derived classes containing pointers from Noncopyable (use Noncopyable virtually) or
  • made them copyable if needed (awt_mask_item, KnownDB, Code, AWT_registered_itemtype, GEN_gene, PosGene, PartialSequence, PlugIn, Range, Convaln_exception)
  • other related changes
    • user mask destruction working now
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : ColumnStat.hxx                                    //
4//   Purpose   :                                                   //
5//                                                                 //
6//   Institute of Microbiology (Technical University Munich)       //
7//   http://www.arb-home.de/                                       //
8//                                                                 //
9// =============================================================== //
10
11#ifndef COLUMNSTAT_HXX
12#define COLUMNSTAT_HXX
13
14#ifndef ARBDB_BASE_H
15#include <arbdb_base.h>
16#endif
17#ifndef ARBTOOLS_H
18#include <arbtools.h>
19#endif
20
21/* Create a window, that allows you to select a column statistic and
22 * get the weights from the selected SAI
23 *
24 * 1.  create ColumnStat
25 * 2.  build button with callback COLSTAT_create_selection_window
26 * 3.  call ColumnStat::go(second_filter)
27 * 4.  use ColumnStat::get_weights()
28 */
29
30class AW_root;
31class AW_window;
32class AP_filter;
33class AW_awar;
34
35#define DIST_MIN_SEQ(seq_anz) (seq_anz / 10)
36
37class ColumnStat : virtual Noncopyable {
38    GBDATA  *gb_main;
39    AW_root *awr;
40
41    char *awar_name;
42    char *awar_alignment;
43    char *awar_smooth;
44    char *awar_enable_helix;
45
46    char *alignment_name;
47    char *type_path;
48    void *sai_sel_box_id;
49
50    // all members below are valid after calling calculate() only!
51    //
52    // @@@ they should be stored in a separate class and referenced by pointer here
53    // (e.g. rename this class into ColumnStatSelector and name the new class ColumnStat)
54   
55    size_t    seq_len;                              // real length == 0 -> not valid
56    GB_UINT4 *weights;                              // helix        = 1, non helix == 2
57    float    *rates;
58    float    *ttratio;
59    bool     *is_helix;
60    GB_UINT4 *mut_sum;
61    GB_UINT4 *freq_sum;
62    char     *desc;
63    float    *frequency[256];
64
65public:
66    ColumnStat(GBDATA *gb_main, AW_root *awr, const char *awar_template, AW_awar *awar_used_alignment);
67    ~ColumnStat();
68
69    GB_ERROR calculate(AP_filter *filter);
70    void     forget();
71
72    GBDATA *get_gb_main() const { return gb_main; }
73
74    const char *get_awar_smooth() const { return awar_smooth; }
75    const char *get_awar_enable_helix() const { return awar_enable_helix; }
76    const char *get_type_path() const { return type_path; }
77
78    bool has_rates() const { return rates != NULL; }
79    void weight_by_inverseRates() const;
80
81    size_t get_length() const { return seq_len; }
82
83    const GB_UINT4 *get_weights() const { return weights; }
84    const float *get_rates() const { return rates; }
85    const float *get_ttratio() const { return ttratio; }
86    const bool *get_is_helix() const { return is_helix; }
87    const float *get_frequencies(unsigned char c) const { return frequency[c]; }
88
89    void create_selection_list(AW_window *aww);
90    void refresh_selection_list();
91
92    void print();
93};
94
95AW_window *COLSTAT_create_selection_window(AW_root *root, ColumnStat *column_stat);
96void       COLSTAT_create_selection_list(AW_window *aww, ColumnStat *column_stat);
97
98#else
99#error ColumnStat.hxx included twice
100#endif // COLUMNSTAT_HXX
Note: See TracBrowser for help on using the repository browser.