source: branches/stable/SL/FAST_ALIGNER/fast_aligner.hxx

Last change on this file was 14476, checked in by westram, 8 years ago
  • AlignDataAccess:
    • use factory function (ensures proper initialization; was missing for SINA interface); removed global
    • use callback to get helix-string (only used in island_hopping; optional)
    • store alignment-name
    • add proper ctor, copy-ctor and op=
  • island_hopping
    • store helix-string as copy
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1// =========================================================== //
2//                                                             //
3//   File      : fast_aligner.hxx                              //
4//   Purpose   :                                               //
5//                                                             //
6//   Coded by Ralf Westram (coder@reallysoft.de) in 1998       //
7//   Institute of Microbiology (Technical University Munich)   //
8//   http://www.arb-home.de/                                   //
9//                                                             //
10// =========================================================== //
11
12#ifndef FAST_ALIGNER_HXX
13#define FAST_ALIGNER_HXX
14
15#ifndef AW_BASE_HXX
16#include <aw_base.hxx>
17#endif
18#ifndef ARB_ERROR_H
19#include <arb_error.h>
20#endif
21#ifndef POS_RANGE_H
22#include <pos_range.h>
23#endif
24#ifndef _GLIBCXX_STRING
25#include <string>
26#endif
27
28#define INTEGRATED_ALIGNERS_TITLE "Integrated Aligners"
29
30typedef char*   (*Aligner_get_consensus_func)(const char *species_name, PosRange range);
31typedef bool    (*Aligner_get_selected_range)(PosRange& range);
32typedef GBDATA* (*Aligner_get_first_selected_species)(int *total_no_of_selected_species);
33typedef GBDATA* (*Aligner_get_next_selected_species)(void);
34typedef char* (*Aligner_get_helix_string)(GBDATA *gb_main, const char *alignment_name); // returns heap-copy!
35
36struct AlignDataAccess {
37    GBDATA *gb_main;
38
39    std::string alignment_name;
40
41    bool do_refresh;                                // if do_refresh == true then FastAligner_start() does a refresh
42    void (*refresh_display)();                      // via calling refresh_display()
43
44    Aligner_get_consensus_func         get_group_consensus; // changed behavior in [8165]: returns only given range
45    Aligner_get_selected_range         get_selected_range;
46    Aligner_get_first_selected_species get_first_selected_species;
47    Aligner_get_next_selected_species  get_next_selected_species;
48    Aligner_get_helix_string           get_helix_string;
49
50    char *getHelixString() const { return get_helix_string(gb_main, alignment_name.c_str()); }
51
52    AlignDataAccess(GBDATA                             *gb_main_,
53                    const char                         *alignment_name_,
54                    bool                                do_refresh_,
55                    void                              (*refresh_display_)(),
56                    Aligner_get_consensus_func          get_group_consensus_,
57                    Aligner_get_selected_range          get_selected_range_,
58                    Aligner_get_first_selected_species  get_first_selected_species_,
59                    Aligner_get_next_selected_species   get_next_selected_species_,
60                    Aligner_get_helix_string            get_helix_string_)
61        : gb_main(gb_main_),
62          alignment_name(alignment_name_),
63          do_refresh(do_refresh_),
64          refresh_display(refresh_display_),
65          get_group_consensus(get_group_consensus_),
66          get_selected_range(get_selected_range_),
67          get_first_selected_species(get_first_selected_species_),
68          get_next_selected_species(get_next_selected_species_),
69          get_helix_string(get_helix_string_)
70    {}
71
72    AlignDataAccess(const AlignDataAccess& other)
73        : gb_main(other.gb_main),
74          alignment_name(other.alignment_name),
75          do_refresh(other.do_refresh),
76          refresh_display(other.refresh_display),
77          get_group_consensus(other.get_group_consensus),
78          get_selected_range(other.get_selected_range),
79          get_first_selected_species(other.get_first_selected_species),
80          get_next_selected_species(other.get_next_selected_species),
81          get_helix_string(other.get_helix_string)
82    {}
83
84    DECLARE_ASSIGNMENT_OPERATOR(AlignDataAccess);
85};
86
87// --------------------------------------------------------------------------------
88
89AW_window *FastAligner_create_window(AW_root *awr, const AlignDataAccess *data_access);
90
91void FastAligner_create_variables(AW_root *root, AW_default db1);
92void FastAligner_set_align_current(AW_root *root, AW_default db1);
93void FastAligner_set_reference_species(AW_root *root);
94
95void      FastAligner_start(AW_window *aw, const AlignDataAccess *data_access);
96ARB_ERROR FastAligner_delete_temp_entries(GBDATA *gb_main, const char *alignment);
97
98// --------------------------------------------------------------------------------
99
100#else
101#error fast_aligner.hxx included twice
102#endif // FAST_ALIGNER_HXX
Note: See TracBrowser for help on using the repository browser.