|
NCBI Home IEB Home C Toolkit docs C++ Toolkit source browser C Toolkit source browser (2) |
NCBI C Toolkit Cross ReferenceC/desktop/dotviewer.h |
source navigation diff markup identifier search freetext search file search |
1 /* dotviewer.h*/
2
3 #ifndef _DOTVIEWER_
4 #define _DOTVIEWER_
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10
11 /****************************************************************************
12
13 INCLUDE SECTION
14 ***************************************************************************/
15 #include <ncbi.h>
16 #include <accentr.h>
17 #include <vibrant.h>
18 #include <picture.h>
19 #include <picturep.h>
20 #include <viewer.h>
21 #include <tofasta.h>
22 #include <ncbidraw.h>
23 #include <seqport.h>
24 #include <sequtil.h>
25 #include <blastkar.h>
26 #include <blastpri.h>
27 #include <blastdef.h>
28 #include <objseq.h>
29 #include <salpstat.h>
30 #include <seqmgr.h>
31 #include <seqgraph.h>
32 #include <actutils.h>
33 #include <alignmgr.h>
34 #include <dotseq.h>
35
36
37 /****************************************************************************
38
39 DEFINES SECTION
40 ***************************************************************************/
41 /* scoop defines */
42 #define SCP_IDENTITY 0
43 #define SCP_CONTAINS 1
44 #define SCP_ISCONTAINED 2
45 #define SCP_DOVETAIL 3
46 #define SCP_HALFTAIL1 4
47 #define SCP_HALFTAIL2 5
48 #define SCP_MIDDLE 6
49 #define SCP_REPEATS 7
50 #define SCP_LARGE 1000
51 #define SCP_FUZZ 50
52 /* scoop defines - end*/
53
54 #define REGISTER_DiagsDisplay ObjMgrProcLoad (OMPROC_EDIT, "DOT_DiagsDisplay", "DOT_DiagsDisplay", OBJ_MAX, 0, OBJ_VIBRANT_PICTURE, 0, NULL, DOT_RegDiagsDisplay, PROC_PRIORITY_HIGHEST);
55
56
57 /****************************************************************************
58
59 DATA STRUCTURE SECTION
60 ***************************************************************************/
61
62 /*******************************************************
63 * temporary form structures *
64 ********************************************************/
65 typedef struct dot_blastinfo
66 {
67 BioseqPtr bsp1;
68 BioseqPtr bsp2;
69 GrouP localorglobal;
70 GrouP progname;
71 GrouP gapped;
72 TexT eval;
73 TexT wordsize;
74 ButtoN newblast;
75 ButtoN maskrep;
76 ButtoN masksimple;
77 } DOTblastinfo, PNTR DOTblastinfoPtr;
78
79 typedef struct dot_displayinfo
80 {
81 GrouP BLASTorDotPlot;
82 GrouP grid;
83 } DOTdisplayinfo, PNTR DOTdisplayinfoPtr;
84
85
86 typedef struct dot_paramsinfo
87 {
88 TexT xstart;
89 TexT xstop;
90 TexT ystart;
91 TexT ystop;
92 TexT word_size;
93 TexT tree_limit;
94 } DOTparamsinfo, PNTR DOTparamsinfoPtr;
95
96 /* scoop typedefs */
97 typedef struct scp_repeat {
98 Int4 from1;
99 Int4 to1;
100 Int4 from2;
101 Int4 to2;
102 Uint1 strand2;
103 struct scp_repeat PNTR next;
104 } SCP_Rpt, PNTR SCP_RptPtr;
105
106 typedef struct scp_result {
107 Int4 relationship;
108 Int4 len1;
109 Int4 len2;
110 Int4 numsaps;
111 SeqAlignPtr PNTR saps;
112 Int4 numlarge_outliers;
113 SeqAlignPtr PNTR large_outliers;
114 Int4 numsmall_outliers;
115 SeqAlignPtr PNTR small_outliers;
116 SCP_RptPtr repeats;
117 } SCP_Result, PNTR SCP_ResultPtr;
118
119 typedef struct scp_n {
120 Int4 n1;
121 Int4 n2;
122 Int4 n3;
123 Int4 n4;
124 Int4 n5;
125 } SCP_n, PNTR SCP_nPtr;
126 /* scoop typedefs - end */
127
128 /*******************************************************
129 * storage for alignment display *
130 ********************************************************/
131
132 typedef struct saln {
133 Uint1 show;
134 Int4 q_start;
135 Int4 q_stop;
136 Int4 s_start;
137 Int4 s_stop;
138 Int1 class;
139 SeqAlignPtr sap;
140 Uint2 entityID;
141 Uint2 itemID;
142 Uint2 primID;
143 struct saln PNTR next;
144 } DOTAln, PNTR DOTAlnPtr;
145
146 typedef struct algn{
147 Uint2 entityID;
148 Uint2 itemID;
149 Int4 xlen;
150 Int4 ylen;
151 Int4 xstart;
152 Int4 ystart;
153 Int4 Fh;
154 WindoW w;
155 VieweR v;
156 SeqAlignPtr sap;
157 SegmenT pict;
158 SegmenT seg1;
159 PopuP scale;
160 Int4 scaleValue;
161 Int4 scaleIndex;
162 Boolean showLabels;
163 Boolean do_scale;
164 PrompT Infopanel;
165 CharPtr title;
166 CharPtr name1, name2;
167 SeqIdPtr sip;
168 Int4Ptr PNTR matrix; /* dna matrix */
169 Boolean is_na;
170 Int4 HORZ_MARGIN;
171 Int4 VERT_MARGIN;
172 Int4 index; /* num. of alignments */
173 DOTAlnPtr PNTR Alnlist;
174 } DOTAlignInfo, PNTR DOTAlignInfoPtr;
175
176
177 /*******************************************************
178 * scroll and threshold data *
179 ********************************************************/
180
181 typedef struct scrolldata {
182 /* threshold bar info */
183 BaR ScrollBar;
184 Int4 TrampPos;
185 /* main window scroll information */
186 Int4 YScrlMax;
187 Int4 XScrlMax;
188 Int4 YScrlPos;
189 Int4 XScrlPos;
190 Int4 UnitY;
191 Int4 UnitX;
192 Int4 TotUnitsY;
193 Int4 TotUnitsX;
194 Int4 PgWdth;
195 Int4 PgLen;
196 Int4 YScrlPage;
197 Int4 XScrlPage;
198 /* scroll positions in pixel coordinates */
199 Int4 HFrom;
200 Int4 VFrom;
201 } DOTScrollData, PNTR DOTScrollDataPtr;
202
203
204 /*******************************************************
205 * store sequence data on selected region for new display*
206 * *
207 ********************************************************/
208 typedef struct seqviewr{
209 Boolean do_scale;
210 PopuP scale, showp;
211 Int4 scaleIndex;
212 Int4 scaleValue;
213 GrouP Labels;
214 Boolean showLabels;
215 PoinT old_pt;
216 Int2 old_primID;
217 Uint2 highlight;
218 SegmenT pict1;
219 SegmenT pict2;
220 DOTAlnPtr salp;
221 VieweR v1;
222 VieweR v2;
223 WindoW w;
224 Int4 barp;
225 } DOTSeqViewr, PNTR DOTSeqViewrPtr;
226
227
228 /*******************************************************
229 * main vibrant data structure *
230 ********************************************************/
231 typedef struct dotvibdata{
232 WindoW MainWin;
233 WindoW ChildWin;
234 Int4 curr_slen;
235 Int4 curr_qlen;
236 Int4 xlen, ylen;
237 PaneL panel;
238 Boolean showGrid;
239 Boolean showDotPlot;
240 Boolean showALIGN;
241 PrompT Infopanel;
242 Char iInfo[255];
243 Int4 comp;
244 Int4 originalcomp;
245 /* Alignment options */
246 Boolean Blast2Seq_show;
247 MenU displayOpts1;
248 ChoicE displayOpts2;
249 GrouP Ggoto;
250 Int4 ystart, xstart, ystop, xstop;
251 CharPtr xname;
252 CharPtr yname;
253 Uint1Ptr seq1, seq2;
254 Uint1 strand1, strand2;
255 DOTAlignInfoPtr alp;
256 /* second window elements */
257 DOTSeqViewrPtr sv;
258 DOTScrollData sdp;
259 Uint2 selectMode;
260 VoidPtr data;
261 FonT Fnt;
262 Int4 Fh;
263 Int4 charw;
264 Int4 VERT_MARGIN;
265 Int4 HORZ_MARGIN;
266 DOTMainDataPtr mip;
267 } DOTVibData, PNTR DOTVibDataPtr;
268
269
270 /*******************************************************
271 * structures to store feature data for the feature viewer *
272 ********************************************************/
273
274 typedef struct dot_feat_info {
275 CharPtr label;
276 Int4 left;
277 Int4 right;
278 Uint1 strand;
279 Int2 type;
280 struct dot_feat_info PNTR next;
281 } DOTFeat, PNTR DOTFeatPtr;
282
283
284 typedef struct dot_row {
285 DOTFeatPtr dfp;
286 } DOTRow, PNTR DOTRowPtr;
287
288 typedef struct dot_featindex {
289 CharPtr label;
290 Boolean present;
291 Boolean show;
292 Int2 deref;
293 } DOTFeatIndex, PNTR DOTFeatIndexPtr;
294
295
296 typedef struct dot_popfeat{
297 VieweR TopParentView;
298 SegmenT TopParentSeg;
299 DOTRowPtr drp;
300 DOTFeatIndexPtr featindex;
301 DOTFeatPtr dfp_cur;
302 Int4 nfeats;
303 Int2 fontHeight;
304 } DOTPopFeat, PNTR DOTPopFeatPtr;
305
306
307 typedef struct dot_feats_list{
308 WindoW FeatWin;
309 WindoW hFeatDlg;
310 VieweR Query;
311 SegmenT segQuery;
312 SegmenT segQName;
313 SegmenT segQCursor;
314 VieweR Subject;
315 SegmenT segSubject;
316 SegmenT segSName;
317 SegmenT segSCursor;
318 Int4 qFeatscount;
319 Int4 sFeatscount;
320 Int2 fontHt;
321 Int4 vert_Qpos;
322 Int4 vert_Spos;
323 Uint2 procID;
324 Uint2 userKey;
325 Uint2 entityID;
326 Uint2 itemID;
327 LisT featList;
328 PrompT QInfo;
329 PrompT SInfo;
330 DOTRowPtr query_drp;
331 DOTRowPtr subject_drp;
332 DOTFeatIndexPtr featindex;
333 Int4 numrows; /* list of feature types */
334 VoidPtr data;
335 DOTMainDataPtr mip;
336 } DOTFeatList, PNTR DOTFeatListPtr;
337
338 typedef struct dot_sel_feat{
339 Int4 feat_num;
340 struct dot_sel_feat PNTR next;
341 } DOTSelFeat, PNTR DOTSelFeatPtr;
342
343
344 /*******************************************************
345 * store sequence data on selected region for new display*
346 * *
347 ********************************************************/
348
349
350 typedef struct selectdata{
351 Int4 q_start;
352 Int4 s_start;
353 Int4 q_stop;
354 Int4 s_stop;
355 Int4 xstart, xstop, ystart, ystop;
356 Int4 qlen;
357 Int4 slen;
358 RecT rcS;
359 RecT old_rcS;
360 RecT rcP;
361 Boolean selected;
362 Boolean rm_lastselected;
363 Int2 H_pos;
364 Int2 V_pos;
365 DOTVibDataPtr vdp;
366 } DOTSelData, PNTR DOTSelDataPtr;
367
368
369
370 /****************************************************************************
371
372 FUNCTION DECLARATIONS
373 ***************************************************************************/
374 NLM_EXTERN Int2 LIBCALLBACK DOT_RegDiagsDisplay(Pointer data);
375 NLM_EXTERN Boolean DOT_MakeMainViewer(DOTMainDataPtr vdp, DOTAlignInfoPtr alp);
376 NLM_EXTERN Boolean DOT_AlignPlotGivenSeqAlign(SeqAlignPtr sap);
377 NLM_EXTERN Boolean DOT_AlignPlotGivenScp(SCP_ResultPtr scp);
378
379 extern DOTAlignInfoPtr DOT_AlignInfoNew();
380 extern Boolean DOT_FillAlignInfoPointer (DOTAlignInfoPtr alp);
381 extern Int4 DOT_GetValue(TexT t);
382
383 /* scoop declarations */
384 NLM_EXTERN SCP_ResultPtr SCP_CompareOrderOrganizeBioseqs(BioseqPtr bsp1, BioseqPtr bsp2, SeqLocPtr slp1, SeqLocPtr slp2, CharPtr progname, Int4 wordsize, Int4 hitlist_size);
385
386 extern void SCP_OrganizeAlnsInSet(SeqAlignPtr sap, Int4 fuzz, SCP_ResultPtr scp, Int4 n);
387 /* scoop declarations - end */
388
389 #ifdef __cplusplus
390 }
391 #endif
392
393 #endif /* _DOTVIEWER_ */
394
395 |
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more information. |