Changeset 7198

Show
Ignore:
Timestamp:
24/02/11 21:20:02 (15 months ago)
Author:
westram
Message:
  • fixed wrong probe position (see [7197])
Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/PROBE/PT_new_design.cxx

    r6813 r7198  
    192192        // count all mishits for a probe 
    193193        char *probe = psg.probe; 
    194         if (apos>psg.apos) psg.apos = apos; 
     194        psg.abs_pos.announce(apos); 
    195195        if (psg.data[name].is_group) return 0;              // don't count group or neverminds 
    196196        if (probe) { 
     
    218218        name = PT_read_name(psg.ptmain, pt); 
    219219        int apos = PT_read_apos(psg.ptmain, pt); 
    220         if (apos>psg.apos) psg.apos = apos; 
     220        psg.abs_pos.announce(apos); 
    221221        if (!psg.data[name].is_group)   return 1; 
    222222        return 0; 
     
    405405         tprobe = tprobe_next) { 
    406406        tprobe_next = tprobe->next; 
    407         psg.apos = 0; 
     407        psg.abs_pos.clear(); 
    408408        tprobe->mishit = ptnd_count_mishits(tprobe->sequence, psg.pt, 0); 
    409         tprobe->apos = psg.apos; 
     409        tprobe->apos = psg.abs_pos.get_most_used(); 
    410410        if (tprobe->mishit > pdc->mishit) { 
    411411            destroy_PT_tprobes(tprobe); 
    412412        } 
    413413    } 
     414    psg.abs_pos.clear(); 
    414415} 
    415416 
  • trunk/PROBE/probe.h

    r7190 r7198  
    161161class BI_ecoli_ref; 
    162162 
     163class MostUsedPos { 
     164    int pos; 
     165    int used; 
     166 
     167    MostUsedPos *next; 
     168 
     169    void swapWith(MostUsedPos *other) { 
     170        std::swap(pos, other->pos); 
     171        std::swap(used, other->used); 
     172    } 
     173 
     174public: 
     175    MostUsedPos() : pos(0), used(0), next(NULL) { } 
     176    MostUsedPos(int p) : pos(p), used(1), next(NULL) { } 
     177    ~MostUsedPos() { delete next; } 
     178 
     179    void clear() { 
     180        pos  = 0; 
     181        used = 0; 
     182        delete next; 
     183        next = NULL; 
     184    } 
     185 
     186    void announce(int p) { 
     187        if (p == pos) used++; 
     188        else { 
     189            if (next) next->announce(p); 
     190            else next = new MostUsedPos(p); 
     191            if (next->used>used) swapWith(next); 
     192        } 
     193    } 
     194 
     195 
     196    int get_most_used() const { return pos; } 
     197}; 
     198 
    163199extern struct probe_struct_global { 
    164200    GB_shell *gb_shell; 
     
    191227    int height; 
    192228    int length; 
    193     int apos; 
     229     
     230    MostUsedPos abs_pos; 
    194231 
    195232    int sort_by; 
  • trunk/TOOLS/arb_probe.cxx

    r7197 r7198  
    513513        "Min Group Hits       100%\n" 
    514514        "Target             le     apos ecol grps  G+C 4GC+2AT Probe sequence     | Decrease T by n*.3C -> probe matches n non group species\n" 
    515         "CGAAAGGAAGAUUAAUAC 18 A=   158  158    4 33.3 48.0    GUAUUAAUCUUCCUUUCG |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
    516         "GAAAGGAAGAUUAAUACC 18 A+     1  159    4 33.3 48.0    GGUAUUAAUCUUCCUUUC |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
     515        "CGAAAGGAAGAUUAAUAC 18 A=    93   93    4 33.3 48.0    GUAUUAAUCUUCCUUUCG |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
     516        "GAAAGGAAGAUUAAUACC 18 A+     1   94    4 33.3 48.0    GGUAUUAAUCUUCCUUUC |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
    517517        "UCAAGUCGAGCGAUGAAG 18 B=    17   17    4 50.0 54.0    CUUCAUCGCUCGACUUGA |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
    518518        "AUCAAGUCGAGCGAUGAA 18 B-     1   16    4 44.4 52.0    UUCAUCGCUCGACUUGAU |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  2,  3,\n"; 
  • trunk/TOOLS/arb_test.cxx

    r7197 r7198  
    300300                       "Min Group Hits       100%\n" 
    301301                       "Target             le     apos ecol grps  G+C 4GC+2AT Probe sequence     | Decrease T by n*.3C -> probe matches n non group species\n" 
    302                        "CGAAAGGAAGAUUAAUAC 18 A=   158  158    4 33.3 48.0    GUAUUAAUCUUCCUUUCG |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
    303                        "GAAAGGAAGAUUAAUACC 18 A+     1  159    4 33.3 48.0    GGUAUUAAUCUUCCUUUC |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
     302                       "CGAAAGGAAGAUUAAUAC 18 A=    93   93    4 33.3 48.0    GUAUUAAUCUUCCUUUCG |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
     303                       "GAAAGGAAGAUUAAUACC 18 A+     1   94    4 33.3 48.0    GGUAUUAAUCUUCCUUUC |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
    304304                       "UCAAGUCGAGCGAUGAAG 18 B=    17   17    4 50.0 54.0    CUUCAUCGCUCGACUUGA |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n" 
    305305                       "AUCAAGUCGAGCGAUGAA 18 B-     1   16    4 44.4 52.0    UUCAUCGCUCGACUUGAU |  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  2,  3,\n"