ARB
Macros | Typedefs | Functions | Variables
ClustalV.cxx File Reference
#include "ClustalV.hxx"
#include "seq_search.hxx"
#include <cctype>
#include <climits>
Include dependency graph for ClustalV.cxx:

Go to the source code of this file.

Macros

#define MASTER_GAP_OPEN   50
 
#define CHEAP_GAP_OPEN   20
 
#define DEFAULT_GAP_OPEN   30
 
#define MASTER_GAP_EXTEND   18
 
#define CHEAP_GAP_EXTEND   5
 
#define DEFAULT_GAP_EXTEND   10
 
#define DEFAULT_IMPROBABLY_MUTATION   10
 
#define DEFAULT_PROBABLY_MUTATION   4
 
#define DYNAMIC_PENALTIES
 
#define MAX_GAP_OPEN_DISCOUNT   (DEFAULT_GAP_OPEN-CHEAP_GAP_OPEN)
 
#define MAX_GAP_EXTEND_DISCOUNT   (DEFAULT_GAP_EXTEND-CHEAP_GAP_EXTEND)
 
#define MAXN   2
 
#define MAX_BASETYPES   21
 
#define IF_MATRIX_DUMP(xxx)
 
#define UNKNOWN_ACID   255
 
#define NUCLEIDS   16
 
#define cheap_if(cond)   ((cond) ? 1 : 2)
 
#define COMPARABLE_BASES   5
 
#define AF   0
 
#define MHO   1
 
#define BO   1
 

Typedefs

typedef int Boolean
 

Functions

int master_gap_open (int beforePosition)
 
int master_gap_extend (int beforePosition)
 
int master_gapAtWithOpenPenalty (int atPosition, int length, int penalty)
 
int master_gapAt (int atPosition, int length)
 
int slave_gap_open (int)
 
int slave_gap_extend (int)
 
int slave_gapAtWithOpenPenalty (int atPosition, int length, int penalty)
 
int slave_gapAt (int atPosition, int length)
 
static int baseCmp (unsigned char c1, unsigned char c2)
 
int baseMatch (char c1, char c2)
 
static int getPenalty (char c1, char c2)
 
ARB_ERROR MAXLENtooSmall ()
 
void * ckalloc (size_t bytes, ARB_ERROR &error)
 
static ARB_ERROR init_myers (long max_seq_length)
 
static void make_pamo (int nv)
 
static void fill_pam ()
 
static void exit_myers ()
 
static ARB_ERROR init_show_pair (long max_seq_length)
 
static void exit_show_pair ()
 
int set_displ (int offset, int value)
 
int decr_displ (int offset, int value)
 
void add (int v)
 
int calc_weight (int iat, int jat, int v1, int v2)
 
static int diff (int v1, int v2, int v3, int v4, int st, int en)
 
static void do_align (int &score, long act_seq_length)
 
static int add_ggaps (long)
 
static int res_index (const char *t, char c)
 
static void p_encode (const unsigned char *seq, unsigned char *naseq, int l)
 
static void n_encode (const unsigned char *seq, unsigned char *naseq, int l)
 
ARB_ERROR ClustalV_align (int is_dna, int weighted, const char *seq1, int length1, const char *seq2, int length2, const int *gapsBefore1, int max_seq_length, const char *&res1, const char *&res2, int &reslen, int &score)
 
void ClustalV_exit ()
 

Variables

static bool module_initialized = false
 
static Boolean dnaflag
 
static Boolean is_weight
 
static int xover
 
static int little_pam
 
static int big_pam
 
static int pamo [(MAX_BASETYPES-1)*MAX_BASETYPES/2]
 
static int pam [MAX_BASETYPES][MAX_BASETYPES]
 
static int pos1
 
static int pos2
 
static int ** naa1
 
static int ** naa2
 
static int ** naas
 
static int seqlen_array [MAXN+1]
 
static unsigned charseq_array [MAXN+1]
 
static int group [MAXN+1]
 
static int alist [MAXN+1]
 
