00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #include "includes.h"
00060
00061
00062 #define RETROFLUX_VERSION "0.3.4"
00063 #define RETROFLUX_DATE "06-Aug-2004"
00064
00065
00066
00067 int main( int argc, char *argv[] );
00068
00069 int filterMolecules( char* reactants, const List_Ptr filterSmilesPtr, FILE* errorLogFile );
00070
00071 void enqueueMolecules( char* reactants, char* reactionName, const SmilesCompound_Ptr product, \
00072 const List_Ptr listPtr, FILE* errorLogFile );
00073
00074 void parseClp( const int argc, char* argv[], CLP_Ptr clpPtr );
00075
00076 List_Ptr readDataFromFile( const char* const filename, const int daylight_type, const int uniqueData, \
00077 FILE* errorLogFile );
00078
00079 List_Ptr readDataFromStream( FILE* inputStream, const char* const nameOfStream, \
00080 const int daylight_type, const int uniqueData, FILE* errorLogFile );
00081
00082 DoubleArrayPtr getFileProperties( FILE* inputStream, const char* const nameOfStream );
00083
00084 void displayHelpText( const CLP_Ptr clpPtr );
00085
00086 void displayVersionInformation( void );
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 int main ( int argc, char *argv[] )
00106 {
00107 CLP_Ptr clpPtr;
00108 FILE* outFile;
00109 FILE* errorLogFile;
00110 List_Ptr inputDataPtr;
00111 List_Ptr reactionSmilesPtr;
00112 List_Ptr filterSmilesPtr = NULL;
00113 SmilesCompound_Ptr currentReactionPtr;
00114 SmilesCompound_Ptr currentSmilesPtr;
00115 int totalNumberOfCompounds = 0;
00116
00117
00118 int moleculeEnqueued;
00119 int reactionCounter;
00120
00121
00122 dt_Handle errorSequenceHandle;
00123 dt_Handle errorHandle;
00124 dt_Integer length;
00125
00126 dt_Handle reactionSmilesHandle;
00127
00128 dt_Handle currentSmilesHandle;
00129 dt_Handle transformSequenceHandle;
00130 dt_Handle reactionHandle;
00131 dt_Handle moleculeStreamHandle;
00132 dt_Handle moleculeHandle;
00133
00134
00135 clpPtr = CLP_create( );
00136 parseClp( argc, argv, clpPtr );
00137
00138 fprintf( stderr, "\nretroflux %s ( %s )\n\n", RETROFLUX_VERSION, RETROFLUX_DATE );
00139 CLP_display( clpPtr, stderr );
00140
00141
00142 if( !( outFile = fopen( CLP_getOutputFile( clpPtr ), "w" ) ) )
00143 FileWriteError( CLP_getOutputFile( clpPtr ) );
00144
00145
00146 if( !( errorLogFile = fopen( CLP_getErrorLogFile( clpPtr ), "w" ) ) )
00147 FileWriteError( CLP_getErrorLogFile( clpPtr ) );
00148
00149
00150 fprintf( stderr, "Reading file from stdin......." );
00151 inputDataPtr = readDataFromStream( stdin, "<stdin>", DAYLIGHT_SMILES, BOOLEAN_TRUE, errorLogFile );
00152 List_setName( inputDataPtr, "Database" );
00153 List_rewind( inputDataPtr );
00154 fprintf( stderr, "Done\n" );
00155 while( List_hasNext( inputDataPtr ) )
00156 totalNumberOfCompounds += SmilesCompound_getCounter( List_getNext( inputDataPtr ) );
00157 fprintf( stderr, "Total number of compounds in input file: %d\n", totalNumberOfCompounds );
00158 fprintf( stderr, "Number of unique compounds in input file: %d\n\n", \
00159 List_getNumberOfNodes( inputDataPtr ) );
00160 #if RETROFLUX_DEBUG
00161 List_display( inputDataPtr, outFile );
00162 #endif
00163
00164
00165 fprintf( stderr, "Reading reaction SMILES file %s...", CLP_getReactionFile( clpPtr ) );
00166 reactionSmilesPtr = readDataFromFile( CLP_getReactionFile( clpPtr ), DAYLIGHT_SMIRKS, BOOLEAN_TRUE, \
00167 errorLogFile );
00168 List_setName( reactionSmilesPtr, "Reaction SMILES" );
00169 fprintf( stderr, "Done\n" );
00170 fprintf( stderr, "Number of reactions: %d\n", List_getNumberOfNodes( reactionSmilesPtr ) );
00171 #if RETROFLUX_DEBUG
00172 List_display( reactionSmilesPtr, outFile );
00173 #endif
00174
00175
00176 if( CLP_getFilterFile( clpPtr ) != NULL )
00177 {
00178 fprintf( stderr, "Reading filter SMILES file %s...", CLP_getFilterFile( clpPtr ) );
00179 filterSmilesPtr = readDataFromFile( CLP_getFilterFile( clpPtr ), DAYLIGHT_SMILES, BOOLEAN_TRUE, \
00180 errorLogFile );
00181 List_setName( filterSmilesPtr, "Filter SMILES" );
00182 fprintf( stderr, "Done\n" );
00183 fprintf( stderr, "Number of filter SMILES: %d\n", List_getNumberOfNodes( filterSmilesPtr ) );
00184 #if RETROFLUX_DEBUG
00185 List_display( filterSmilesPtr, outFile );
00186 #endif
00187 }
00188
00189
00190 List_rewind( inputDataPtr );
00191 List_rewind( reactionSmilesPtr );
00192
00193 while( List_hasNext( reactionSmilesPtr ) )
00194 {
00195 reactionCounter = 0;
00196 currentReactionPtr = List_getNext( reactionSmilesPtr );
00197 fprintf( stderr, "Processing reaction %s....", \
00198 StringArray_getElement( SmilesCompound_getStringArrayOfNames( currentReactionPtr ), 0 ) );
00199
00200 reactionSmilesHandle = SmilesCompound_getMoleculeHandle( currentReactionPtr );
00201
00202 while( List_hasNext( inputDataPtr ) )
00203 {
00204 moleculeEnqueued = BOOLEAN_FALSE;
00205 currentSmilesPtr = List_getNext( inputDataPtr );
00206 currentSmilesHandle = SmilesCompound_getMoleculeHandle( currentSmilesPtr );
00207
00208 transformSequenceHandle = dt_utransform( reactionSmilesHandle, currentSmilesHandle, DX_REVERSE, 1 );
00209
00210
00211 while( NULL_OB != ( reactionHandle = dt_next( transformSequenceHandle ) ) )
00212 {
00213
00214
00215 moleculeStreamHandle = dt_stream( reactionHandle, TYP_MOLECULE );
00216
00217 while( NULL_OB != ( moleculeHandle = dt_next( moleculeStreamHandle ) ) )
00218 {
00219 if( dt_getrole( moleculeHandle, reactionHandle ) != DX_ROLE_REACTANT )
00220 break;
00221
00222
00223
00224
00225 if( ( CLP_getFilterFile( clpPtr ) != NULL ) && \
00226 ( filterMolecules( dt_cansmiles( &length, moleculeHandle, 1 ), \
00227 filterSmilesPtr, errorLogFile ) == BOOLEAN_TRUE ) )
00228 break;
00229 enqueueMolecules( dt_cansmiles( &length, moleculeHandle, 1 ), \
00230 StringArray_getElement( SmilesCompound_getStringArrayOfNames( currentReactionPtr ), 0 ), \
00231 currentSmilesPtr, inputDataPtr, errorLogFile );
00232 moleculeEnqueued = BOOLEAN_TRUE;
00233 reactionCounter++;
00234
00235 }
00236 }
00237
00238
00239 if( ( dt_count( transformSequenceHandle, TYP_REACTION ) ) != -1 && \
00240 moleculeEnqueued == BOOLEAN_TRUE )
00241 List_remove( inputDataPtr );
00242 dt_dealloc( transformSequenceHandle );
00243 }
00244
00245
00246
00247
00248 List_rewind( inputDataPtr );
00249 fprintf( stderr, "%d\n", reactionCounter );
00250 }
00251
00252
00253
00254 errorSequenceHandle = dt_errors( DX_ERR_NONE );
00255 while( NULL_OB != ( errorHandle = dt_next( errorSequenceHandle ) ) )
00256 fprintf( errorLogFile, "%s\n", dt_stringvalue( &length, errorHandle ) );
00257
00258
00259 List_display( inputDataPtr, outFile );
00260
00261
00262 List_destroy( inputDataPtr );
00263 List_destroy( reactionSmilesPtr );
00264 if( CLP_getFilterFile( clpPtr ) != NULL )
00265 List_destroy( filterSmilesPtr );
00266 fclose( outFile );
00267 CLP_destroy( clpPtr );
00268
00269 fprintf( stderr, "Adios.\n\n");
00270 return EXIT_SUCCESS;
00271 }
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286 int filterMolecules( char* reactants, const List_Ptr filterSmilesPtr, FILE* errorLogFile )
00287 {
00288 char* substring;
00289 char* copyStart;
00290 char* tempSmiles;
00291
00292 int containsFilterMolecule = BOOLEAN_FALSE;
00293 SmilesCompound_Ptr scPtr;
00294
00295 if( !( tempSmiles = calloc( strlen( reactants ) + 1, sizeof( char ) ) ) )
00296 MemoryError( "tempSmiles", "filterMolecules" );
00297
00298 copyStart = reactants;
00299
00300 while( ( substring = strstr( copyStart, "." ) ) != NULL )
00301 {
00302 strncpy( tempSmiles, copyStart, (substring - copyStart ) );
00303 tempSmiles[ substring - copyStart ] = '\0';
00304 copyStart = substring + 1;
00305
00306 scPtr = SmilesCompound_create( NULL, tempSmiles, DAYLIGHT_SMILES, errorLogFile );
00307 if( List_isContained( filterSmilesPtr, scPtr ) == BOOLEAN_TRUE )
00308 containsFilterMolecule = BOOLEAN_TRUE;
00309 SmilesCompound_destroy( scPtr );
00310 }
00311
00312 strncpy( tempSmiles, copyStart, ( ( reactants + strlen( reactants ) ) - ( copyStart ) ) );
00313 tempSmiles[ ( ( reactants + strlen( reactants ) ) - ( copyStart ) ) ] = '\0';
00314
00315 scPtr = SmilesCompound_create( NULL, tempSmiles, DAYLIGHT_SMILES, errorLogFile );
00316 if( List_isContained( filterSmilesPtr, scPtr ) == BOOLEAN_TRUE )
00317 containsFilterMolecule = BOOLEAN_TRUE;
00318 SmilesCompound_destroy( scPtr );
00319
00320
00321 free( tempSmiles );
00322
00323 return containsFilterMolecule;
00324 }
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345 void enqueueMolecules( char* reactants, char* reactionName, const SmilesCompound_Ptr product, \
00346 const List_Ptr listPtr, FILE* errorLogFile )
00347 {
00348 char* substring;
00349 char* copyStart;
00350 char* tempSmiles;
00351 char* dotPlusReactionName;
00352 SmilesCompound_Ptr scPtr;
00353
00354 if( !( tempSmiles = calloc( strlen( reactants ) + 1, sizeof( char ) ) ) )
00355 MemoryError( "tempSmiles", "enqueueMolecules" );
00356 if( !( dotPlusReactionName = calloc( strlen( reactionName ) + 2, sizeof( char ) ) ) )
00357 MemoryError( "dotPlusReactionName", "enqueueMolecules" );
00358 strcpy( dotPlusReactionName, "." );
00359 strcat( dotPlusReactionName, reactionName );
00360
00361 copyStart = reactants;
00362
00363 while( ( substring = strstr( copyStart, "." ) ) != NULL )
00364 {
00365 strncpy( tempSmiles, copyStart, (substring - copyStart ) );
00366 tempSmiles[ substring - copyStart ] = '\0';
00367 copyStart = substring + 1;
00368
00369 scPtr = SmilesCompound_copy( product );
00370 SmilesCompound_setSmiles( scPtr, tempSmiles, DAYLIGHT_SMILES, errorLogFile );
00371 StringArray_mapConcatenate( SmilesCompound_getStringArrayOfNames( scPtr ), dotPlusReactionName );
00372 if( List_insertTail( listPtr, scPtr ) == BOOLEAN_FALSE )
00373 SmilesCompound_destroy( scPtr );
00374 }
00375
00376 strncpy( tempSmiles, copyStart, ( ( reactants + strlen( reactants ) ) - ( copyStart ) ) );
00377 tempSmiles[ ( ( reactants + strlen( reactants ) ) - ( copyStart ) ) ] = '\0';
00378
00379 scPtr = SmilesCompound_copy( product );
00380 SmilesCompound_setSmiles( scPtr, tempSmiles, DAYLIGHT_SMILES, errorLogFile );
00381 StringArray_mapConcatenate( SmilesCompound_getStringArrayOfNames( scPtr ), dotPlusReactionName );
00382 if( List_insertTail( listPtr, scPtr ) == BOOLEAN_FALSE )
00383 SmilesCompound_destroy( scPtr );
00384
00385
00386 free( tempSmiles );
00387 free( dotPlusReactionName );
00388 }
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407 void parseClp( const int argc, char* argv[], CLP_Ptr clpPtr )
00408 {
00409 int c;
00410 char* errorLogFile;
00411 Given_CLP_Ptr givenClpPtr;
00412
00413 givenClpPtr = GivenClp_create( );
00414
00415 opterr = 0;
00416
00417 while ( ( c = getopt( argc, argv, "hvo:r:f:" ) ) != -1 )
00418 {
00419 switch( c )
00420 {
00421
00422 case 'h':
00423 displayHelpText( clpPtr );
00424 break;
00425
00426
00427 case 'v':
00428 displayVersionInformation();
00429 break;
00430
00431
00432 case 'o':
00433 CLP_setOutputFile( clpPtr, optarg );
00434 GivenClp_setOption( givenClpPtr, 'o', BOOLEAN_TRUE );
00435 break;
00436
00437
00438 case 'r':
00439 CLP_setReactionFile( clpPtr, optarg );
00440 GivenClp_setOption( givenClpPtr, 'r', BOOLEAN_TRUE );
00441 break;
00442
00443
00444 case 'f':
00445 CLP_setFilterFile( clpPtr, optarg );
00446 GivenClp_setOption( givenClpPtr, 'f', BOOLEAN_TRUE );
00447 break;
00448
00449 case '?':
00450 fprintf( stderr, "\n\nERROR: There is given either an option without an argument that\n" );
00451 fprintf( stderr, "requires one or an unknown option!\n" );
00452 fprintf( stderr, "Type 'retroflux -h' for a detailed help text!\n");
00453 AbortProgram;
00454 break;
00455 }
00456 }
00457
00458
00459 if( isatty( STDIN_FILENO ) )
00460 displayHelpText( clpPtr );
00461
00462
00463 if( GivenClp_getOption( givenClpPtr, 'o' ) == BOOLEAN_FALSE )
00464 MandatoryOption( "'-o'" );
00465
00466
00467 if( GivenClp_getOption( givenClpPtr, 'r' ) == BOOLEAN_FALSE )
00468 MandatoryOption( "'-r'" );
00469
00470
00471 if( !( errorLogFile = calloc( strlen( CLP_getOutputFile( clpPtr ) ) + 5, sizeof( char ) ) ) )
00472 MemoryError( "parseClp", "errorLogFile" );
00473 strncpy( errorLogFile, CLP_getOutputFile( clpPtr ), strlen( CLP_getOutputFile( clpPtr ) ) + 1 );
00474 CLP_setErrorLogFile( clpPtr, strncat( errorLogFile, ".log", 4 ) );
00475 if( errorLogFile != NULL )
00476 free( errorLogFile );
00477
00478 GivenClp_destroy( givenClpPtr );
00479 }
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495 List_Ptr readDataFromFile( const char* const filename, const int daylight_type, \
00496 const int uniqueData, FILE* errorLogFile )
00497 {
00498 FILE* dataFile = NULL;
00499
00500
00501 if( !( dataFile = fopen( filename, "r" ) ) )
00502 FileReadError( filename );
00503
00504
00505 return readDataFromStream( dataFile, filename, daylight_type, uniqueData, errorLogFile );
00506 }
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527 List_Ptr readDataFromStream( FILE* inputStream, const char* const nameOfStream, \
00528 const int daylight_type, const int uniqueData, FILE* errorLogFile )
00529 {
00530 int numberOfColumns = 0;
00531
00532 int maxNumberOfCharsPerRow = 0;
00533 int numberOfRows = 0;
00534 char* tempRow = NULL;
00535 char* substring = NULL;
00536 char* tempSmiles = NULL;
00537 char* tempName = NULL;
00538 DoubleArrayPtr dAPtr = NULL;
00539 List_Ptr listPtr = NULL;
00540 SmilesCompound_Ptr scPtr = NULL;
00541 char* errorMessage = NULL;
00542
00543 StringArray_Ptr sAPtr = NULL;
00544
00545
00546 dAPtr = getFileProperties( inputStream, nameOfStream );
00547
00548 rewind( inputStream );
00549 numberOfColumns = (int) DoubleArray_getValue( dAPtr, 0 );
00550 maxNumberOfCharsPerRow = (int) DoubleArray_getValue( dAPtr, 1 );
00551 numberOfRows = (int) DoubleArray_getValue( dAPtr, 2 );
00552
00553 #if FLUX_DEBUG
00554 fprintf( stdout, "\nNoColumns = %d\tMaxNoChars = %d\tNoRows = %d\n", \
00555 numberOfColumns, maxNumberOfCharsPerRow, numberOfRows );
00556 #endif
00557
00558 if( !( tempRow = calloc( maxNumberOfCharsPerRow + 2, sizeof( char ) ) ) )
00559 MemoryError( "tempRow", "readDataFromStream" );
00560 if( !( tempSmiles = calloc( maxNumberOfCharsPerRow + 2, sizeof( char ) ) ) )
00561 MemoryError( "tempSmiles", "readDataFromStream" );
00562 if( !( tempName = calloc( maxNumberOfCharsPerRow + 2, sizeof( char ) ) ) )
00563 MemoryError( "tempName", "readDataFromStream" );
00564 listPtr = List_create( uniqueData, SmilesCompound_display, SmilesCompound_destroy, \
00565 SmilesCompound_identical );
00566 sAPtr = StringArray_create( );
00567
00568
00569
00570 while( fgets( tempRow, maxNumberOfCharsPerRow + 2, inputStream ) != NULL )
00571 {
00572 #if FLUX_DEBUG
00573 fprintf( stdout, "tempRow = %s", tempRow ); fflush( NULL );
00574 #endif
00575
00576
00577 if( numberOfColumns == 1 )
00578 {
00579 strncpy( tempSmiles, tempRow, strlen( tempRow ) - 1 );
00580 tempSmiles[ strlen( tempRow ) - 1 ] = '\0';
00581 strncpy( tempName, tempRow, strlen( tempRow ) - 1 );
00582 tempName[ strlen( tempRow ) - 1 ] = '\0';
00583 }
00584
00585 else
00586 {
00587 substring = strstr( tempRow, "\t" );
00588 strncpy( tempSmiles, tempRow, ( substring - tempRow ) );
00589 tempSmiles[ substring - tempRow ] = '\0';
00590 strncpy( tempName, substring + 1, ( tempRow + strlen( tempRow ) - 1 ) - ( substring + 1 ) );
00591 tempName[ ( tempRow + strlen( tempRow ) - 1 ) - ( substring + 1 ) ] = '\0';
00592 }
00593 #if FLUX_DEBUG
00594 fprintf( stdout, "Smiles: %s\tName: %s\n", tempSmiles, tempName ); fflush( NULL );
00595 #endif
00596
00597
00598 scPtr = SmilesCompound_create( tempName, tempSmiles, daylight_type, errorLogFile );
00599
00600 if( scPtr != BOOLEAN_FALSE )
00601 {
00602 if( List_insertTail( listPtr, scPtr ) == BOOLEAN_FALSE )
00603 SmilesCompound_destroy( scPtr );
00604 }
00605 else
00606 {
00607 if( !( errorMessage = calloc( 300, sizeof( char ) ) ) )
00608 MemoryError( "errorMessage", "readDataFromStream" );
00609 sprintf( errorMessage, "Error reading compound %s\n", tempSmiles );
00610 StringArray_addElement( sAPtr, errorMessage );
00611 }
00612 }
00613
00614 if( StringArray_getNumberOfElements( sAPtr ) != 0 )
00615 StringArray_display( sAPtr, stderr );
00616
00617
00618 free( tempRow );
00619 free( tempSmiles );
00620 free( tempName );
00621 DoubleArray_destroy( dAPtr );
00622 StringArray_destroy( sAPtr );
00623
00624 return listPtr;
00625 }
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647 DoubleArrayPtr getFileProperties( FILE* inputStream, const char* const nameOfStream )
00648 {
00649 int numberOfColumns = 1;
00650 int maxCharsPerRow = 0;
00651 int numberOfRows = 0;
00652 char currentCharacter;
00653 int position;
00654 char* tempRow;
00655 char* substring;
00656 int counter = 1;
00657
00658
00659
00660
00661
00662 DoubleArrayPtr dAPtr;
00663
00664 if( !( tempRow = calloc( 10000, sizeof( char ) ) ) )
00665 MemoryError( "tempRow", "getFileProperties" );
00666
00667 dAPtr = DoubleArray_create( 3 );
00668
00669
00670 while( ( currentCharacter = fgetc( inputStream ) ) != EOF )
00671 {
00672
00673 ungetc( currentCharacter, inputStream );
00674
00675
00676 position = 0;
00677 counter = 1;
00678
00679
00680 while( ( currentCharacter = fgetc( inputStream ) ) != '\n' )
00681 {
00682 tempRow[ position ] = currentCharacter;
00683 position++;
00684 }
00685 tempRow[ position ] = '\0';
00686 numberOfRows++;
00687
00688
00689 substring = strstr( tempRow, "\t" );
00690 while( substring != NULL)
00691 {
00692 counter++;
00693 substring = strstr( substring + 1, "\t" );
00694 }
00695
00696
00697 if( numberOfRows == 1 )
00698 numberOfColumns = counter;
00699
00700
00701 if( counter != numberOfColumns )
00702 FileIntegrityError( nameOfStream, numberOfRows, counter, numberOfColumns );
00703
00704
00705 if( strlen( tempRow ) > maxCharsPerRow )
00706 maxCharsPerRow = position;
00707 }
00708
00709
00710 if( numberOfColumns > 2 )
00711 {
00712 fprintf( stderr, "\nERROR: The number of columns in %s is neither one nor two!\n", nameOfStream );
00713 fprintf( stderr, "Only input files with the name in the first column and the SMILES string\n" );
00714 fprintf( stderr, "in the second column or the SMILES string as the only column are valid!\n" );
00715 AbortProgram;
00716 }
00717
00718
00719 DoubleArray_setValue( dAPtr, 0, numberOfColumns );
00720 DoubleArray_setValue( dAPtr, 1, maxCharsPerRow );
00721 DoubleArray_setValue( dAPtr, 2, numberOfRows );
00722
00723 free( tempRow );
00724
00725 return dAPtr;
00726 }
00727
00728
00729
00730
00731
00732
00733
00734
00735 void displayHelpText( const CLP_Ptr clpPtr )
00736 {
00737 fprintf( stderr, "\nNAME:\n" );
00738 fprintf( stderr, " retroflux\n" );
00739 fprintf( stderr, "\nFUNCTION:\n" );
00740 fprintf( stderr, " Facilitates a virtual retro-synthesis of compounds.\n" );
00741 fprintf( stderr, "\nUSAGE:\n" );
00742 fprintf( stderr, " retroflux [Options] <INFILE\n" );
00743 fprintf( stderr, " INFILE has to be a file with one SMILES per row or a tab separated file\n" );
00744 fprintf( stderr, " with SMILES in the first and labels in the second column.\n" );
00745 fprintf( stderr, "\nREMARK:\n" );
00746 fprintf( stderr, " An error log file is automatically created. Its name is the suffix '.log'\n" );
00747 fprintf( stderr, " appended to the name of the output file.\n" );
00748 fprintf( stderr, "\nOPTIONS:\n" );
00749 fprintf( stderr, " -h\n" );
00750 fprintf( stderr, " Display this help text.\n" );
00751 fprintf( stderr, " -v\n" );
00752 fprintf( stderr, " Display detailed version information and exit.\n" );
00753 fprintf( stderr, " -o STRING\n" );
00754 fprintf( stderr, " Set STRING as the name of the output file.\n" );
00755 fprintf( stderr, " -r FILENAME | mandatory\n" );
00756 fprintf( stderr, " Set FILENAME as the name of the reaction SMILES file. This file has to\n" );
00757 fprintf( stderr, " contain exactly two tab separated columns, where SMIRKS are in the first\n" );
00758 fprintf( stderr, " column and reaction names are in the second column.\n" );
00759 fprintf( stderr, " -f FILENAME\n" );
00760 fprintf( stderr, " Set FILENAME as the name of the filter SMILES file. This file has to\n" );
00761 fprintf( stderr, " contain one SMILES per row. All molecules in the filter file are\n" );
00762 fprintf( stderr, " considered as unwanted fragments, i.e. reactions that lead to one of these\n" );
00763 fprintf( stderr, " molecules are not carried out.\n" );
00764 fprintf( stderr, " If no file is specified, all resulting fragments are considered as valid.\n" );
00765 fprintf( stderr, "\nAUTHOR:\n" );
00766 fprintf( stderr, " Uli Fechner\n" );
00767 fprintf( stderr, "\nVERSION & RELEASE DATE:\n" );
00768 fprintf( stderr, " %s ( %s )\n", RETROFLUX_VERSION, RETROFLUX_DATE );
00769 fprintf( stderr, "\nBUGS:\n" );
00770 fprintf( stderr, " Please report bugs to u.fechner@chemie.uni-frankfurt.de\n\n" );
00771 exit( EXIT_SUCCESS );
00772 }
00773
00774
00775
00776
00777
00778
00779 void displayVersionInformation( void )
00780 {
00781 fprintf( stderr, "\nVERSION & RELEASE DATE:\n\n");
00782 fprintf( stderr, " includes.h: %s [%s]\n", INCLUDES_VERSION, INCLUDES_DATE );
00783 fprintf( stderr, " generalDefines.h: %s [%s]\n", GENERALDEFINES_VERSION, GENERALDEFINES_DATE );
00784 fprintf( stderr, " givenClp.c: %s [%s]\n", GIVENCLP_VERSION, GIVENCLP_DATE );
00785 fprintf( stderr, " doubleArray.c: %s [%s]\n", DOUBLEARRAY_VERSION, DOUBLEARRAY_DATE );
00786 fprintf( stderr, " clp.c: %s [%s]\n", CLP_VERSION, CLP_DATE );
00787 fprintf( stderr, " smilesCompound.c: %s [%s]\n", SMILESCOMPOUND_VERSION, SMILESCOMPOUND_DATE );
00788 fprintf( stderr, " doubleLinkedList.c: %s [%s]\n", DOUBLELINKEDLIST_VERSION, DOUBLELINKEDLIST_DATE );
00789 fprintf( stderr, " retroflux core: %s [%s]\n\n", RETROFLUX_VERSION, RETROFLUX_DATE );
00790 exit( EXIT_SUCCESS );
00791 }