void indexedChainSubsetOnT(struct indexedChain *ixc, int subStart, int subEnd, struct chain **retSubChain, struct chain **retChainToFree) /* Extract subset of chain that has been indexed. */ { struct range *r = rangeTreeAllOverlapping(ixc->blockTree, subStart, subEnd); if (r == NULL) *retSubChain = *retChainToFree = NULL; else chainFastSubsetOnT(ixc->chain, r->val, subStart, subEnd, retSubChain, retChainToFree); }
void chainSubsetOnT(struct chain *chain, int subStart, int subEnd, struct chain **retSubChain, struct chain **retChainToFree) /* Get subchain of chain bounded by subStart-subEnd on * target side. Return result in *retSubChain. In some * cases this may be the original chain, in which case * *retChainToFree is NULL. When done call chainFree on * *retChainToFree. The score and id fields are not really * properly filled in. */ { /* Find first relevant block. */ struct cBlock *firstBlock; for (firstBlock = chain->blockList; firstBlock != NULL; firstBlock = firstBlock->next) { if (firstBlock->tEnd > subStart) break; } chainFastSubsetOnT(chain, firstBlock, subStart, subEnd, retSubChain, retChainToFree); }