Mercurial > repos > nick > duplex
comparison mafft/core/seq2regtable.c @ 18:e4d75f9efb90 draft
planemo upload commit b'4303231da9e48b2719b4429a29b72421d24310f4\n'-dirty
| author | nick |
|---|---|
| date | Thu, 02 Feb 2017 18:44:31 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 17:836fa4fe9494 | 18:e4d75f9efb90 |
|---|---|
| 1 #include "mltaln.h" | |
| 2 | |
| 3 #define DEBUG 0 | |
| 4 | |
| 5 char *weboutfile = NULL; | |
| 6 | |
| 7 | |
| 8 void arguments( int argc, char *argv[] ) | |
| 9 { | |
| 10 int c; | |
| 11 | |
| 12 while( --argc > 0 && (*++argv)[0] == '-' ) | |
| 13 { | |
| 14 while ( (c = *++argv[0]) ) | |
| 15 { | |
| 16 switch( c ) | |
| 17 { | |
| 18 case 'i': | |
| 19 inputfile = *++argv; | |
| 20 fprintf( stderr, "inputfile = %s\n", inputfile ); | |
| 21 --argc; | |
| 22 goto nextoption; | |
| 23 case 'w': | |
| 24 weboutfile = *++argv; | |
| 25 fprintf( stderr, "weboutfile = %s\n", weboutfile ); | |
| 26 --argc; | |
| 27 goto nextoption; | |
| 28 default: | |
| 29 fprintf( stderr, "illegal option %c\n", c ); | |
| 30 argc = 0; | |
| 31 break; | |
| 32 } | |
| 33 } | |
| 34 nextoption: | |
| 35 ; | |
| 36 } | |
| 37 if( argc != 0 ) | |
| 38 { | |
| 39 fprintf( stderr, "options: Check source file !\n" ); | |
| 40 exit( 1 ); | |
| 41 } | |
| 42 } | |
| 43 | |
| 44 | |
| 45 int main( int argc, char *argv[] ) | |
| 46 { | |
| 47 FILE *infp; | |
| 48 FILE *weboutfp; | |
| 49 int nlenmin; | |
| 50 int isaligned = 0; | |
| 51 | |
| 52 arguments( argc, argv ); | |
| 53 | |
| 54 if( inputfile ) | |
| 55 { | |
| 56 infp = fopen( inputfile, "r" ); | |
| 57 if( !infp ) | |
| 58 { | |
| 59 fprintf( stderr, "Cannot open %s\n", inputfile ); | |
| 60 exit( 1 ); | |
| 61 } | |
| 62 } | |
| 63 else | |
| 64 infp = stdin; | |
| 65 | |
| 66 if( weboutfile ) | |
| 67 { | |
| 68 weboutfp = fopen( weboutfile, "w" ); | |
| 69 if( !weboutfp ) | |
| 70 { | |
| 71 fprintf( stderr, "Cannot open %s\n", weboutfile ); | |
| 72 exit( 1 ); | |
| 73 } | |
| 74 } | |
| 75 | |
| 76 dorp = NOTSPECIFIED; | |
| 77 if( weboutfile ) | |
| 78 { | |
| 79 getnumlen_nogap_outallreg_web( infp, weboutfp, &nlenmin, &isaligned ); | |
| 80 if( isaligned ) fprintf( stdout, "Aligned\n" ); | |
| 81 else fprintf( stdout, "Not aligned\n" ); | |
| 82 } | |
| 83 else | |
| 84 getnumlen_nogap_outallreg( infp, &nlenmin ); | |
| 85 | |
| 86 return( 0 ); | |
| 87 | |
| 88 } |
