source: branches/tree/STAT/MostLikelySeq.hxx

Last change on this file was 16880, checked in by westram, 7 years ago
  • reintegrates 'multicore' into 'trunk'
    • derive sequence classes able to be combined from new class AP_combinableSeq
      • elim dummy functions from rest of hierarchy
    • implements non-writing combine for add-species (speedup: 25-35%)
    • introduce type Mutations ⇒ uses long everywhere (before mostly, but not always used float)
    • allows use of futures
      • nucleotide combine is able to calculate async (disabled via define atm → NEVER_COMBINE_ASYNC; needs more work on calling algorithm)
  • adds: log:branches/multicore@16769:16879
  • 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      : MostLikelySeq.hxx                                  //
4//   Purpose   :                                                    //
5//                                                                  //
6//   Institute of Microbiology (Technical University Munich)        //
7//   http://www.arb-home.de/                                        //
8//                                                                  //
9// ================================================================ //
10
11#ifndef MOSTLIKELYSEQ_HXX
12#define MOSTLIKELYSEQ_HXX
13
14#ifndef AP_SEQUENCE_HXX
15#include <AP_sequence.hxx>
16#endif
17#ifndef DOWNCAST_H
18#include <downcast.h>
19#endif
20
21extern class DNA_Table {
22    char char_to_enum_table[256];
23public:
24    DNA_Base char_to_enum(char i) {
25        return (DNA_Base)char_to_enum_table[(unsigned char)i];
26    }
27    DNA_Table();
28} dna_table;
29
30const size_t ST_MAX_SEQ_PART = 256;                 /* should be greater than the editor width (otherwise extrem performance penalties)
31                                                     * (Please note: this value has as well a small influence on the calculated results)
32                                                     */
33
34const int ST_BUCKET_SIZE = 16;                      // at minimum ST_BUCKET_SIZE characters are calculated per call
35const int LD_BUCKET_SIZE = 4;                       // log dualis of ST_BUCKET_SIZE
36
37class ST_ML;
38
39class MostLikelySeq : public AP_sequence { // derived from a Noncopyable
40    /*! contains existing sequence or ancestor sequence
41     * as max. likelihood vectors
42     */
43public:
44    static ST_base_vector *tmp_out;                 // len = alignment length (@@@ could be member of ST_ML ? )
45
46private:
47    ST_ML          *st_ml;                     // link to a global ST object (@@@ could be static)
48    ST_base_vector *sequence;                       // A part of the sequence
49    bool            up_to_date;
50public:
51    // @@@ move the 2 following members into one new class and put one pointer here
52    ST_ML_Color    *color_out;
53    int            *color_out_valid_till;           // color_out is valid up to
54
55private:
56    void set(const char *sequence) OVERRIDE;
57    void unset() OVERRIDE;
58
59public:
60
61    MostLikelySeq(const AliView *aliview, ST_ML *st_ml_);
62    ~MostLikelySeq() OVERRIDE;
63
64    bool is_up_to_date() const { return up_to_date; }
65
66    AP_sequence *dup() const OVERRIDE;
67
68    GB_ERROR bind_to_species(GBDATA *gb_species);
69    void     unbind_from_species(bool remove_callbacks);
70    GBDATA *get_bound_species_data() const { return AP_sequence::get_bound_species_data(); }
71
72    void sequence_change();                         // sequence has changed in db
73    void set_sequence();                            // start at st_ml->base
74
75    void calculate_ancestor(const MostLikelySeq *lefts, double leftl, const MostLikelySeq *rights, double rightl);
76    void forget_sequence() { up_to_date = false; }
77
78    void calc_out(const MostLikelySeq *sequence_of_brother, double dist);
79    void print();
80};
81
82
83#else
84#error MostLikelySeq.hxx included twice
85#endif // MOSTLIKELYSEQ_HXX
86
Note: See TracBrowser for help on using the repository browser.