static void mapQueryPsl(struct psl* inPsl, struct chromBins *mapAlns, FILE* outPslFh, FILE *mapInfoFh, FILE *mappingPslFh) /* map a query psl to all targets */ { static struct dyString *idBuf = NULL; struct binElement *overMapAlns = chromBinsFind(mapAlns, getMappingId(inPsl->tName, &idBuf), inPsl->tStart, inPsl->tEnd); struct binElement *overMapAln; for (overMapAln = overMapAlns; overMapAln != NULL; overMapAln = overMapAln->next) mapPslPair(inPsl, (struct mapAln *)overMapAln->val, outPslFh, mapInfoFh, mappingPslFh); slFreeList(&overMapAlns); }
struct binElement *orgGenesFind(struct orgGenes *genes, struct mafComp *comp, int sortDir) /* Return list of references to exons overlapping the specified component, * sorted into assending order sortDir is 1, descending if it's -1. * slFreeList the returned list. */ { char *chrom = skipSrcDb(comp->src); int start = comp->start; int end = (comp->start + comp->size); struct binElement *exons; /* get positive strand coordinate to match exon */ if (comp->strand == '-') reverseIntRange(&start, &end, comp->srcSize); exons = chromBinsFind(genes->bins, chrom, start, end); slSort(&exons, (sortDir > 0) ? cmpExonsAscend : cmpExonsDescend); return exons; }