NCBI C++ ToolKit
cuScoringMatrix.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: cuScoringMatrix.cpp 33815 2007-05-04 17:18:18Z kazimird $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Authors: Chris Lanczycki (w/ some code from Paul Thiessen's conservation_colorer)
27 *
28 * File Description:
29 * Header to define alignment scoring matrices and their parameters,
30 * and the class to encapsulate them. Uses C++ toolkit to access
31 * centrally defined scoring matrices.
32 *
33 * ===========================================================================
34 */
35 
36 #include <ncbi_pch.hpp>
38 
40 BEGIN_SCOPE(cd_utils)
41 
43 
44  string name;
45  switch (type) {
46  case eBlosum45:
47  name = BLOSUM45NAME;
48  break;
49  case eBlosum62:
50  name = BLOSUM62NAME;
51  break;
52  case eBlosum80:
53  name = BLOSUM80NAME;
54  break;
55  case ePam30:
56  name = PAM30NAME;
57  break;
58  case ePam70:
59  name = PAM70NAME;
60  break;
61  case ePam250:
62  name = PAM250NAME;
63  break;
64  case eInvalidMatrixType:
65  default:
66  name = INVALIDNAME;
67  break;
68  }
69  return name;
70 }
71 
73 
75 }
76 
78 
80 
81  m_type = type;
82  switch (m_type) {
83 
84  case eBlosum45:
85  matrix = NCBISM_Blosum45;
86  break;
87  case eBlosum62:
88  matrix = NCBISM_Blosum62;
89  break;
90  case eBlosum80:
91  matrix = NCBISM_Blosum80;
92  break;
93  case ePam30:
94  matrix = NCBISM_Pam30;
95  break;
96  case ePam70:
97  matrix = NCBISM_Pam70;
98  break;
99  case ePam250:
100  matrix = NCBISM_Pam250;
101  break;
102  case eInvalidMatrixType:
103  default:
105  m_alphabet = NULL;
106  return;
107  break;
108  }
109 
111  if (type != eInvalidMatrixType) {
112  m_alphabet = matrix.symbols;
113  m_numLetters = strlen(m_alphabet);
114  NCBISM_Unpack(&matrix, &m_scoreMatrix);
115  }
116 
117 }
118 
119 END_SCOPE(cd_utils)
SNCBIFullScoreMatrix m_scoreMatrix
void initialize(EScoreMatrixType type)
const char * m_alphabet
EScoreMatrixType m_type
ScoreMatrix(EScoreMatrixType type)
string GetScoringMatrixName(EScoreMatrixType type)
#define BLOSUM45NAME
#define INVALIDSIZE
#define PAM30NAME
EScoreMatrixType
@ ePam70
@ ePam250
@ eBlosum80
@ eBlosum62
@ ePam30
@ eBlosum45
@ eInvalidMatrixType
#define BLOSUM62NAME
#define BLOSUM80NAME
#define INVALIDNAME
#define PAM70NAME
#define PAM250NAME
static int type
Definition: getdata.c:31
string
Definition: cgiapp.hpp:690
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
const SNCBIPackedScoreMatrix NCBISM_Pam30
Definition: sm_pam30.c:92
const SNCBIPackedScoreMatrix NCBISM_Blosum62
Definition: sm_blosum62.c:92
const SNCBIPackedScoreMatrix NCBISM_Pam250
Definition: sm_pam250.c:92
const SNCBIPackedScoreMatrix NCBISM_Blosum80
Definition: sm_blosum80.c:92
void NCBISM_Unpack(const SNCBIPackedScoreMatrix *psm, SNCBIFullScoreMatrix *fsm)
Expand a packed score matrix into an unpacked one, which callers can proceed to index directly by sta...
Definition: raw_scoremat.c:81
const SNCBIPackedScoreMatrix NCBISM_Pam70
Definition: sm_pam70.c:92
const SNCBIPackedScoreMatrix NCBISM_Blosum45
The standard matrices.
Definition: sm_blosum45.c:92
const char * symbols
order of residues
Definition: raw_scoremat.h:47
Definition: type.c:6
Modified on Fri Sep 20 14:57:28 2024 by modify_doxy.py rev. 669887