inc/supStitch.h File Reference

#include "dnaseq.h"
#include "fuzzyFind.h"
#include "patSpace.h"

Include dependency graph for supStitch.h:

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

Go to the source code of this file.

Data Structures

struct  ssFfItem
struct  ssBundle

Functions

void ssFfItemFree (struct ssFfItem **pEl)
void ssFfItemFreeList (struct ssFfItem **pList)
void ssBundleFree (struct ssBundle **pEl)
void ssBundleFreeList (struct ssBundle **pList)
void ssStitch (struct ssBundle *bundle, enum ffStringency stringency, int minScore, int maxToReturn)
ssBundlessFindBundles (struct patSpace *ps, struct dnaSeq *cSeq, char *cName, enum ffStringency stringency, boolean avoidSelfSelf)


Function Documentation

void ssBundleFree ( struct ssBundle **  pEl  ) 

Definition at line 47 of file supStitch.c.

References ssBundle::ffList, freez(), and ssFfItemFreeList().

Referenced by foldInExtras(), gfAlignSomeClumps(), gfAlignStrand(), gfAlignTrans(), gfAlignTransTrans(), gfFindAlignAaTrans(), and ssBundleFreeList().

00049 {
00050 struct ssBundle *el;
00051 if ((el = *pEl) != NULL)
00052     {
00053     ssFfItemFreeList(&el->ffList);
00054     freez(pEl);
00055     }
00056 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ssBundleFreeList ( struct ssBundle **  pList  ) 

Definition at line 58 of file supStitch.c.

References ssBundle::next, and ssBundleFree().

Referenced by addToBigBundleList().

00060 {
00061 struct ssBundle *el, *next;
00062 for (el = *pList; el != NULL; el = next)
00063     {
00064     next = el->next;
00065     ssBundleFree(&el);
00066     }
00067 *pList = NULL;
00068 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ssFfItemFree ( struct ssFfItem **  pEl  ) 

Definition at line 24 of file supStitch.c.

References ssFfItem::ff, ffFreeAli(), and freez().

Referenced by ssFfItemFreeList().

00026 {
00027 struct ssFfItem *el;
00028 if ((el = *pEl) != NULL)
00029     {
00030     ffFreeAli(&el->ff);
00031     freez(pEl);
00032     }
00033 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ssFfItemFreeList ( struct ssFfItem **  pList  ) 

Definition at line 35 of file supStitch.c.

References ssFfItem::next, and ssFfItemFree().

Referenced by ssBundleFree().

00037 {
00038 struct ssFfItem *el, *next;
00039 for (el = *pList; el != NULL; el = next)
00040     {
00041     next = el->next;
00042     ssFfItemFree(&el);
00043     }
00044 *pList = NULL;
00045 }

Here is the call graph for this function:

Here is the caller graph for this function:

struct ssBundle* ssFindBundles ( struct patSpace ps,
struct dnaSeq cSeq,
char *  cName,
enum ffStringency  stringency,
boolean  avoidSelfSelf 
) [read]

Definition at line 843 of file supStitch.c.

References AllocVar, patClump::bacIx, dnaSeq::dna, ssFfItem::ff, ffFind(), findBundle(), dnaSeq::name, patClump::next, patSpaceFindOne(), sameString, patClump::seq, patClump::seqIx, patClump::size, dnaSeq::size, slAddHead, slFreeList(), and patClump::start.

00846 {
00847 struct patClump *clumpList, *clump;
00848 struct ssBundle *bundleList = NULL, *bun = NULL;
00849 DNA *cdna = cSeq->dna;
00850 int totalCdnaSize = cSeq->size;
00851 DNA *endCdna = cdna+totalCdnaSize;
00852 struct ssFfItem *ffl;
00853 struct dnaSeq *lastSeq = NULL;
00854 int maxSize = 700;
00855 int preferredSize = 500;
00856 int overlapSize = 250;
00857 
00858 for (;;)
00859     {
00860     int cSize = endCdna - cdna;
00861     if (cSize > maxSize)
00862         cSize = preferredSize;
00863     clumpList = patSpaceFindOne(ps, cdna, cSize);
00864     for (clump = clumpList; clump != NULL; clump = clump->next)
00865         {
00866         struct ffAli *ff;
00867         struct dnaSeq *seq = clump->seq;
00868         DNA *tStart = seq->dna + clump->start;
00869         if (!avoidSelfSelf || !sameString(seq->name, cSeq->name))
00870             {
00871             ff = ffFind(cdna, cdna+cSize, tStart, tStart + clump->size, stringency);
00872             if (ff != NULL)
00873                 {
00874                 if (lastSeq != seq)
00875                     {
00876                     lastSeq = seq;
00877                     if ((bun = findBundle(bundleList, seq)) == NULL)
00878                         {
00879                         AllocVar(bun);
00880                         bun->qSeq = cSeq;
00881                         bun->genoSeq = seq;
00882                         bun->genoIx = clump->bacIx;
00883                         bun->genoContigIx = clump->seqIx;
00884                         slAddHead(&bundleList, bun);
00885                         }
00886                     }
00887                 AllocVar(ffl);
00888                 ffl->ff = ff;
00889                 slAddHead(&bun->ffList, ffl);
00890                 }
00891             }
00892         }
00893     cdna += cSize;
00894     if (cdna >= endCdna)
00895         break;
00896     cdna -= overlapSize;
00897     slFreeList(&clumpList);
00898     }
00899 slReverse(&bundleList);
00900 cdna = cSeq->dna;
00901 
00902 for (bun = bundleList; bun != NULL; bun = bun->next)
00903     {
00904     ssStitch(bun, stringency, 20, 16);
00905     }
00906 return bundleList;
00907 }

Here is the call graph for this function:

void ssStitch ( struct ssBundle bundle,
enum ffStringency  stringency,
int  minScore,
int  maxToReturn 
)

Definition at line 748 of file supStitch.c.

References AllocVar, ssBundle::avoidFuzzyFindKludge, cutAtBigIntrons(), dnaSeq::dna, FALSE, ssFfItem::ff, ffAliSort(), ffCat(), ffCdna, ffCmpHitsNeedleFirst(), ffFreeAli(), ffIntronMax, ffIntronMaxDefault, ssBundle::ffList, ffMergeClose(), ffMergeHayOverlaps(), ffMergeNeedleAlis(), ffRemoveEmptyAlis(), ffSlideIntrons(), forceMonotonic(), ssBundle::genoSeq, ssBundle::isProt, ssFfItem::next, ssBundle::qSeq, slAddHead, slFreeList(), slReverse(), smallMiddleExons(), ssFindBest(), ssBundle::t3List, and TRUE.

Referenced by ffSeedExtInMem(), foldInExtras(), gfAlignSomeClumps(), gfAlignStrand(), gfAlignTrans(), gfAlignTransTrans(), gfClumpsToBundles(), gfFindAlignAaTrans(), gfTransTransFindBundles(), and refineBundle().

00753 {
00754 struct dnaSeq *qSeq =  bundle->qSeq;
00755 struct dnaSeq *genoSeq = bundle->genoSeq;
00756 struct ffAli *ffList = NULL;
00757 struct ssFfItem *ffl;
00758 struct ffAli *bestPath;
00759 int score;
00760 boolean firstTime = TRUE;
00761 
00762 if (bundle->ffList == NULL)
00763     return;
00764 
00765 /* The score may improve when we stitch together more alignments,
00766  * so don't let minScore be too harsh at this stage. */
00767 if (minScore > 20)
00768     minScore = 20;
00769 
00770 /* Create ffAlis for all in bundle and move to one big list. */
00771 for (ffl = bundle->ffList; ffl != NULL; ffl = ffl->next)
00772     {
00773     ffCat(&ffList, &ffl->ff);
00774     }
00775 slFreeList(&bundle->ffList);
00776 
00777 ffAliSort(&ffList, ffCmpHitsNeedleFirst);
00778 ffList = ffMergeClose(ffList, qSeq->dna, genoSeq->dna);
00779 
00780 while (ffList != NULL)
00781     {
00782     ssFindBest(ffList, qSeq, genoSeq, stringency, 
00783         bundle->isProt, bundle->t3List,
00784         &bestPath, &score, &ffList);
00785 
00786     bestPath = ffMergeNeedleAlis(bestPath, TRUE);
00787     bestPath = ffRemoveEmptyAlis(bestPath, TRUE);
00788     bestPath = ffMergeHayOverlaps(bestPath);
00789     bestPath = ffRemoveEmptyAlis(bestPath, TRUE);
00790     bestPath = forceMonotonic(bestPath, qSeq, genoSeq, stringency,
00791         bundle->isProt, bundle->t3List);
00792 
00793     if (firstTime && stringency == ffCdna && bundle->avoidFuzzyFindKludge == FALSE)
00794         {
00795         /* Only look for middle exons the first time.  Next times
00796          * this might regenerate most of the first alignment... */
00797         bestPath = smallMiddleExons(bestPath, bundle, stringency);
00798         }
00799     bestPath = ffMergeNeedleAlis(bestPath, TRUE);
00800     if (ffIntronMax != ffIntronMaxDefault)
00801         {
00802         bestPath = cutAtBigIntrons(bestPath, ffIntronMax, &score, stringency,
00803                 &ffList);
00804         }
00805     if (!bundle->isProt)
00806         ffSlideIntrons(bestPath);
00807     bestPath = ffRemoveEmptyAlis(bestPath, TRUE);
00808     if (score >= minScore)
00809         {
00810         AllocVar(ffl);
00811         ffl->ff = bestPath;
00812         slAddHead(&bundle->ffList, ffl);
00813         }
00814     else
00815         {
00816         ffFreeAli(&bestPath);
00817         ffFreeAli(&ffList);
00818         break;
00819         }
00820     firstTime = FALSE;
00821     if (--maxToReturn <= 0)
00822         {
00823         ffFreeAli(&ffList);
00824         break;
00825         }
00826     }
00827 slReverse(&bundle->ffList);
00828 return;
00829 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Tue Dec 25 19:16:57 2007 for blat by  doxygen 1.5.2