inc/seqOut.h

Go to the documentation of this file.
00001 /* seqOut - stuff to output sequences and alignments in web 
00002  * or ascii viewable form. */
00003 
00004 
00005 struct cfm
00006 /* Colored web character output formatter. */
00007     {
00008     int wordLen;        /* Number of characters between spaces (often 10) */
00009     int lineLen;        /* Number of characters between lines (often 50) */
00010     int inWord, inLine; /* Position in word and line. */
00011     bool lineNumbers;   /* True if write position at end of line. */
00012     bool countDown;     /* True if want numbers counting down. */
00013     long charCount;     /* Number of characters written total. */
00014     FILE *out;          /* File to write to. */
00015     int numOff;         /* Number to start with. */
00016     int color;          /* Cache last color here. */
00017     bool underline;     /* Underline? */
00018     bool bold;          /* Font in bold. */
00019     bool italic;        /* Italic? */
00020     };
00021 
00022 struct cfm *cfmNew(int wordLen, int lineLen, 
00023         boolean lineNumbers, boolean countDown, FILE *out, int numOff);
00024 /* Set up colored sequence formatting for html. */
00025 
00026 void cfmOut(struct cfm *cfm, char c, int color);
00027 /* Write out a byte, and depending on color formatting extras  */
00028 
00029 void cfmOutExt(struct cfm *cfm, char c, int color, boolean underline, boolean bold, boolean italic);
00030 /* Write out a byte, and formatting extras  */
00031 
00032 void cfmFree(struct cfm **pCfm);
00033 /* Finish and free up cfm formatting job. */
00034 
00035 enum seqOutColor
00036 /* Symbolic color for sequence output. */
00037     {
00038     socBlack = 0,               /* Not aligning. */
00039     socBlue = 1,                /* Aligning. */
00040     socBrightBlue = 2,          /* End of an aligning block. */
00041     socRed = 3,                 /* Aligning UTR. */
00042     socOrange = 4,              /* End of an aligning UTR block. */
00043     };
00044 extern int seqOutColorLookup[];         /* Converts these to html format colors. */
00045 
00046 struct baf
00047 /* Block allignment formatter. */
00048     {
00049     char nChars[256];
00050     char hChars[256];
00051     int cix;
00052     int nLineStart;
00053     int hLineStart;
00054     int nCurPos;
00055     int hCurPos;
00056     DNA *needle, *haystack;
00057     int nNumOff, hNumOff;
00058     FILE *out;
00059     int lineSize;
00060     bool hCountDown;     /* True if want numbers counting down. */
00061     bool isTrans;        /* True if haystack is translated. */
00062     bool nCountDown;     /* True if want needle numbers counting down. */
00063     };
00064 
00065 void bafInit(struct baf *baf, DNA *needle, int nNumOff, boolean nCountDown,
00066         DNA *haystack, int hNumOff, boolean hCountDown, 
00067         FILE *out, int lineSize, boolean isTrans);
00068 /* Initialize block alignment formatter. */
00069 
00070 void bafSetAli(struct baf *baf, struct ffAli *ali);
00071 /* Set up block formatter around an ffAli block. */
00072 
00073 void bafSetPos(struct baf *baf, int nStart, int hStart);
00074 /* Set up block formatter starting at nStart/hStart. */
00075 
00076 void bafStartLine(struct baf *baf);
00077 /* Set up block formatter to start new line at current position. */
00078 
00079 void bafWriteLine(struct baf *baf);
00080 /* Write out a line of an alignment (which takes up
00081  * three lines on the screen. */
00082 
00083 void bafOut(struct baf *baf, char n, char h);
00084 /* Write a pair of character to block alignment. */
00085 
00086 void bafFlushLine(struct baf *baf);
00087 /* Write out alignment line if it has any characters in it. */
00088 

Generated on Tue Dec 25 18:39:29 2007 for blat by  doxygen 1.5.2