static int fst_list [MAXN+1]
 
static int snd_list [MAXN+1]
 
static int nseqs
 
static int weights [MAX_BASETYPES][MAX_BASETYPES]
 
static size_t displ_size = 0
 
static intdispl
 
static intzza
 
static intzzb
 
static intzzc
 
static intzzd
 
static int print_ptr
 
static int last_print
 
static const intgaps_before_position
 
static const charamino_acid_order = "XCSTPAGNDEQHRKMILVFYW"
 
static const charnucleic_acid_order = "-ACGTUMRWSYKVHDBN"
 
static const charnucleic_maybe_A = "-A----AAA---AAA-A"
 
static const charnucleic_maybe_C = "--C---C--CC-CC-CC"
 
static const charnucleic_maybe_G = "---G---G-G-GG-GGG"
 
static const charnucleic_maybe_T = "----T---T-TT-TTTT"
 
static const charnucleic_maybe_U = "-----U--U-UU-UUUU"
 
static const charnucleic_maybe [6] = { NULp, nucleic_maybe_A, nucleic_maybe_C, nucleic_maybe_G, nucleic_maybe_T, nucleic_maybe_U }
 
static charresult [3]
 
static char pam250mt []
 
static charmatptr = pam250mt
 

Macro Definition Documentation

#define MASTER_GAP_OPEN   50

Definition at line 21 of file ClustalV.cxx.

Referenced by master_gap_open().

#define CHEAP_GAP_OPEN   20

Definition at line 22 of file ClustalV.cxx.

#define DEFAULT_GAP_OPEN   30

Definition at line 24 of file ClustalV.cxx.

Referenced by master_gap_open(), and slave_gap_open().

#define MASTER_GAP_EXTEND   18

Definition at line 26 of file ClustalV.cxx.

Referenced by master_gap_extend().

#define CHEAP_GAP_EXTEND   5

Definition at line 27 of file ClustalV.cxx.

#define DEFAULT_GAP_EXTEND   10

Definition at line 29 of file ClustalV.cxx.

Referenced by master_gap_extend(), and slave_gap_extend().

#define DEFAULT_IMPROBABLY_MUTATION   10

Definition at line 31 of file ClustalV.cxx.

Referenced by getPenalty().

#define DEFAULT_PROBABLY_MUTATION   4

Definition at line 32 of file ClustalV.cxx.

Referenced by getPenalty().

#define DYNAMIC_PENALTIES

Definition at line 34 of file ClustalV.cxx.

#define MAX_GAP_OPEN_DISCOUNT   (DEFAULT_GAP_OPEN-CHEAP_GAP_OPEN)

Definition at line 38 of file ClustalV.cxx.

Referenced by master_gap_open().

#define MAX_GAP_EXTEND_DISCOUNT   (DEFAULT_GAP_EXTEND-CHEAP_GAP_EXTEND)

Definition at line 39 of file ClustalV.cxx.

Referenced by master_gap_extend().

#define MAXN   2

Definition at line 41 of file ClustalV.cxx.

#define MAX_BASETYPES   21

Definition at line 50 of file ClustalV.cxx.

Referenced by do_align(), exit_myers(), fill_pam(), and init_myers().

#define IF_MATRIX_DUMP (   xxx)

Definition at line 103 of file ClustalV.cxx.

Referenced by diff().

#define UNKNOWN_ACID   255

Definition at line 175 of file ClustalV.cxx.

Referenced by res_index().

#define NUCLEIDS   16

Definition at line 178 of file ClustalV.cxx.

Referenced by fill_pam().

#define cheap_if (   cond)    ((cond) ? 1 : 2)

Definition at line 193 of file ClustalV.cxx.

Referenced by baseCmp().

#define COMPARABLE_BASES   5

Referenced by baseCmp().

#define AF   0

Referenced by diff().

#define MHO   1

Referenced by diff().

#define BO   1

Referenced by diff().

Typedef Documentation

typedef int Boolean

Definition at line 45 of file ClustalV.cxx.

