inc/pslTransMap.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  pslTransMapOpts { pslTransMapNoOpts = 0x00, pslTransMapKeepTrans = 0x01 }

Functions

pslpslTransMap (unsigned opts, struct psl *inPsl, struct psl *mapPsl)


Enumeration Type Documentation

enum pslTransMapOpts

Enumerator:
pslTransMapNoOpts 
pslTransMapKeepTrans 

Definition at line 6 of file pslTransMap.h.

00008 {
00009     pslTransMapNoOpts     = 0x00,  /* no options */
00010     pslTransMapKeepTrans  = 0x01   /* keep translated alignment strand */
00011 };


Function Documentation

struct psl* pslTransMap ( unsigned  opts,
struct psl inPsl,
struct psl mapPsl 
) [read]

Definition at line 247 of file pslTransMap.c.

References adjustOrientation(), psl::blockCount, blockFromPslBlock(), createMappedPsl(), errAbort(), mapBlock(), pslFree(), pslIsProtein(), pslNAToProt(), pslProtToNA(), pslQStrand, pslRc(), pslTStrand, psl::qName, psl::qSize, safef(), sameString, setPslBounds(), psl::tName, and psl::tSize.

00250 {
00251 int mappedPslMax = 8; /* allocated space in output psl */
00252 int iMapBlk = 0;
00253 char inPslOrigStrand[3];
00254 boolean rcInPsl = (pslTStrand(inPsl) != pslQStrand(mapPsl));
00255 boolean cnv1 = (pslIsProtein(inPsl) && !pslIsProtein(mapPsl));
00256 boolean cnv2 = (pslIsProtein(mapPsl) && !pslIsProtein(inPsl));
00257 int iBlock;
00258 struct psl* mappedPsl;
00259 
00260 if (!sameString(inPsl->tName, mapPsl->qName))
00261     errAbort("Error: inPsl tName %s != mapPsl tName %s)",
00262             inPsl->tName, mapPsl->qName);
00263 if (inPsl->tSize != mapPsl->qSize)
00264     errAbort("Error: inPsl %s tSize (%d) != mapPsl %s qSize (%d)",
00265             inPsl->tName, inPsl->tSize, mapPsl->qName, mapPsl->qSize);
00266 
00267 /* convert protein PSLs */
00268 if (cnv1)
00269     pslProtToNA(inPsl);
00270 if (cnv2)
00271     pslProtToNA(mapPsl);
00272 
00273 /* need to ensure common sequence is in same orientation, save strand for later */
00274 safef(inPslOrigStrand, sizeof(inPslOrigStrand), "%s", inPsl->strand);
00275 if (rcInPsl)
00276     pslRc(inPsl);
00277 
00278 mappedPsl = createMappedPsl(inPsl, mapPsl, mappedPslMax);
00279 
00280 /* Fill in ungapped blocks.  */
00281 for (iBlock = 0; iBlock < inPsl->blockCount; iBlock++)
00282     {
00283     struct block align1Blk = blockFromPslBlock(inPsl, iBlock);
00284     while (mapBlock(inPsl, mapPsl, &iMapBlk, &align1Blk, mappedPsl,
00285                     &mappedPslMax))
00286         continue;
00287     }
00288 
00289 /* finish up psl, or free if no blocks were added */
00290 assert(mappedPsl->blockCount <= mappedPslMax);
00291 if (mappedPsl->blockCount == 0)
00292     pslFree(&mappedPsl);  /* nothing made it */
00293 else
00294     {
00295     setPslBounds(mappedPsl);
00296     adjustOrientation(opts, inPsl, inPslOrigStrand, mappedPsl);
00297     }
00298 
00299 /* restore input */
00300 if (rcInPsl)
00301     {
00302     pslRc(inPsl);
00303     strcpy(inPsl->strand, inPslOrigStrand);
00304     }
00305 if (cnv1)
00306     pslNAToProt(inPsl);
00307 if (cnv2)
00308     pslNAToProt(mapPsl);
00309 
00310 return mappedPsl;
00311 }

Here is the call graph for this function:


Generated on Tue Dec 25 19:12:58 2007 for blat by  doxygen 1.5.2