int main (int argc, char *argv[]) { MrfEntry *currEntry; int mode; if (argc != 3) { usage ("%s <file.annotation> <include|exclude>",argv[0]); } intervalFind_addIntervalsToSearchSpace (argv[1],0); if (strEqual (argv[2],"include")) { mode = MODE_INCLUDE; } else if (strEqual (argv[2],"exclude")) { mode = MODE_EXCLUDE; } else { usage ("%s <file.annotation> <include|exclude>",argv[0]); } mrf_init ("-"); puts (mrf_writeHeader ()); while (currEntry = mrf_nextEntry ()) { processEntry (currEntry,mode); } mrf_deInit (); return 0; }
int main (int argc, char *argv[]) { MrfEntry *currEntry; char *targetName; int targetStart,targetEnd; WordIter w; if (argc != 2) { usage ("%s <targetName:targetStart-targetEnd>",argv[0]); } w = wordIterCreate (argv[1],":- ",0); targetName = hlr_strdup (wordNext (w)); targetStart = atoi (wordNext (w)); targetEnd = atoi (wordNext (w)); wordIterDestroy (w); mrf_init ("-"); puts (mrf_writeHeader ()); while (currEntry = mrf_nextEntry ()) { processEntry (currEntry,targetName,targetStart,targetEnd); } mrf_deInit (); hlr_free (targetName); return 0; }
int main (int argc, char *argv[]) { if( argc != 3 ) { usage( "%s <errors|noerrors> <gaps|nogaps>", argv[0]); return -1; } MrfEntry *currEntry; MrfBlock *currBlock; int i, error, errorCode, numErrors; int gaps = 0; if( strEqual( "gaps", argv[2] ) ) gaps = 1; seq_init(); mrf_init ("-"); printf( "%s\n", mrf_writeHeader()); numErrors = 0; while (currEntry = mrf_nextEntry ()) { error = 0; for( i=0; i<arrayMax(currEntry->read1.blocks); i++) { currBlock=arrp( currEntry->read1.blocks, i, MrfBlock); if( i==0 ) { errorCode = processBlock ( currBlock, NULL, gaps ); } else { errorCode = processBlock ( currBlock, arrp( currEntry->read1.blocks, i-1, MrfBlock ), gaps ); } if( errorCode != 0 ) { warn( "Error code (read1): %d\t%s:%c:%d:%d:%d:%d", errorCode, currBlock->targetName, currBlock->strand, currBlock->targetStart, currBlock->targetEnd, currBlock->queryStart, currBlock->queryEnd); error++; } } if (currEntry->isPairedEnd & error == 0) { for( i=0; i<arrayMax(currEntry->read2.blocks); i++) { currBlock=arrp( currEntry->read2.blocks, i, MrfBlock); if( i==0 ) { errorCode = processBlock ( currBlock, NULL , gaps ); } else { errorCode = processBlock (currBlock, arrp( currEntry->read2.blocks, i-1, MrfBlock) , gaps); } if( errorCode !=0 ) { warn( "Error code (read2): %d\t%s:%c:%d:%d:%d:%d", errorCode, currBlock->targetName, currBlock->strand, currBlock->targetStart, currBlock->targetEnd, currBlock->queryStart, currBlock->queryEnd); error++; } } } if( error > 0 && strEqual(argv[1], "errors")) { printf( "%s\n", mrf_writeEntry( currEntry )); error=0; numErrors++; } if( error == 0 && strEqual(argv[1], "noerrors")) printf( "%s\n", mrf_writeEntry( currEntry )); } mrf_deInit (); warn("%s: done", argv[0]); return 0; }