source: branches/port5/AWTC/awtc_next_neighbours.hxx

Last change on this file was 6127, checked in by westram, 16 years ago
  • added some comment-pointers about code-dependencies
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : awtc_next_neighbours.hxx                          //
4//   Purpose   : Search relatives via PT server                    //
5//                                                                 //
6//   Institute of Microbiology (Technical University Munich)       //
7//   http://www.arb-home.de/                                       //
8//                                                                 //
9// =============================================================== //
10
11#ifndef AWTC_NEXT_NEIGHBOURS_HXX
12#define AWTC_NEXT_NEIGHBOURS_HXX
13
14#ifndef ARBDB_H
15#include <arbdb.h>
16#endif
17
18
19class AWTC_FIND_FAMILY_MEMBER {
20    // list is sorted either by 'matches' or 'rel_matches' (descending)
21    // depending on 'rel_matches' paramater to findFamily()
22public:
23    AWTC_FIND_FAMILY_MEMBER *next;
24
25    char   *name;
26    long    matches;
27    double  rel_matches;
28
29    AWTC_FIND_FAMILY_MEMBER();
30    ~AWTC_FIND_FAMILY_MEMBER();
31};
32
33struct struct_aisc_com;
34
35enum FF_complement {
36    FF_FORWARD            = 1,
37    FF_REVERSE            = 2,
38    FF_REVERSE_COMPLEMENT = 4,
39    FF_COMPLEMENT         = 8,
40   
41    // do NOT change the order here w/o fixing ../PROBE/PT_family.cxx@FF_complement_dep
42};
43
44class AWTC_FIND_FAMILY {
45    struct_aisc_com *link;
46    GBDATA          *gb_main;
47    long             com;
48    long             locs;
49   
50    void     delete_family_list();
51    GB_ERROR init_communication(void);
52    GB_ERROR open(char *servername);
53    GB_ERROR retrieve_family(char *sequence, int oligo_len, int mismatches, bool fast_flag, bool rel_matches, FF_complement compl_mode, int max_results);
54    void     close();
55
56    // valid after calling retrieve_family():
57    AWTC_FIND_FAMILY_MEMBER *family_list;
58
59    bool hits_truncated;
60    int  real_hits;
61
62public:
63
64    AWTC_FIND_FAMILY(GBDATA *gb_maini);
65    ~AWTC_FIND_FAMILY();
66
67    GB_ERROR findFamily(int server_id,char *sequence, int oligo_len, int mismatches, bool fast_flag, bool rel_matches, FF_complement compl_mode, int max_results);
68
69    const AWTC_FIND_FAMILY_MEMBER *getFamilyList() const { return family_list; }
70    bool hits_were_truncated() const { return hits_truncated; }
71    int getRealHits() const { return real_hits; }
72
73    void print();
74};
75
76// --------------------------------------------------------------------------------
77
78#define AWAR_NN_BASE "next_neighbours/"
79
80#define AWAR_NN_OLIGO_LEN   AWAR_NN_BASE "oligo_len"
81#define AWAR_NN_MISMATCHES  AWAR_NN_BASE "mismatches"
82#define AWAR_NN_FAST_MODE   AWAR_NN_BASE "fast_mode"
83#define AWAR_NN_REL_MATCHES AWAR_NN_BASE "rel_matches"
84
85class AW_root;
86class AW_window;
87
88void AWTC_create_common_next_neighbour_vars(AW_root *aw_root);
89void AWTC_create_common_next_neighbour_fields(AW_window *aws);
90
91#else
92#error awtc_next_neighbours.hxx included twice
93#endif // AWTC_NEXT_NEIGHBOURS_HXX
Note: See TracBrowser for help on using the repository browser.