NCBI C++ ToolKit
Functions | Variables
raw_scoremat.c File Reference
#include <util/tables/raw_scoremat.h>
#include <ctype.h>
#include <string.h>
#include "sm_blosum45.c"
#include "sm_blosum50.c"
#include "sm_blosum62.c"
#include "sm_blosum80.c"
#include "sm_blosum90.c"
#include "sm_pam30.c"
#include "sm_pam70.c"
#include "sm_pam250.c"
#include "sm_identity.c"
+ Include dependency graph for raw_scoremat.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

int NCBISM_GetIndex (const SNCBIPackedScoreMatrix *sm, int aa)
 Map a standard residue code into an index suitable for a particular packed score matrix. More...
 
TNCBIScore NCBISM_GetScore (const SNCBIPackedScoreMatrix *sm, int aa1, int aa2)
 Look up an entry in a packed score matrix. More...
 
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 standard residue values (NCBIstdaa or case-insensitive NCBIeaa, which are conveniently disjoint) modulo gaps in coverage, for which the unpacked matrix will hold the packed one's default score. More...
 
static int s_NCBISM_StartsWith (const char *str, const char *pfx)
 
const SNCBIPackedScoreMatrixNCBISM_GetStandardMatrix (const char *name)
 

Variables

static const char kNCBIstdaa [] = "-ABCDEFGHIKLMNPQRSTVWXYZU*OJ"
 

Function Documentation

◆ NCBISM_GetIndex()

int NCBISM_GetIndex ( const SNCBIPackedScoreMatrix sm,
int  aa 
)

Map a standard residue code into an index suitable for a particular packed score matrix.

Calling this function is not as fast as working with unpacked matrices, but avoids the overhead of producing them.

Parameters
smPacked score matrix of interest.
aaStandard amino acid code; may be either NCBIstdaa or case-insensitive NCBIeaa (which are conveniently disjoint), modulo gaps in coverage. (The standard built-in matrices don't cover O or U.)
Returns
The corresponding index into sm, or -1 if it doesn't cover AA.

Definition at line 51 of file raw_scoremat.c.

References int, islower(), kNCBIstdaa, SNCBIPackedScoreMatrix::symbols, and toupper().

Referenced by NCBISM_GetScore().

◆ NCBISM_GetScore()

TNCBIScore NCBISM_GetScore ( const SNCBIPackedScoreMatrix sm,
int  aa1,
int  aa2 
)

Look up an entry in a packed score matrix.

Calling this function is not as fast as working with unpacked matrices, but avoids the overhead of producing them.

Parameters
smPacked score matrix of interest.
aa1,aa2Standard amino acid code; may be either NCBIstdaa or case-insensitive NCBIeaa (which are conveniently disjoint), modulo gaps in coverage. (The standard built-in matrices don't cover O or U.)
Returns
The corresponding score (or the matrix's default if it doesn't cover both residues).

Definition at line 67 of file raw_scoremat.c.

References SNCBIPackedScoreMatrix::defscore, NCBISM_GetIndex(), SNCBIPackedScoreMatrix::scores, and SNCBIPackedScoreMatrix::symbols.

Referenced by BlastScoreBlkProteinMatrixLoad(), BOOST_AUTO_TEST_CASE(), and CPssmInputTestData::FindNonIdenticalHighScoringResidue().

◆ NCBISM_GetStandardMatrix()

const SNCBIPackedScoreMatrix* NCBISM_GetStandardMatrix ( const char *  name)

◆ NCBISM_Unpack()

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 standard residue values (NCBIstdaa or case-insensitive NCBIeaa, which are conveniently disjoint) modulo gaps in coverage, for which the unpacked matrix will hold the packed one's default score.

(The standard built-in matrices don't cover O or U.)

Parameters
smPacked score matrix to expand.
fsmStorage for the resulting full score matrix.

Definition at line 81 of file raw_scoremat.c.

References SNCBIPackedScoreMatrix::defscore, i, int, kNCBIstdaa, NCBI_FSM_DIM, SNCBIFullScoreMatrix::s, SNCBIPackedScoreMatrix::scores, SNCBIPackedScoreMatrix::symbols, and toupper().

Referenced by CAlnVec::CalculateScore(), CGeneralScoreMatrix::CGeneralScoreMatrix(), CProteinAlignText::CProteinAlignText(), CSubstMatrix::CSubstMatrix(), CAlignFormatUtil::GetAsciiProteinMatrix(), GetBLOSUM62Score(), ScoreMatrix::initialize(), CNWAligner::SetScoreMatrix(), CQualityScoringMethodAA::SetSubstitutionMatrix(), CCmdLineBlastXML2ReportData::x_FillScoreMatrix(), and CCmdLineBlastXMLReportData::x_FillScoreMatrix().

◆ s_NCBISM_StartsWith()

static int s_NCBISM_StartsWith ( const char *  str,
const char *  pfx 
)
static

Definition at line 121 of file raw_scoremat.c.

References str(), and tolower().

Referenced by NCBISM_GetStandardMatrix().

Variable Documentation

◆ kNCBIstdaa

const char kNCBIstdaa[] = "-ABCDEFGHIKLMNPQRSTVWXYZU*OJ"
static

Definition at line 48 of file raw_scoremat.c.

Referenced by NCBISM_GetIndex(), and NCBISM_Unpack().

Modified on Fri Sep 20 14:57:55 2024 by modify_doxy.py rev. 669887