Function Documentation

int master_gap_open ( int  beforePosition)
inline

Definition at line 106 of file ClustalV.cxx.

References DEFAULT_GAP_OPEN, MASTER_GAP_OPEN, and MAX_GAP_OPEN_DISCOUNT.

Referenced by diff(), do_align(), and master_gapAt().

int master_gap_extend ( int  beforePosition)
inline

Definition at line 119 of file ClustalV.cxx.

References DEFAULT_GAP_EXTEND, MASTER_GAP_EXTEND, and MAX_GAP_EXTEND_DISCOUNT.

Referenced by diff(), and master_gapAtWithOpenPenalty().

int master_gapAtWithOpenPenalty ( int  atPosition,
int  length,
int  penalty 
)
inline

Definition at line 132 of file ClustalV.cxx.

References master_gap_extend().

Referenced by master_gapAt().

int master_gapAt ( int  atPosition,
int  length 
)
inline

Definition at line 155 of file ClustalV.cxx.

References master_gap_open(), and master_gapAtWithOpenPenalty().

Referenced by diff().

int slave_gap_open ( int  )
inline

Definition at line 159 of file ClustalV.cxx.

References DEFAULT_GAP_OPEN.

Referenced by diff(), and slave_gapAt().

int slave_gap_extend ( int  )
inline

Definition at line 163 of file ClustalV.cxx.

References DEFAULT_GAP_EXTEND.

Referenced by diff(), and slave_gapAtWithOpenPenalty().

int slave_gapAtWithOpenPenalty ( int  atPosition,
int  length,
int  penalty 
)
inline

Definition at line 167 of file ClustalV.cxx.

References slave_gap_extend().

Referenced by diff(), and slave_gapAt().

int slave_gapAt ( int  atPosition,
int  length 
)
inline

Definition at line 171 of file ClustalV.cxx.

References slave_gap_open(), and slave_gapAtWithOpenPenalty().

Referenced by diff().

static int baseCmp ( unsigned char  c1,
unsigned char  c2 
)
static

Definition at line 194 of file ClustalV.cxx.

References cheap_if, COMPARABLE_BASES, fa_assert(), and FALLTHROUGH.

Referenced by baseMatch(), and getPenalty().

int baseMatch ( char  c1,
char  c2 
)

Definition at line 249 of file ClustalV.cxx.

References baseCmp(), and fa_assert().

Referenced by relatedBases().

static int getPenalty ( char  c1,
char  c2 
)
static

Definition at line 266 of file ClustalV.cxx.

References baseCmp(), DEFAULT_IMPROBABLY_MUTATION, and DEFAULT_PROBABLY_MUTATION.

Referenced by fill_pam().

ARB_ERROR MAXLENtooSmall ( )
inline

Definition at line 324 of file ClustalV.cxx.

void* ckalloc ( size_t  bytes,
ARB_ERROR error 
)
inline

Definition at line 328 of file ClustalV.cxx.

References NULp.

Referenced by ClustalV_align(), init_myers(), and init_show_pair().

static ARB_ERROR init_myers ( long  max_seq_length)
static

Definition at line 337 of file ClustalV.cxx.

References ckalloc(), error(), and MAX_BASETYPES.

Referenced by ClustalV_align().

static void make_pamo ( int  nv)
static

Definition at line 352 of file ClustalV.cxx.

References little_pam, and pamo.

Referenced by ClustalV_align().

static void fill_pam ( )
static

Definition at line 371 of file ClustalV.cxx.

References getPenalty(), MAX_BASETYPES, NUCLEIDS, pamo, and xover.

Referenced by ClustalV_align().

static void exit_myers ( )
static

Definition at line 408 of file ClustalV.cxx.

References MAX_BASETYPES.

Referenced by ClustalV_exit().

static ARB_ERROR init_show_pair ( long  max_seq_length)
static

Definition at line 419 of file ClustalV.cxx.

References ckalloc(), displ_size, and error().

Referenced by ClustalV_align().

static void exit_show_pair ( )
static

