51 #define ERROR_MESSAGE(s) ERR_POST(Error << "struct_dp_demo: " << s << '!')
52 #define INFO_MESSAGE(s) ERR_POST(Info << "struct_dp_demo: " << s)
60 int ch =
toupper((
unsigned char) original);
62 case 'A':
case 'R':
case 'N':
case 'D':
case 'C':
63 case 'Q':
case 'E':
case 'G':
case 'H':
case 'I':
64 case 'L':
case 'K':
case 'M':
case 'F':
case 'P':
65 case 'S':
case 'T':
case 'W':
case 'Y':
case 'V':
77 static bool unpacked =
false;
114 subject =
"PTVEYLNYEVVDDNGWDMYDDDVFGEASDMDLDDEDYGSLEVNEGEYILEAAEAQGYDWPFSC"
115 "RAGACANCAAIVLEGDIDMDMQQILSDEEVEDKNVRLTCIGSPDADEVKIVYNAKHLDYLQNRVI";
145 query =
"ASYQVRLINKKQDIDTTIEIDEETTILDGAEENGIELPFSCHSGSCSSCVGKVVEGEVDQSDQ"
146 "IFLDDEQMGKGFALLCVTYPRSNCTIKTHQEPYLA";
154 <<
" for " << alignment->
nBlocks <<
" blocks");
156 for (block=0; block<alignment->
nBlocks; block++) {
162 "Block " << (block + alignment->
firstBlock + 1) <<
", score "
164 <<
"S: " <<
subject.substr(subjectStart, blockSize)
165 <<
' ' << (subjectStart + 1) <<
'-' << (subjectStart + blockSize) <<
'\n'
166 <<
"Q: " <<
query.substr(queryStart, blockSize)
167 <<
' ' << (queryStart + 1) <<
'-' << (queryStart + blockSize)
192 int main(
int argc,
const char* argv[])
Include a standard set of the NCBI C++ Toolkit most basic headers.
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")
Set diagnostic stream.
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
@ eDiag_Info
Informational message.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
const SNCBIPackedScoreMatrix NCBISM_Blosum62
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...
unsigned int * blockPositions
unsigned int * blockPositions
unsigned int * blockSizes
int DP_LocalBlockAlign(const DP_BlockInfo *blocks, DP_BlockScoreFunction BlockScore, unsigned int queryFrom, unsigned int queryTo, DP_AlignmentResult **alignment)
void DP_DestroyBlockInfo(DP_BlockInfo *blocks)
#define STRUCT_DP_FOUND_ALIGNMENT
#define STRUCT_DP_PARAMETER_ERROR
#define STRUCT_DP_ALGORITHM_ERROR
static const int DP_NEGATIVE_INFINITY
#define STRUCT_DP_NO_ALIGNMENT
void DP_DestroyAlignmentResult(DP_AlignmentResult *alignment)
DP_BlockInfo * DP_CreateBlockInfo(unsigned int nBlocks)
static unsigned int ScreenResidueCharacter(char original)
static DP_BlockInfo * blocks
static int GetBLOSUM62Score(char a, char b)
int ScoreByBlosum62(unsigned int block, unsigned int queryPos)
int main(int argc, const char *argv[])