NCBI C Toolkit Cross Reference

C/desktop/ingengraph.h


  1 /*   ingengraph.h
  2 * ===========================================================================
  3 *
  4 *                            PUBLIC DOMAIN NOTICE
  5 *            National Center for Biotechnology Information (NCBI)
  6 *
  7 *  This software/database is a "United States Government Work" under the
  8 *  terms of the United States Copyright Act.  It was written as part of
  9 *  the author's official duties as a United States Government employee and
 10 *  thus cannot be copyrighted.  This software/database is freely available
 11 *  to the public for use. The National Library of Medicine and the U.S.
 12 *  Government do not place any restriction on its use or reproduction.
 13 *  We would, however, appreciate having the NCBI and the author cited in
 14 *  any work or product based on this material
 15 *
 16 *  Although all reasonable efforts have been taken to ensure the accuracy
 17 *  and reliability of the software and data, the NLM and the U.S.
 18 *  Government do not and cannot warrant the performance or results that
 19 *  may be obtained by using this software or data. The NLM and the U.S.
 20 *  Government disclaim all warranties, express or implied, including
 21 *  warranties of performance, merchantability or fitness for any particular
 22 *  purpose.
 23 *
 24 * ===========================================================================
 25 *
 26 * File Name:  ingengraph.h
 27 *
 28 * Author:  Fasika Aklilu
 29 *
 30 * Version Creation Date:   4/26/01
 31 *
 32 * $Revision: 6.6 $
 33 *
 34 * File Description: 
 35 *
 36 * Modifications:  
 37 * --------------------------------------------------------------------------
 38 * Date     Name        Description of modification
 39 * -------  ----------  -----------------------------------------------------
 40 *
 41 *
 42 * ==========================================================================
 43 */
 44 
 45 #ifndef _INGENGRAPH_
 46 #define _INGENGRAPH_
 47 
 48 #ifdef __cplusplus
 49 extern "C" {
 50 #endif
 51 
 52 #include <seqmgr.h>
 53 #include <ncbi.h>
 54 #include <vibrant.h> 
 55 #include <picture.h> 
 56 #include <viewer.h> 
 57 #include <objmgr.h> 
 58 #include <sequtil.h>
 59 #include <explore.h>
 60 #include <gather.h>
 61 #include <seqport.h>
 62 #include <sqnutils.h>
 63 #include <alignmgr2.h>
 64 #include <jsavlt.h>
 65 
 66 /******************************************************
 67  *
 68  *  defines for the Genome Viewer of UDV
 69  *
 70 ******************************************************/
 71 #define FEATURE_SEGMENT_MAXSIZE 500 /*a segment contains a max of 500 features*/
 72 #define Ing_FEAT_LINEDECAL 20/* was 8 */ /*on the Feature Viewer, the line height is 8 pixels*/
 73 #define Ing_FEAT_HEIGHT 2 /*on the Feature Viewer the height of a Feature is 3 pixels*/
 74 #define LEVEL1_MAXNUM  20 /* top level segment contains max of 20 level 2 segments */
 75 #define LEVEL2_MAXNUM  20 /* second level segment contains max of 20 level 3 segments */
 76 #define COMPRESS_SCALE 500
 77 
 78 #define Ing_black       121
 79 #define Ing_red         122
 80 #define Ing_blue        123
 81 #define Ing_green       124
 82 #define Ing_cyan        125
 83 #define Ing_magenta     126
 84 #define Ing_purple      127
 85 #define Ing_yellow      128
 86 #define Ing_grey        129
 87 #define Ing_MAX         130
 88 
 89 #define Ing_GENSCAN   110
 90 #define ALIGN_ANNOT    111 /* alignment from running blast vs. db */
 91 #define Ing_SPIDEY    112
 92 #define ALIGN_FILE     113/* alignment from asn file */
 93 #define ALIGN_BLAST    114/* alignment annotated on sequence */
 94 #define ALIGN_BLAST2SEQ    115 /* alignment from running blast2seq */
 95 #define Ing_ORF       116
 96 #define Ing_SUMMARY   117
 97 #define Ing_FEAT_TABLE 118
 98 #define Ing_TBDL    119
 99 #define Ing_SEQIDLISTFORSPIDEY 120
100 #define Ing_SEQIDLISTFORBLAST 121
101 #define Ing_DOTMATRIX 122
102 
103 /******************************************************
104  *
105  *  data structures for the Genome Viewer 
106  *
107 ******************************************************/
108 
109 
110 typedef struct gvpopfeat{/*data structure used to populate features viewer*/
111   SegmenT   pictRuler;
112   SegmenT   pictMain;
113   SegmenT   CurrentSeg;
114   SegmenT   seg1;
115   SegmenT   seg2;
116   Uint1Ptr  PNTR pClr;
117   Boolean    showLabels;
118   Boolean    bSaved;
119   Boolean    bTrim;
120   Uint4      nSegs; /* number of subsegments below Current segment */
121   Uint4      nPrims;  /* prim counter */
122   Uint4      nLevel3; /* level 3 segments counter */
123   Uint4      nLevel2; /* level 2 segments counter */
124   Uint4      nLevel1; /* level 1 segments counter */
125   ValNodePtr  PopRowsList;
126   ValNodePtr  vnp_top10; /* used to trim linked list */
127   ValNodePtr  vnp_last;
128   ValNodePtr  group1;
129   ValNodePtr  group1_last;
130   ValNodePtr  group2;
131   ValNodePtr  group2_last;
132   ValNodePtr  group3;
133   ValNodePtr  group3_last;
134   Int4      nPopRows;      /* feature row counter */
135   Int4      yBase;
136   Int4      scaleX;         
137   Int4      max_label;      /* width of largest label */
138   SeqLocPtr  slp;
139   Int4       left;
140   Int4       right;
141 } IngPopFeat, PNTR IngPopFeatPtr;
142 
143 
144 typedef struct gvgraphdata{
145         /*font size*/
146         Int2 cxChar;
147         Int2 cyChar;
148   FonT hFnt;
149         /*values used to draw the rulers*/
150         Int2 SegBoxHeight;
151         Int2 SegRulerTick;
152         Int2 SegRulerIn;
153         Int4 DecalSegRuler;
154         Int4 DecalZoomRuler;
155    Uint1Ptr PNTR pClr;
156 } IngGraphData, PNTR IngGraphDataPtr;
157 
158 
159 typedef struct gvpopnames{/*used to populate the Segments in Viewer*/
160   VieweR          viewer;
161         SegmenT        seg;
162   Uint1Ptr        seqbuf;
163   Int4            scaleX;
164   Uint1           comp;
165   Boolean         bRegister;
166   Uint2           procID;
167   Uint2           userKey;
168   OMMessageFunc   messagefunc;
169   Pointer         data;
170   SeqLocPtr       slp;
171   BioseqPtr       bsp;
172   ValNodePtr      slp_list;
173   Boolean         bPopSlp;
174   Boolean         bShowGC;
175   Boolean         bLabels;
176   Boolean         bTop;
177   Int4            idx;
178   Int4            left, right;
179   IngGraphDataPtr GrData;
180 } IngExploreSegs, PNTR IngExploreSegsPtr;
181 
182 
183   typedef struct ing_trackaligns{
184     ValNodePtr  hidelist;
185     ValNodePtr  showlist;
186     CharPtr PNTR namelist;
187     CharPtr PNTR hnamelist;
188     Boolean      update;
189     Int4         showindex;
190     Int4         hideindex;
191   } IngTrackAligns, PNTR IngTrackAlignsPtr;
192 
193 
194   typedef struct ingseqannotdata{
195     Int4         sindex;
196     Int4         hindex;
197     ValNodePtr   aln_hidelist;
198     ValNodePtr   aln_showlist;
199     CharPtr PNTR aln_namelist;
200     CharPtr PNTR aln_hnamelist;
201     IngTrackAlignsPtr tap;
202   }IngSeqAnnotData;
203   
204 
205 
206   
207   typedef struct ing_entitylist{
208     ValNode *Sips;               /* list of sips in SeqEntry */
209     Uint2    entityID;
210     Uint4    itemID;
211     Int4     bspcount;
212     struct   ing_entitylist PNTR next;
213   } IngEntity, PNTR IngEntityPtr;
214   
215 
216   typedef struct win_data{
217     MenU      Edit;
218     MenU      Run;
219     MenU      Options;
220     MenU      Analysis;
221     MenU      Annotate;
222     MenU      Feat;
223     GrouP     Goto;
224     IteM      labels;
225     IteM      mrnaorexons;
226     IteM      GC;
227   } IngWinData, PNTR IngWinDataPtr;
228 
229 typedef struct ing_genomeviewer{
230   WindoW      hMain;
231   WindoW      hReport;
232   GrouP       gMain;
233   /*graphic elements*/
234   VieweR      vRuler1;
235   VieweR      vTop;
236   VieweR      vRuler2;
237   VieweR      vBottom;
238   SegmenT     pictRuler1;
239   SegmenT     pictTop;
240   SegmenT     pictRuler2;
241   SegmenT     pictBottom;
242   VieweR      vZoom;
243   SegmenT     pictZoom;
244   PrompT      featInfo[4];
245   CharPtr     defline;
246   CharPtr     defline2;
247   GrouP       deflineg;
248   PopuP       pageControl;
249   Uint2       sel_entityID;
250   Uint4       sel_itemID;
251   GrouP       Buttons;
252   IteM        item_usenetwork;
253   Boolean     update;
254   Boolean     bOverviewSelected;
255   /*data to display*/
256   Uint2       procID;
257   Uint2       userKey;
258   Uint2       entityID;
259   Uint4       itemID;
260   Uint2       itemType;
261   BioseqPtr   bsp;
262   Boolean     bspIsLocked;
263   Int4        from;
264   Int4        to;
265   Int4        SeqLength;/* length of user specified region*/
266   Int4        bspLength; /* total sequence length */
267   Int4        scale_index;
268   Int4Ptr     scale_array;
269   Int4        scaleX;
270   Int4        maxScaleX;
271   Boolean     bMaxScale;
272   IngEntityPtr entity_list;
273   Int4        numseqs;
274   Int4        ZoomedVal;
275   Int4        last_feat_position_top;
276   Int4        last_feat_position_bottom;
277   Int2        TopHeight;
278   Int4        xposition;
279   Char        title[50];
280   Boolean     bLabels;
281   Boolean     isExons;
282   Boolean     user_defined;
283   SeqLocPtr   slp;  
284   IngGraphData GrData;
285   IngTrackAligns talign;
286   IngWinDataPtr d_Win;
287   /* variables for imported features -- from sequence analysis */
288   Boolean     bDustExists;
289   Boolean     bOrfExists;
290   Boolean     bShowGC;
291   Pointer     data;
292   Uint1Ptr    seqbuf;
293   Uint1       comp; 
294   LisT bsp_list;          /* listbox of bsps */
295   SeqIdPtr    cur_sip;
296   Int2        cur_target;
297   IteM        imemory;
298   /* data info */
299   Int4        filetype; /* reading in output files */
300   Int2        nAnnotFeats;
301   /* zoom */
302   PrimitivE   zoomFbar;
303         /*internal use only*/
304   Int4       idx;
305   Boolean bSegmented;
306   /* progress notice vars */
307   CharPtr    progress_string;
308   Boolean    progress_running;
309   Int4       progress_timer;
310   PrompT     progress_prompt;
311   Char       progress_counter[20];
312 } IngGenomeViewer , * IngGenomeViewerPtr;
313 
314 
315 
316 extern Boolean IngfeatDefFilter[FEATDEF_MAX];/* filter parameter for SeqMgrExploreFeatures() */
317 
318 extern Boolean IngfeatDefTrack2[FEATDEF_MAX];/* used by Ing_AddToOverviewPage()  when scale is greater than COMPRESS_SCALE */
319 
320 extern Uint1   IngfeatDefTrack[FEATDEF_MAX];/* track features 1=exists 2=exists and is visible */
321 
322 /*******************************************************************************
323 
324         Static Function Declarations
325 
326 *******************************************************************************/
327 extern void Ing_AddGCRect(SegmenT seg, SeqIdPtr sip, Uint2 entityID, Uint4 itemID, Uint2 itemtype, Uint1Ptr seq, Int4 left, Int4 top, Int4 right, Int4 bottom, Int4 scaleX,  Uint1 strand, Boolean needs_label, Boolean clickable, Int4 idx, Boolean bShowGC);
328 
329 extern SegmenT Ing_PopulateSequinGraphic(SegmenT seg, BioseqPtr bsp, Uint2 entityID, Uint4 itemID, Int4 scaleX);
330 
331 extern void Ing_AddRuler(SegmenT seg, Int4 height, Int4 xstart,Int4 xstop, Int4 scaleX, Int4 scaleY, Boolean add_whitespace);
332 
333 extern void Ing_InitGrData(IngGraphDataPtr gdp);
334 
335 extern Uint4 Ing_PopDetailedPage(BioseqPtr bsp, SegmenT pictBottom, Int4 left, Int4 right, Uint1Ptr PNTR pClr, Int4 scaleX, Int4 start_row, Boolean Labels, Boolean isExons, IngTrackAlignsPtr tap);
336 extern Uint4 Ing_PopOverviewPage(BioseqPtr bsp, SegmenT pictTop, Int4 left, Int4 right, Uint1Ptr PNTR pClr, Int4 maxScaleX, IngTrackAlignsPtr tap);
337 
338 extern Uint1Ptr PNTR Ing_BuildColorTable(void);
339   extern Uint1Ptr PNTR Ing_FreeColorTable(Uint1Ptr PNTR pClr);
340 
341 extern Uint1Ptr  Ing_PutColor(Uint1 r, Uint1 g, Uint1 b);
342 
343 extern Boolean LIBCALLBACK Ing_ExploreSegments(SeqLocPtr slp, SeqMgrSegmentContextPtr context);
344 
345 extern void Ing_InitfeatDefFilter(void);
346 extern void Ing_SearchAli(SeqEntryPtr sep, Pointer mydata, Int4 index, Int2 indent);  
347 extern Uint8 Ing_BigEncodeIdxFeat (Uint4 val1,Uint4 val2);
348 extern void  Ing_BigDecodeIdxFeat (Uint8 index_g, Uint4Ptr val1, Uint4Ptr val2);
349 extern Boolean Ing_PopOverviewRuler(VieweR vRuler1, SegmenT pictRuler1, BioseqPtr bsp, IngGraphData GrData, Int4 from, Int4 to, Uint1Ptr seqbuf, Int4 scaleX);
350 extern Int4 Ing_GetValue (TexT t);
351 
352 
353 
354 #ifdef __cplusplus
355 }
356 #endif
357 
358 #endif /* ndef _INGENGRAPH_ */
359 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.