// aligra.cpp - Graphical Image of a Multi-Alignment - 06.06.2001 // // Image size variables : //#define _IMAGE_DEFAULT_WIDTH 640 #define _IMAGE_DEFAULT_WIDTH 800 #define _IMAGE_DEFAULT_HEIGHT 480 //#define _IMAGE_MIN_WIDTH 320 //#define _IMAGE_MIN_HEIGHT 240 #define _IMAGE_MIN_WIDTH 450 //#define _IMAGE_MIN_HEIGHT 150 #define _IMAGE_MIN_HEIGHT 200 //#define _IMAGE_MAX_WIDTH 2000 //#define _IMAGE_MAX_HEIGHT 1500 #define _IMAGE_MAX_WIDTH 3000 #define _IMAGE_MAX_HEIGHT 10000 #define _IMAGE_DEFAULT_HEIGHT_DY 16 #define _IMAGE_MIN_HEIGHT_DY 5 // ------------------------- a few debug flags #define _GETCH //getch() //#define _TEST //#define _TRACE //#define _TRACE_ALIGN //#define _INTERNAL_NODES // ------------------------------------- MSVC vs G++ #ifdef _MSC_VER #define _MICROSOFT_ //+#include // included in calling .cpp // Linux's g++ #else #define CTRFLAG_USE_SGI_STL #define __UNIX__ #define __ON_PC__ #define __LINUX__ // ? #define _LINUX_ #endif // --------------------- Some constants #define _ALIGN_BUFFER_LENGTH 1028 #define _OPTIONS_STR_LEN 101 /** #define EZERO 0 #define SLASH PATH_SEPARATOR #ifndef __ON_PC__ #define M_SQRT2 1.41421356237309504880 #endif #define STR_LEN 81 #define GAP '-' #define GAP_STR "-" #define A_HOMOLOGY 16 #define A_BACKGROUND 32 #define A_COLOR 15 **/ // for graphic: #define _PI_ 3.14159 // ---------------------------------------------- // Alex // for cout #include // for getch() #ifdef _MSC_VER #include #endif #include #include #include #include // STL #include //#include #include #include //#include //#include #include using namespace std; // WM from dhm.cpp to compute column weights // // ------------------- __NEW logic (like swap logic) added to // swap - to get around that guy in #define __NEW #define swap /** #include "inv_sqrt.h" #include "const.h" #include "work_seq.h" #include "dothelix.h" #include "seqbase.h" #include "w_matrix.h" #include "seqbase.cpp" #include "inv_sqrt.cpp" #include "motif.cpp" **/ #include "seqbase.cpp" #include "params.cpp" // --------------------- //#include "w_matrix_pos.h" /** typedef struct off_de { char ty; // type: g - gap, 0(zero) - no delta, d - delta, e - end // ?? R - moved right, L - moved left (instead of delta) - ***NO NEED int ddx; // delta; (is a Key abs(ddx) for the 2nd map ) int x1; // starting from 0 (is a Key for the 1st map) int x2; // end pos // int dir; // 1 - +, -1 - off_de() : ty(' '), ddx(0) {} off_de( char c, int d = 0 ) : ty(c), ddx(d) {} } OffsetDescr; **/ // Alex /* typedef vector< int, alloc > vIntDef; typedef vector< string, alloc > vAliDef; typedef vector< string, alloc > vSNamesDef; typedef vector< string, alloc > vGroupDef; typedef vector< int, alloc > vColGroupDef; typedef vector< double, alloc > vGroupValueDef; typedef vector< int, alloc > vSelGroupDef; */ typedef vector< int > vIntDef; typedef vector< string > vAliDef; typedef vector< string > vSNamesDef; typedef vector< string > vGroupDef; typedef vector< int > vColGroupDef; typedef vector< double > vGroupValueDef; typedef vector< int > vSelGroupDef; //typedef vector< map< int, OffsetDescr, less< int >, alloc >, alloc > vOffsDef; //typedef map< int, off_de, less< int >, alloc > mOffDef; //typedef map< string, int, less< string >, alloc > mSNamesDef; //typedef vector< int, alloc > vRefDef; static char *image_tail[] = { "a", "m", "se", "3", "4", "5", "6", "7", "8", "9", "10", "s1", "s2", "13","14","15","16","17","18","19","20","sc1", "sc2", }; typedef struct prog_options { //string image_pref; int iW ; // width. Default 640 int iH ; // height. Defaulu 480 // Alex // vector< int, alloc > vType; // 0 - std, 1 - max in col, 2 - selected gr, 3 - most gr, 4 - least gr vector< int > vType; // 0 - std, 1 - max in col, 2 - selected gr, 3 - most gr, 4 - least gr // 11 - stat vSelGroupDef vSel; int fillType; // 0 -full (unweighted), 6 - weighted middle, 7 - very wei middle string image_pref; string title; string algo; string sMatrixName; // matrix file name string sGroupFile; // color group file name string sErrFile; // molType err, ... int splitBlockSize; // -1 - n/a, 0 - auto, 50, 60, 80, 100, 150 ... 500 //prog_options( ) : iW(_IMAGE_DEFAULT_WIDTH), iH(_IMAGE_DEFAULT_HEIGHT), title(""), //Graphical Image of Alignment"), // 0 - AUTO height prog_options( ) : iW(_IMAGE_DEFAULT_WIDTH), iH(0), title(""), //Graphical Image of Alignment"), algo(""), image_pref( "gali" ), fillType(0), //sMatrixName("blosum62.matrix"), sGroupFile("color.def"), splitBlockSize(-1) sMatrixName(""), sGroupFile(""), splitBlockSize(-1), sErrFile( "errors.txt" ) {} } ProgOptions; typedef struct image_options { //string image_pref; int iW ; // width. Default 640 int iH ; // height. Default 480 int dX1 ; // left space; used by internal funcs int dX2 ; // right space int dY1 ; // top space int dY2 ; // bottom space int gapColor ; // color index //int unpairColor ; // color index int type ; // 0 -std, 1 - max in col, 2 - selected gr, 3 - most gr, 4 - least gr // 11 - stat, 12 - best-to-worst, 22 - b-to-w comparison (simulate) int fillType ; // 0 - full (unweighted), 6 - weighted middle, 7 - very wei middle int WLwidth; int WLtype; // 0 - bottom, 1 - inside; 2 - top (reseeved) double WeightLineMax; // for weighted filling double Weight; // double WeightLineScaleMax; // for col values (incl. comparison picture) // i.e. max of two aligns max for comp.pic. // and otherwise eq. WeightLineMax. // Set inside AligraImage(). vColGroupDef *pColGroup; vColGroupDef *pColGroup2; // for type = 21/22 - used from alicomp.cpp vGroupValueDef *pGroupValue; vSelGroupDef *pSelGroup; int splitBlockSize; // -1 - n/a, 0 - auto, 50, 60, 80, 100, 150 ... 500 image_options( ) : iW(640), iH(480), type(0), fillType(0) {} //image_options( ProgOptions& cfg) : iW(cfg.iW), iH(cfg.iH), type(cfg.vType[0]), image_options( ProgOptions& cfg) : iW(cfg.iW), iH(cfg.iH), pSelGroup( &cfg.vSel ), WLwidth(10), WLtype(0), fillType(cfg.fillType), splitBlockSize(cfg.splitBlockSize) {} } ImageOptions; typedef struct alignment { vSNamesDef *pSNames; // Names of align seqs //vOffsDef *pOffs; vAliDef *pAli; // Aligns w gaps vAliDef *pAli2; // Aligns w gaps - for comp pic (type=22) //+string *pWeightLine; // input WL *NIK rejected //+string *pWLlegends; // input WL *NIK rejected double *WeightLineSums; // [] ; computed w matrix double WeightLineMax; // double *WeightLineSums2; // for comparison picture (type = 22) double WeightLineMax2; // int WeightLineLen2; // length maybe not eq to the 1st WL; // Maybe set less/greater/equal. vGroupDef *pGroup; // Group letters vGroupValueDef *pGroupValue; // reserved (computed and not used so far) vColGroupDef *pColGroup; // Dominant groups at columns alignment() // : pWeightLine(0), pWLlegends(0) {} } Align; //#include #include #include // ------------------------------------------------------------------ /***** int ChoosParam( char par, char *LetPar, int *IntPar ) { int num = strlen( LetPar ); char Par = toupper( par ); for( int i = 0; i < num; i++ ) { if( Par == LetPar[ i ] ) return IntPar[ i ]; } // ******** THERE IS DEFAULT VALUE *********** return IntPar[ 0 ]; } *****/ int ReadProgOptions( ProgOptions& cfg, char *file_name ) { char *cEndPos; char buf[ _OPTIONS_STR_LEN ]; FILE *f = fopen( file_name, "rt" ); if( !f ) return 1; while( fgets( buf, _OPTIONS_STR_LEN, f ) ) { // from 1 to the first != ' ' //+cout << buf ; if( strlen( buf ) < 2 ) continue; // <---------------- char *par = buf + 2 + strspn( buf + 2, " " ); switch( buf[1] ) { // First symbol is "-" /*** case 'h': cfg.homology_only = ChoosParam( *par, LetParHom, IntParHom ); break; case 'n': cfg.Naway = ( toupper( *par ) == 'Y' ) ? 1 : 0; break; case 'l': cfg.log_scale = ChoosParam( *par, LetParSca, IntParSca ); break; case 'a': cfg.algorithm = ChoosParam( *par, LetParAlg, IntParAlg ); break; case 'f': cfg.from = atoi( par ); break; case 't': cfg.to = atoi( par ); break; case 'g': cfg.gap_penalty = atoi( par ); break; // Tree Format to Output case 'o': if( strncmp( par, "PHYLIP", 5 ) == 0 ) { tf.PHYLIP = 1; } else if( strncmp( par, "PHYLMULTI", 5 ) == 0 ) { tf.PHYLMULTI = 1; } else if( strncmp( par, "NEXUS", 5 ) == 0 ) { tf.NEXUS = 1; } else if( strncmp( par, "NEXTREE", 5 ) == 0 ) { tf.NEXTREE = 1; } else if( strncmp( par, "HENNIG", 5 ) == 0 ) { tf.HENNIG = 1; } cout << " - Tree Format: " << par; // << endl; break; case 'i': cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; cfg.image_pref = par; // string cout << " - Image Pref: " << cfg.image_pref << endl; break; // ************** Changed by VNik ************* 02.05.2001 // -u - removed (?) case 'C': if( strncmp( par, "Disable", 7 ) == 0 || strncmp( par, "DISABLE", 7 ) == 0 ) { cfg.unroot_disable = 1; cout << " - " << par+1 << endl; } cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; sMM_Factor[0] = par; // string cout << " - Cluster Maxmin Factor: " << sMM_Factor[0] << endl; break; case 'T': if( strncmp( par, "Disable", 7 ) == 0 || strncmp( par, "DISABLE", 7 ) == 0 ) { cfg.unroot_disable = 1; cout << " - " << par+1 << endl; } cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; sMM_Factor[1] = par; cout << " - Topo Maxmin Factor: " << sMM_Factor[1] << endl; break; // ******************* Restoring -u : case 'u': if( strncmp( par, "Disable", 7 ) == 0 || strncmp( par, "DISABLE", 7 ) == 0 ) { //tf.UNROOT_DISABLE = 1; cfg.unroot_disable = 1; cout << " - " << par+1 << endl; break; // *** inserted } cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; if( strncmp( par, "Cluster Maxmin Factor ", 22 ) == 0 ) { sMM_Factor[0] = par + 21 + strspn( par + 21, " " ); // string //cout << " - " << par << endl; cout << " - Cluster Maxmin Factor " << sMM_Factor[0] << endl; } if( strncmp( par, "Topo Maxmin Factor ", 19 ) == 0 ) { sMM_Factor[1] = par + 18 + strspn( par + 18, " " ); //cout << " - " << par << endl; cout << " - Topo Maxmin Factor " << sMM_Factor[1] << endl; } break; // ****************************** end of -u ***/ case 'W': cfg.iW = atoi( par ); if( cfg.iW < _IMAGE_MIN_WIDTH ) { // Check limits cfg.iW = _IMAGE_MIN_WIDTH; } if( cfg.iW > _IMAGE_MAX_WIDTH ) { cfg.iW = _IMAGE_MAX_WIDTH; } cout << " - Image Width: " << cfg.iW << endl; break; case 'H': cfg.iH = atoi( par ); //if( cfg.iH < _IMAGE_MIN_HEIGHT ) { // Check limits // cfg.iH = _IMAGE_MIN_HEIGHT; //} if( cfg.iH > _IMAGE_MAX_HEIGHT ) { cfg.iH = _IMAGE_MAX_HEIGHT; } cout << " - Image Height: " << cfg.iH << endl; break; case 'S': cfg.splitBlockSize = atoi( par ); cout << " - Split BlSize: " << cfg.splitBlockSize << endl; break; case 'i': cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; cfg.image_pref = par; // string cout << " - Image Pref: " << cfg.image_pref << endl; break; case 'm': cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; cfg.sMatrixName = par; // string cout << " - Matrix File: " << cfg.sMatrixName << endl; break; case 'g': cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; cfg.sGroupFile = par; // string cout << " - Group File: " << cfg.sGroupFile << endl; break; case 'E': cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; cfg.sErrFile = par; // string cout << " - Error File: " << cfg.sErrFile << endl; break; case 't': // type //cfg.type = atoi( par ); int ty; ty = atoi( par ); (cfg.vType).push_back(ty); cout << " - Image Type: " << ty << endl; break; case 'f': // type cfg.fillType = atoi( par ); cout << " - Filling Type: " << cfg.fillType << endl; break; case 's': // Selected groups //cfg.type = atoi( par ); int iSel; iSel = atoi( par ); (cfg.vSel).push_back(iSel); cout << " - Sel. Group: " << iSel << endl; break; case 'T': // title cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; cfg.title = par; cout << " - Image Title: " << cfg.title << endl; break; case 'A': // title cEndPos = strpbrk( par, "\n\r" ); if( cEndPos != 0 ) *cEndPos = '\0'; cfg.algo = par; cout << " - Algorithm: " << cfg.algo << endl; break; } } cout << "----------------------------------------------" << endl << endl; if( (cfg.vSel).size() > 0 ) (cfg.vType).push_back( 2 ); // add type "sel groups" return 0; } long f_strCount( string& s, char c ) { long i, iL = s.length(), cou = 0; for( i = 0; i < iL; ++i ) { if( s[i] == c ) ++cou; } return cou; } /*** // confirm input WL *** NIK rejected - 15.06.2001 void f_confWL( string& sWL1, string& sWLleg1 ) { #define _SW_LEGEND_GENEBEE " .+*" #define _SW_LEGEND_CLUSTAL " .:*" long iCou[5], iTotal = 0; // 0 - blanl, 1 - point, 2 - :, 3 - + , 4 - * iCou[0] = f_strCount( sWL1, ' ' ); iTotal = iCou[0]; iCou[1] = f_strCount( sWL1, '.' ); iTotal += iCou[1]; iCou[2] = f_strCount( sWL1, ':' ); iTotal += iCou[2]; iCou[3] = f_strCount( sWL1, '+' ); iTotal += iCou[3]; iCou[4] = f_strCount( sWL1, '*' ); iTotal += iCou[4]; cout << " -- Count: iTotal = " << iTotal << "(" << iTotal - iCou[0] << "), len = " << sWL1.length() << endl; // OK: not only blanks and enough others if( iCou[0] < iTotal && iTotal * 2 > sWL1.length() ) { if( iCou[3] > 0 ) sWLleg1 = _SW_LEGEND_GENEBEE; else if( iCou[2] > 0 ) sWLleg1 = _SW_LEGEND_CLUSTAL; else sWLleg1 = _SW_LEGEND_GENEBEE; cout << " - WL confirmed" << endl; // NOT confirmed: } else { sWL1 = ""; sWLleg1 = ""; cout << " * WL NOT confirmed" << endl; } } ***/ int main( int argc, char** argv ) { if( argc < 3 ) { printf( "Graphical Image of Alignment\n " ); printf( "USAGE: aligra.exe optName alignName \n" ); printf( " optName - fileName of alignment options\n" ); printf( " alignName - fileName of input alignment\n" ); return 1; } // ***************** Update parameters ***************** ProgOptions cfg; if( ReadProgOptions( cfg, argv[ 1 ] ) ) { cout << "\n Can't read params file: " << argv[ 1 ] << endl; return 1; } //cout << " -- Prog opt are gotten" << endl; ImageOptions image_cfg( cfg ); //cout << " -- Im opt are gotten" << endl; vAliDef vAli1, vAli2; //, vSeq1, vSeq2; vSNamesDef vSNames, vSNames1; //, vSNames2; int i, j=0, iP=0; /** // tst *************************************************************** char *sTit = "L-lactate dehydrogenase sequences"; char *sTit5n = "Sample from Tree Help"; char *sAlgo1 = "GeneBee"; **/ //char *sAlgo2 = "ClustalW"; Align oAli, oAli1, oAli2; string sWL, sWLleg, sWL1, sWLleg1; //, sWL2, sWLleg2; FILE *afile = fopen( argv[ 2 ], "rt" ); if( !afile ) { cout << "\n Can't open align file " << argv[ 2 ] << endl; return 2; } f_getAlign( afile, vSNames1, vAli1, sWL1 ); //cout << " -- Align is gotten" << endl; // Confirm WL's & type of symbol set //++f_confWL( sWL1, sWLleg1 ); // *NIK rejected * 15.06.2001 //char *matrName = "blosum62.matrix"; //"blos.wmt"; int nSeq = vAli1.size(); if( nSeq == 0 ) { cout << "*** Alignment file " << argv[ 2 ] << " is empty." << endl; return 3; } int iSeqLen = (vAli1[0]).length(); double *sum = new double[ iSeqLen ]; double *sum2 = new double[ iSeqLen ]; // to simulate comp picture // Group letters vGroupDef aG; //(10); //+f_getColorGroups( cfg.sGroupFile, aG ); int molType = f_getMolType( vAli1 ); f_getColorGroups( cfg.sGroupFile, aG, molType ); // matrix file - AUTO if( cfg.sMatrixName == "" ) { cfg.sMatrixName = "blosum62.matrix"; if( molType == 1 ) cfg.sMatrixName = "dnarna.matrix"; } // Check out molType & matrix consistency: FILE *fErr; string sMT_ERR = ""; if( molType == 1 && cfg.sMatrixName != string("dnarna.matrix") ) { sMT_ERR = "The sequences are found to be nucleotide. The matrix \"" + string( cfg.sMatrixName ) + "\" is protein.\nResult may be inconsistent."; } else if ( molType != 1 && cfg.sMatrixName == "dnarna.matrix" ) { sMT_ERR = "The sequences are found to be protein. The matrix \"" + string( cfg.sMatrixName ) + "\" is nucleotide.\nResult may be inconsistent."; } if( !sMT_ERR.empty() ) { fErr = fopen( (cfg.sErrFile).c_str(), "wt" ); fprintf( fErr, "%s\n", sMT_ERR.c_str() ); fclose( fErr ); // ? } //+oAli1.WeightLineMax = sum_max; //oAli1.WeightLineMax = f_setWeights( vAli1, "blosum62.matrix", sum ); oAli1.WeightLineMax = f_setWeights( vAli1, (cfg.sMatrixName).c_str(), sum ); oAli1.WeightLineSums = sum; if( oAli1.WeightLineMax < 0 ) return 4; // -------------------------> // matrix ? //+getch(); // Simulate comparison picture (type = 21/2 ) // ------------------------- // Note. Only w/o splitting. // ------------------------- oAli1.WeightLineMax2 = oAli1.WeightLineMax * 1.1; oAli1.WeightLineLen2 = iSeqLen; // really maybe another *** ??? //+if( find( (cfg.vType).begin(), (cfg.vType).end(), 22 ) != (cfg.vType).end() ) { if( f_findType( cfg.vType, 21 ) || f_findType( cfg.vType, 22 ) ) { for( i = 0; i < iSeqLen; ++i ) { sum2[i] = sum[i]; if( i % 4 == 0 ) sum2[i] *= 0.9; if( i % 8 == 0 ) sum2[i] *= 1.08; } // Form 2nd align vAli2 = vAli1; for( i = 0; i < iSeqLen; ++i ) { if( (i % 9) > 0 ) continue; string& sAli = vAli2[0]; sAli[i] = 'A'; } } oAli1.WeightLineSums2 = sum2; //cout << " -- Sums are gotten" << endl; // --------------------------------------------------------- /** vGroupDef aG(10); // *tst aG[0] = "AG"; //"GAHDP"; aG[1] = "C"; //"ILMN"; aG[2] = "DENQBZ"; //"WFY"; BZ aG[3] = "ILMV"; //"KR"; aG[4] = "FWY"; //"S"; aG[5] = "H"; //"V"; aG[6] = "KR"; //"Q"; aG[7] = "P"; //"T"; aG[8] = "ST"; //"C"; aG[9] = "JU"; //"E"; **/ /** aG.push_back( "AGCDENQBZ" ); //"GAHDP"; aG.push_back( "ILMVFWYH" ); //"ILMN"; aG.push_back( "JU" ); //"E"; **/ vColGroupDef vColGroup( vAli1[0].size(), -1 ); vGroupValueDef vGroupValue( aG.size(),0.); // for simulation of 21/22 vColGroupDef vColGroup2( vAli1[0].size(), -1 ); vGroupValueDef vGroupValue2( aG.size(),0.); //vSelGroupDef vSelGroup(2); // *** See cfg.vSel //vSelGroup[0] = 0; //vSelGroup[1] = 3; cout << endl << "*** Groups: " << endl; for( i = 0; i < aG.size(); ++i ) { cout << " - " << i << ". " << aG[i] << endl; } //cout << " - found V: " << f_findGroup( 'V', aG ) << endl; //getch(); // Max group of columns and distribution of groups in entire align. f_statGroup( vAli1, aG, vColGroup, vGroupValue ); _GETCH; if( f_findType( cfg.vType, 21 ) || f_findType( cfg.vType, 22 ) ) { f_statGroup( vAli2, aG, vColGroup2, vGroupValue2 ); } cout << endl << "*** Group values: " << endl; for( i = 0; i < vGroupValue.size(); ++i ) { cout << " - " << i << ". " << vGroupValue[i] << endl; } #ifdef _TRACE cout << endl << "*** Column max (first 10): " << endl; for( i = 0; i < 10; ++i ) { cout << " - " << i << ". " << vColGroup[i] << endl; } #endif //_GETCH; //+oAli1.pWeightLine = &sWL1; //*NIK rejected //+oAli1.pWLlegends = &sWLleg1; oAli1.pSNames = &vSNames1; //oAli1.pOffs = &vOffs1; oAli1.pAli = &vAli1; oAli1.pAli2 = &vAli2; // used only for comparison picture (simulate 21/22) oAli1.pGroup = &aG; image_cfg.pColGroup = &vColGroup; image_cfg.pColGroup2 = &vColGroup2; // to simulate 21/22 image_cfg.pGroupValue = &vGroupValue; // percent //+image_cfg.pSelGroup = &vSelGroup; //image_cfg.type = 0; //11; //1; // 0 -std, 1 - max in col, 2 - selected gr; // ??:3 - most gr, // 4 - least gr // 11 - stat funcs, 21, 22 - comparison //image_cfg.iH = 300; //250; // 150; 180; //300; // 200 // 600 //AligraImage( oAli1, image_cfg, "gla11.png", sTit, sAlgo1 ); //AligraImage( oAli1, image_cfg, "gla7c.png", sTit, sAlgo1 ); if( (cfg.vType).empty() ) { cout << "*** Force type std (0)" << endl; (cfg.vType).push_back( 0 ); } image_cfg.WLwidth = 16; //20; image_cfg.WLtype = 0; // 0 - bottom, 1 - inside image_cfg.WeightLineMax = oAli1.WeightLineMax; // Auto height bool bAutoHei = false; long iDefHei = 26 + 16 + 2 + 22 + nSeq * _IMAGE_DEFAULT_HEIGHT_DY + 8 + 16 + 16 + image_cfg.WLwidth + 12; if( image_cfg.iH <= 0 ) bAutoHei = true; // Min Height DY long iMinHei = 26 + 16 + 2 + 22 + nSeq * _IMAGE_MIN_HEIGHT_DY + 8 + 16 + 16 + image_cfg.WLwidth + 12; // Split adjust int splitN, splitSpace; if( image_cfg.splitBlockSize > 0 ) { splitN = iSeqLen / image_cfg.splitBlockSize; if( (iSeqLen % image_cfg.splitBlockSize ) > 0 ) ++splitN; splitSpace = 16+16+22; if( nSeq < 6 ) // *** 22.08.2001 splitSpace += 20; // GL space if( splitN > 1 ) { iDefHei += (splitN - 1) * ( (nSeq * _IMAGE_DEFAULT_HEIGHT_DY) + splitSpace ); iMinHei += (splitN - 1) * ( (nSeq * _IMAGE_MIN_HEIGHT_DY) + splitSpace ); } } if( iDefHei < _IMAGE_MIN_HEIGHT ) iDefHei = _IMAGE_MIN_HEIGHT; if( iMinHei < _IMAGE_MIN_HEIGHT ) iMinHei = _IMAGE_MIN_HEIGHT; //- Save iH parm //-int iH0 = image_cfg.iH, iH1, iH2; //- Set iH1, iH2 //-iH1 = iH2 = iH0; if( bAutoHei ) image_cfg.iH = iDefHei; else if( image_cfg.iH < iMinHei ) image_cfg.iH = iMinHei; for( i = 0; i < (cfg.vType).size(); ++i ) { _GETCH; int ty = cfg.vType[i]; if( ty < 0 || ty > 22 ) //12 ) // > 11 continue; // <-------------- erroneous type image_cfg.type = ty; AligraImage( oAli1, image_cfg, (cfg.image_pref+string(image_tail[image_cfg.type]) +string(".png")).c_str(), (cfg.title).c_str(), (cfg.algo).c_str() ); } //image_cfg.iH = 200; //AligraImage( oAli1, image_cfg, "gftree11.png", sTit5n, sAlgo1 ); //, sAlgo2 ); // **/ return 0; }