#include "mltaln.h" #define DEBUG 0 char *alignmentfile; static void fillorichar( int nseq, int *oripos, char **a, char **s ) { int i; char *pta, *pts; for( i=0; i 0 && (*++argv)[0] == '-' ) { while ( (c = *++argv[0]) ) { switch( c ) { case 'i': inputfile = *++argv; --argc; goto nextoption; case 'a': alignmentfile = *++argv; --argc; goto nextoption; default: fprintf( stderr, "illegal option %c\n", c ); argc = 0; break; } } nextoption: ; } if( argc != 0 ) { fprintf( stderr, "options: Check source file !\n" ); exit( 1 ); } } int main( int argc, char *argv[] ) { FILE *infp; FILE *alfp; char **name; char **aname; char **oname; char **seq; char **aseq; int *nlen; int *oripos; char *npt, *npt2; int i, o, prelen; int nlenmin; int njobs, njoba; arguments( argc, argv ); if( inputfile ) { infp = fopen( inputfile, "r" ); if( !infp ) { fprintf( stderr, "Cannot open %s\n", inputfile ); exit( 1 ); } } else infp = stdin; if( alignmentfile ) { alfp = fopen( alignmentfile, "r" ); if( !alfp ) { fprintf( stderr, "Cannot open %s\n", alignmentfile ); exit( 1 ); } } else { fprintf( stderr, "No alignment is given.\n" ); exit( 1 ); } dorp = NOTSPECIFIED; getnumlen_casepreserve( infp, &nlenmin ); njobs = njob; // fprintf( stderr, "in infp, %d x %d - %d %c\n", njob, nlenmin, nlenmax, dorp ); seq = AllocateCharMtx( njob, nlenmax+1 ); name = AllocateCharMtx( njob, B+1 ); nlen = AllocateIntVec( njob ); oripos = AllocateIntVec( njob ); readData_pointer_casepreserve( infp, name, nlen, seq ); dorp = NOTSPECIFIED; getnumlen( alfp ); njoba = njob; // fprintf( stderr, "in alfp, %d x %d %c\n", njob, nlenmax, dorp ); aseq = AllocateCharMtx( njob, nlenmax+1 ); aname = AllocateCharMtx( njob, B+1 ); oname = AllocateCharMtx( njob, B+1 ); readData_pointer( alfp, aname, nlen, aseq ); for( i=0; i