inc/ooc.h File Reference

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

Go to the source code of this file.

Functions

void oocMaskCounts (char *oocFile, bits32 *tileCounts, int tileSize, bits32 maxPat)
void oocMaskSimpleRepeats (bits32 *tileCounts, int seedSize, bits32 maxPat)


Function Documentation

void oocMaskCounts ( char *  oocFile,
bits32 *  tileCounts,
int  tileSize,
bits32  maxPat 
)

Definition at line 10 of file ooc.c.

References bits32, byteSwap32(), errAbort(), FALSE, mustOpen(), mustReadOne, oocSig, oocSigSwapped, readOne, TRUE, and UBYTE.

Referenced by gfNewEmpty(), and makePatSpace().

00013 {
00014 if (oocFile != NULL)
00015     {
00016     bits32 sig, psz;
00017     FILE *f = mustOpen(oocFile, "rb");
00018     boolean mustSwap = FALSE;
00019 
00020     mustReadOne(f, sig);
00021     mustReadOne(f, psz);
00022     if (sig == oocSig)
00023         mustSwap = FALSE;
00024     else if (sig == oocSigSwapped)
00025         {
00026         mustSwap = TRUE;
00027         psz = byteSwap32(psz);
00028         }
00029     else
00030         errAbort("Bad signature on %s\n", oocFile);
00031     if (psz != tileSize)
00032         errAbort("Oligo size mismatch in %s. Expecting %d got %d\n", 
00033             oocFile, tileSize, psz);
00034     if (mustSwap)
00035         {
00036         union {bits32 whole; UBYTE bytes[4];} u,v;
00037         while (readOne(f, u))
00038             {
00039             v.bytes[0] = u.bytes[3];
00040             v.bytes[1] = u.bytes[2];
00041             v.bytes[2] = u.bytes[1];
00042             v.bytes[3] = u.bytes[0];
00043             tileCounts[v.whole] = maxPat;
00044             }
00045         }
00046     else
00047         {
00048         bits32 oli;
00049         while (readOne(f, oli))
00050             tileCounts[oli] = maxPat;
00051         }
00052     fclose(f);
00053     }
00054 }

Here is the call graph for this function:

Here is the caller graph for this function:

void oocMaskSimpleRepeats ( bits32 *  tileCounts,
int  seedSize,
bits32  maxPat 
)

Definition at line 56 of file ooc.c.

References bits32.

Referenced by gfNewEmpty(), and makePatSpace().

00058 {
00059 int i, j, k;
00060 int tileMask = (1<<(seedSize+seedSize))-1;
00061 for (i=0; i<4; ++i)
00062     {
00063     for (j=0; j<4; ++j)
00064         {
00065         bits32 repeat = 0;
00066         for (k=0; k<8; ++k)
00067             {
00068             repeat <<= 2;
00069             repeat |= i;
00070             repeat <<= 2;
00071             repeat |= j;
00072             }
00073         repeat &= tileMask;
00074         tileCounts[repeat] = maxPat;
00075         }
00076     }
00077 }

Here is the caller graph for this function:


Generated on Tue Dec 25 19:09:15 2007 for blat by  doxygen 1.5.2