11
11
#ifndef AWTC_NEXT_NEIGHBOURS_HXX
12
12
#define AWTC_NEXT_NEIGHBOURS_HXX
19
class AWTC_FIND_FAMILY_MEMBER {
15
#include <arbdb_base.h>
20
#ifndef PT_GLOBAL_DEFS_H
21
#include <PT_global_defs.h>
24
#include <pos_range.h>
27
#define ff_assert(bed) arb_assert(bed)
29
class FamilyList : virtual Noncopyable {
20
30
// list is sorted either by 'matches' or 'rel_matches' (descending)
21
// depending on 'rel_matches' paramater to findFamily()
31
// depending on 'rel_matches' parameter to PT_FamilyFinder::searchFamily()
23
AWTC_FIND_FAMILY_MEMBER *next;
27
37
double rel_matches;
29
AWTC_FIND_FAMILY_MEMBER();
30
~AWTC_FIND_FAMILY_MEMBER();
33
struct struct_aisc_com;
38
FF_REVERSE_COMPLEMENT = 4,
41
// do NOT change the order here w/o fixing ../PROBE/PT_family.cxx@FF_complement_dep
44
class AWTC_FIND_FAMILY {
45
struct_aisc_com *link;
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);
56
// valid after calling retrieve_family():
57
AWTC_FIND_FAMILY_MEMBER *family_list;
39
FamilyList *insertSortedBy_matches(FamilyList *other);
40
FamilyList *insertSortedBy_rel_matches(FamilyList *other);
48
class FamilyFinder : virtual Noncopyable {
50
RelativeScoreScaling scaling;
53
FamilyList *family_list;
59
55
bool hits_truncated;
57
#if defined(WARN_TODO)
58
#warning change real_hits back to int when aisc_get() has been made failsafe
64
AWTC_FIND_FAMILY(GBDATA *gb_maini);
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);
69
const AWTC_FIND_FAMILY_MEMBER *getFamilyList() const { return family_list; }
65
FamilyFinder(bool rel_matches_, RelativeScoreScaling scaling_);
66
virtual ~FamilyFinder();
68
void restrict_2_region(const PosRange& range_) {
69
// Restrict oligo search to 'range_'
70
// Only oligos which are completely inside that region are used for calculating relationship.
71
// Has to be called before calling searchFamily.
75
void unrestrict() { range = PosRange(-1, -1); }
76
const PosRange& get_TargetRange() const { return range; }
78
virtual GB_ERROR searchFamily(const char *sequence, FF_complement compl_mode, int max_results, double min_score) = 0;
80
const FamilyList *getFamilyList() const { return family_list; }
81
void delete_family_list();
70
83
bool hits_were_truncated() const { return hits_truncated; }
84
bool uses_rel_matches() const { return rel_matches; }
85
RelativeScoreScaling get_scaling() const { return scaling; }
71
86
int getRealHits() const { return real_hits; }
89
class PT_FamilyFinder : public FamilyFinder { // derived from a Noncopyable
96
struct PT_FF_comImpl *ci;
98
GB_ERROR init_communication();
99
GB_ERROR open(const char *servername);
100
GB_ERROR retrieve_family(const char *sequence, FF_complement compl_mode, int max_results, double min_score) __ATTR__USERESULT;
105
PT_FamilyFinder(GBDATA *gb_main_, int server_id_, int oligo_len_, int mismatches_, bool fast_flag_, bool rel_matches_, RelativeScoreScaling scaling_);
106
~PT_FamilyFinder() OVERRIDE;
108
GB_ERROR searchFamily(const char *sequence, FF_complement compl_mode, int max_results, double min_score) OVERRIDE __ATTR__USERESULT;
110
const char *results2string();
76
113
// --------------------------------------------------------------------------------