~ubuntu-branches/debian/jessie/arb/jessie

« back to all changes in this revision

Viewing changes to AWTC/awtc_next_neighbours.hxx

  • Committer: Package Import Robot
  • Author(s): Elmar Pruesse, Andreas Tille, Elmar Pruesse
  • Date: 2014-09-02 15:15:06 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140902151506-jihq58b3iz342wif
Tags: 6.0.2-1
[ Andreas Tille ]
* New upstream version
  Closes: #741890
* debian/upstream -> debian/upstream/metadata
* debian/control:
   - Build-Depends: added libglib2.0-dev
   - Depends: added mafft, mrbayes
* debian/rules
   - Add explicite --remove-section=.comment option to manual strip call
* cme fix dpkg-control
* arb-common.dirs: Do not create unneeded lintian dir
* Add turkish debconf translation (thanks for the patch to Mert Dirik
  <mertdirik@gmail.com>)
  Closes: #757497

[ Elmar Pruesse ]
* patches removed:
   - 10_config.makefiles.patch,
     80_no_GL.patch
       removed in favor of creating file from config.makefile.template via 
       sed in debian/control
   - 20_Makefile_main.patch
       merged upstream
   - 21_Makefiles.patch
       no longer needed
   - 30_tmpfile_CVE-2008-5378.patch: 
       merged upstream
   - 50_fix_gcc-4.8.patch:
       merged upstream
   - 40_add_libGLU.patch:
       libGLU not needed for arb_ntree)
   - 60_use_debian_packaged_raxml.patch:
       merged upstream
   - 70_hardening.patch
       merged upstream
   - 72_add_math_lib_to_linker.patch
       does not appear to be needed
* patches added:
   - 10_upstream_r12793__show_db_load_progress:
       backported patch showing progress while ARB is loading a database
       (needed as indicator/splash screen while ARB is launching)
   - 20_upstream_r12794__socket_permissions:
       backported security fix
   - 30_upstream_r12814__desktop_keywords:
       backported add keywords to desktop (fixes lintian warning)
   - 40_upstream_r12815__lintian_spelling:
       backported fix for lintian reported spelling errors
   - 50_private_nameservers
       change configuration to put nameservers into users home dirs
       (avoids need for shared writeable directory)
   - 60_use_debian_phyml
       use phyml from debian package for both interfaces in ARB
* debian/rules:
   - create config.makefile from override_dh_configure target
   - use "make tarfile" in override_dh_install
   - remove extra cleaning not needed for ARB 6
   - use "dh_install --list-missing" to avoid missing files
   - added override_dh_fixperms target
* debian/control:
   - added libarb-dev package
   - Depends: added phyml, xdg-utils
   - Suggests: removed phyml
   - fix lintian duplicate-short-description (new descriptions)
* debian/*.install:
   - "unrolled" confusing globbing to select files
   - pick files from debian/tmp
   - moved all config files to /etc/arb
* debian/arb-common.templates: updated
* scripts:
   - removed arb-add-pt-server
   - launch-wrapper: 
     - only add demo.arb to newly created $ARBUSERDATA
     - pass commandline arguments through bin/arb wrapper
   - preinst: removing old PT server index files on upgrade from 5.5*
   - postinst: set setgid on shared PT dir
* rewrote arb.1 manfile
* added file icon for ARB databases
* using upstream arb_tcp.dat

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#ifndef AWTC_NEXT_NEIGHBOURS_HXX
12
12
#define AWTC_NEXT_NEIGHBOURS_HXX
13
13
 
14
 
#ifndef ARBDB_H
15
 
#include <arbdb.h>
16
 
#endif
17
 
 
18
 
 
19
 
class AWTC_FIND_FAMILY_MEMBER {
 
14
#ifndef ARBDB_BASE_H
 
15
#include <arbdb_base.h>
 
16
#endif
 
17
#ifndef ARBTOOLS_H
 
18
#include <arbtools.h>
 
19
#endif
 
20
#ifndef PT_GLOBAL_DEFS_H
 
21
#include <PT_global_defs.h>
 
22
#endif
 
23
#ifndef POS_RANGE_H
 
24
#include <pos_range.h>
 
25
#endif
 
26
 
 
27
#define ff_assert(bed) arb_assert(bed)
 
28
 
 
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()
22
32
public:
23
 
    AWTC_FIND_FAMILY_MEMBER *next;
 
33
    FamilyList *next;
24
34
 
25
35
    char   *name;
26
36
    long    matches;
27
37
    double  rel_matches;
28
38
 
29
 
    AWTC_FIND_FAMILY_MEMBER();
30
 
    ~AWTC_FIND_FAMILY_MEMBER();
31
 
};
32
 
 
33
 
struct struct_aisc_com;
34
 
 
35
 
enum 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
 
 
44
 
class 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;
 
39
    FamilyList *insertSortedBy_matches(FamilyList *other);
 
40
    FamilyList *insertSortedBy_rel_matches(FamilyList *other);
 
41
 
 
42
    FamilyList();
 
43
    ~FamilyList();
 
44
};
 
45
 
 
46
struct aisc_com;
 
47
 
 
48
class FamilyFinder : virtual Noncopyable {
 
49
    bool                 rel_matches;
 
50
    RelativeScoreScaling scaling;
 
51
 
 
52
protected:
 
53
    FamilyList *family_list;
58
54
 
59
55
    bool hits_truncated;
60
 
    int  real_hits;
 
56
 
 
57
#if defined(WARN_TODO)
 
58
#warning change real_hits back to int when aisc_get() has been made failsafe
 
59
#endif 
 
60
    long real_hits;
 
61
 
 
62
    PosRange range;
61
63
 
62
64
public:
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; }
 
65
    FamilyFinder(bool rel_matches_, RelativeScoreScaling scaling_);
 
66
    virtual ~FamilyFinder();
 
67
 
 
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.
 
72
        range = range_;
 
73
    }
 
74
 
 
75
    void unrestrict() { range = PosRange(-1, -1); }
 
76
    const PosRange& get_TargetRange() const { return range; }
 
77
 
 
78
    virtual GB_ERROR searchFamily(const char *sequence, FF_complement compl_mode, int max_results, double min_score) = 0;
 
79
 
 
80
    const FamilyList *getFamilyList() const { return family_list; }
 
81
    void delete_family_list();
 
82
 
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; }
72
 
 
73
 
    void print();
 
87
};
 
88
 
 
89
class PT_FamilyFinder : public FamilyFinder { // derived from a Noncopyable
 
90
    GBDATA *gb_main;
 
91
    int     server_id;
 
92
    int     oligo_len;
 
93
    int     mismatches;
 
94
    bool    fast_flag;
 
95
 
 
96
    struct PT_FF_comImpl *ci;
 
97
 
 
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;
 
101
    void     close();
 
102
 
 
103
public:
 
104
 
 
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;
 
107
 
 
108
    GB_ERROR searchFamily(const char *sequence, FF_complement compl_mode, int max_results, double min_score) OVERRIDE __ATTR__USERESULT;
 
109
 
 
110
    const char *results2string();
74
111
};
75
112
 
76
113
// --------------------------------------------------------------------------------
81
118
#define AWAR_NN_MISMATCHES  AWAR_NN_BASE "mismatches"
82
119
#define AWAR_NN_FAST_MODE   AWAR_NN_BASE "fast_mode"
83
120
#define AWAR_NN_REL_MATCHES AWAR_NN_BASE "rel_matches"
 
121
#define AWAR_NN_REL_SCALING AWAR_NN_BASE "scaling"
84
122
 
85
123
class AW_root;
86
124
class AW_window;