mafBlock_t* maf_readAll(mafFileApi_t *mfa) { // read an entire mfa, creating a linked list of mafBlock_t, returning the head. mafBlock_t *head = maf_readBlock(mfa); mafBlock_t *mb = head; mafBlock_t *tmp = NULL; while ((tmp = maf_readBlock(mfa)) != NULL) { mb->next = tmp; mb = tmp; } return head; }
void processBody(mafFileApi_t *mfa) { // walk the body of the maf file and process it, block by block. mafBlock_t *thisBlock = NULL; thisBlock = maf_readBlock(mfa); // unused maf_destroyMafBlockList(thisBlock); while((thisBlock = maf_readBlock(mfa)) != NULL) { correctSpeciesNames(thisBlock); checkBlock(thisBlock); maf_destroyMafBlockList(thisBlock); } }
void processBody(mafFileApi_t *mfa, char *seq, char strand) { // walk the body of the maf file and process it, block by block. mafBlock_t *thisBlock = NULL; thisBlock = maf_readBlock(mfa); // header block, unused maf_destroyMafBlockList(thisBlock); printHeader(); while((thisBlock = maf_readBlock(mfa)) != NULL) { checkBlock(thisBlock, seq, strand); maf_mafBlock_print(thisBlock); maf_destroyMafBlockList(thisBlock); } }
void searchInput(mafFileApi_t *mfa, char *fullname, unsigned long pos) { mafBlock_t *thisBlock = NULL; while ((thisBlock = maf_readBlock(mfa)) != NULL) { checkBlock(thisBlock, fullname, pos); maf_destroyMafBlockList(thisBlock); } }
void processBody(mafFileApi_t *mfa, char *seq, uint32_t start, uint32_t stop) { mafBlock_t *thisBlock = NULL; bool printedHeader = false; while ((thisBlock = maf_readBlock(mfa)) != NULL) { checkBlock(thisBlock, seq, start, stop, &printedHeader); maf_destroyMafBlockList(thisBlock); } }
void processBody(mafFileApi_t *mfa, char *seq, uint64_t start, uint64_t stop, bool isSoft) { mafBlock_t *thisBlock = NULL; bool printedHeader = false; uint64_t blockNumber = 0; while ((thisBlock = maf_readBlock(mfa)) != NULL) { checkBlock(thisBlock, blockNumber, seq, start, stop, &printedHeader, isSoft); maf_destroyMafBlockList(thisBlock); ++blockNumber; } if (!printedHeader) { // this makes the output valid even when no data was output printHeader(); } }