Definition at line 438 of file ClustalV.cxx.

References displ_size.

Referenced by ClustalV_exit().

int set_displ ( int  offset,
int  value 
)
inline

Definition at line 449 of file ClustalV.cxx.

References displ_size, fa_assert(), and offset.

Referenced by add(), and diff().

int decr_displ ( int  offset,
int  value 
)
inline

Definition at line 454 of file ClustalV.cxx.

References displ_size, fa_assert(), and offset.

Referenced by diff().

void add ( int  v)
inline
int calc_weight ( int  iat,
int  jat,
int  v1,
int  v2 
)
inline

Definition at line 472 of file ClustalV.cxx.

References fa_assert(), and seq_array.

Referenced by diff().

static int diff ( int  v1,
int  v2,
int  v3,
int  v4,
int  st,
int  en 
)
static
static void do_align ( int score,
long  act_seq_length 
)
static

Definition at line 807 of file ClustalV.cxx.

References diff(), fa_assert(), master_gap_open(), MAX_BASETYPES, nseqs, pos1, pos2, and seq_array.

Referenced by ClustalV_align().

static int add_ggaps ( long  )
static

Definition at line 877 of file ClustalV.cxx.

References print_ptr.

Referenced by ClustalV_align().

static int res_index ( const char t,
char  c 
)
static

Definition at line 915 of file ClustalV.cxx.

References UNKNOWN_ACID.

Referenced by n_encode(), and p_encode().

static void p_encode ( const unsigned char seq,
unsigned char naseq,
int  l 
)
static

Definition at line 923 of file ClustalV.cxx.

References aw_message(), fa_assert(), and res_index().

Referenced by ClustalV_align().

static void n_encode ( const unsigned char seq,
unsigned char naseq,
int  l 
)
static

Definition at line 950 of file ClustalV.cxx.

References aw_message(), fa_assert(), and res_index().

Referenced by ClustalV_align().

ARB_ERROR ClustalV_align ( int  is_dna,
int  weighted,
const char seq1,
int  length1,
const char seq2,
int  length2,
const int gapsBefore1,
int  max_seq_length,
const char *&  res1,
const char *&  res2,
int reslen,
int score 
)
void ClustalV_exit ( )

Definition at line 1049 of file ClustalV.cxx.

References exit_myers(), exit_show_pair(), module_initialized, and seq_array.

Referenced by Aligner::run().

Variable Documentation

bool module_initialized = false
static

Definition at line 43 of file ClustalV.cxx.

Referenced by ClustalV_align(), and ClustalV_exit().

Boolean dnaflag
static

Definition at line 47 of file ClustalV.cxx.

Boolean is_weight
static

Definition at line 48 of file ClustalV.cxx.

int xover
static

Definition at line 52 of file ClustalV.cxx.

Referenced by fill_pam().

int little_pam
static

Definition at line 53 of file ClustalV.cxx.

Referenced by make_pamo().

int big_pam
static

Definition at line 54 of file ClustalV.cxx.

int pamo[(MAX_BASETYPES-1)*MAX_BASETYPES/2]
static

Definition at line 55 of file ClustalV.cxx.

Referenced by fill_pam(), and make_pamo().

Definition at line 56 of file ClustalV.cxx.

int pos1
static
int pos2
static
int** naa1
static

Definition at line 60 of file ClustalV.cxx.

int** naa2
static

Definition at line 61 of file ClustalV.cxx.

int** naas
static

Definition at line 62 of file ClustalV.cxx.

int seqlen_array[MAXN+1]
static

Definition at line 63 of file ClustalV.cxx.

unsigned char* seq_array[MAXN+1]
static

Definition at line 64 of file ClustalV.cxx.

Referenced by calc_weight(), ClustalV_align(), ClustalV_exit(), diff(), and do_align().

int group[MAXN+1]
static
int alist[MAXN+1]
static

Definition at line 66 of file ClustalV.cxx.

int fst_list[MAXN+1]
static

