예제 #1
0
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);
}
예제 #2
0
파일: chain.c 프로젝트: ma-compbio/RACA
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);
}