source: tags/ms_r16q2/TEMPLATES/arb_defs.h

Last change on this file was 7272, checked in by westram, 13 years ago

merged from dev [7244] [7250] [7251] [7252] [7253] [7254] [7255] [7257] [7258] [7259] [7260] [7261] [7271]

  • extracted conversion logic of absolute ↔ relative position into BasePosition
    • refactored BI_ecoli_ref and ED4_base_position (using BasePosition)
    • corrected input range of abs_2_rel ([0..N-1] → [0..N])
  • clean up chaos caused by different semantics of positions (biological[1..N] vs informational[0..N-1])
    • commented (hopefully) all AWARs and variables which use biological positions
    • made semantic changes explicit by using bio2info() and info2bio()
  • positions passed to/reported by PTserver are now biological positions. Affects
    • probe design (absolute position, ecoli range restriction)
    • probe match (absolute position, ecoli position (bugfix see below)).
    • ProbeMatchParser does not change semantics
  • fix several bugs
    • ED4_jump_to_cursor_position limited position to screen before converting from relative to absolute position
    • SEC_root::paintEcoliPositions added 1 to relative pos (instead of including position at cursor)
    • ecoli position in probe match/PTserver (did not include ecoli-base at match position)
    • ecoli range restriction in probe design/PTserver (check was broken, see [7261])
    • base position for consensus terminals
File size: 1.4 KB
Line 
1// ================================================================= //
2//                                                                   //
3//   File      : arb_defs.h                                          //
4//   Purpose   : global defines and mini inlines                     //
5//                                                                   //
6//   Coded by Ralf Westram (coder@reallysoft.de) in September 2010   //
7//   Institute of Microbiology (Technical University Munich)         //
8//   http://www.arb-home.de/                                         //
9//                                                                   //
10// ================================================================= //
11
12#ifndef ARB_DEFS_H
13#define ARB_DEFS_H
14
15#ifndef ARB_ASSERT_H
16#include <arb_assert.h>
17#endif
18
19#define ARRAY_ELEMS(array)            (sizeof(array)/sizeof(array[0]))
20#define TERMINATED_ARRAY_ELEMS(array) (ARRAY_ELEMS(array)-1)
21
22// Internally ARB shall use position [0..N-1] for calculations.
23// Only while showing positions to the user, we use [1..N] (as well in displayed AWARs).
24// Please use the following functions to make the conversion explicit:
25
26inline int bio2info(int biopos) { arb_assert(biopos >= 1); return biopos-1; }
27inline int info2bio(int infopos) { arb_assert(infopos >= 0); return infopos+1; }
28
29
30#else
31#error arb_defs.h included twice
32#endif // ARB_DEFS_H
Note: See TracBrowser for help on using the repository browser.