Definition at line 67 of file ClustalV.cxx.

int snd_list[MAXN+1]
static

Definition at line 68 of file ClustalV.cxx.

int nseqs
static

Definition at line 70 of file ClustalV.cxx.

Referenced by do_align().

int weights[MAX_BASETYPES][MAX_BASETYPES]
static
size_t displ_size = 0
static

Definition at line 74 of file ClustalV.cxx.

Referenced by decr_displ(), exit_show_pair(), init_show_pair(), and set_displ().

int* displ
static

Definition at line 77 of file ClustalV.cxx.

int* zza
static

Definition at line 78 of file ClustalV.cxx.

int* zzb
static

Definition at line 79 of file ClustalV.cxx.

int* zzc
static

Definition at line 80 of file ClustalV.cxx.

int* zzd
static

Definition at line 81 of file ClustalV.cxx.

int print_ptr
static

Definition at line 82 of file ClustalV.cxx.

Referenced by add_ggaps().

int last_print
static

Definition at line 83 of file ClustalV.cxx.

const int* gaps_before_position
static

Definition at line 85 of file ClustalV.cxx.

const char* amino_acid_order = "XCSTPAGNDEQHRKMILVFYW"
static

Definition at line 176 of file ClustalV.cxx.

const char* nucleic_acid_order = "-ACGTUMRWSYKVHDBN"
static

Definition at line 179 of file ClustalV.cxx.

const char* nucleic_maybe_A = "-A----AAA---AAA-A"
static

Definition at line 180 of file ClustalV.cxx.

const char* nucleic_maybe_C = "--C---C--CC-CC-CC"
static

Definition at line 181 of file ClustalV.cxx.

const char* nucleic_maybe_G = "---G---G-G-GG-GGG"
static

Definition at line 182 of file ClustalV.cxx.

const char* nucleic_maybe_T = "----T---T-TT-TTTT"
static

Definition at line 183 of file ClustalV.cxx.

const char* nucleic_maybe_U = "-----U--U-UU-UUUU"
static

Definition at line 184 of file ClustalV.cxx.

Definition at line 185 of file ClustalV.cxx.

char* result[3]
static

Definition at line 277 of file ClustalV.cxx.

char pam250mt[]
static
Initial value:
= {
12,
0, 2,
-2, 1, 3,
-3, 1, 0, 6,
-2, 1, 1, 1, 2,
-3, 1, 0, -1, 1, 5,
-4, 1, 0, -1, 0, 0, 2,
-5, 0, 0, -1, 0, 1, 2, 4,
-5, 0, 0, -1, 0, 0, 1, 3, 4,
-5, -1, -1, 0, 0, -1, 1, 2, 2, 4,
-3, -1, -1, 0, -1, -2, 2, 1, 1, 3, 6,
-4, 0, -1, 0, -2, -3, 0, -1, -1, 1, 2, 6,
-5, 0, 0, -1, -1, -2, 1, 0, 0, 1, 0, 3, 5,
-5, -2, -1, -2, -1, -3, -2, -3, -2, -1, -2, 0, 0, 6,
-2, -1, 0, -2, -1, -3, -2, -2, -2, -2, -2, -2, -2, 2, 5,
-6, -3, -2, -3, -2, -4, -3, -4, -3, -2, -2, -3, -3, 4, 2, 6,
-2, -1, 0, -1, 0, -1, -2, -2, -2, -2, -2, -2, -2, 2, 4, 2, 4,
-4, -3, -3, -5, -4, -5, -4, -6, -5, -5, -2, -4, -5, 0, 1, 2, -1, 9,
0, -3, -3, -5, -3, -5, -2, -4, -4, -4, 0, -4, -4, -2, -1, -1, -2, 7, 10,
-8, -2, -5, -6, -6, -7, -4, -7, -7, -5, -3, 2, -3, -4, -5, -2, -6, 0, 0, 17
}

Definition at line 279 of file ClustalV.cxx.

char* matptr = pam250mt
static

Definition at line 302 of file ClustalV.cxx.