NCBI C Toolkit Cross Reference

C/doc/asn2gph.txt


  1 CONFIGURING SEQUIN'S ASN2GRAPHIC GRAPHICAL SEQUENCE VIEWER
  2 
  3 asn2graphic is a viewer for displaying biological features on sequences. It
  4 is designed to be both efficient and flexible. It is able to quickly process
  5 entire chromosomes with thousands of features, displaying them at any
  6 desired scale of magnification. Its behavior can be easily modified using a
  7 simple, human-readable configuration file.
  8 
  9 There are three questions to consider when customizing the display:
 10 
 11   1. How should a given feature be rendered?
 12   2. Which features should be displayed?
 13   3. Where should those features be positioned?
 14 
 15 asn2graphic addresses these issues by the concepts of Styles, Filters, and
 16 Layout methods, respectively. Configurations are stored in a file called
 17 asn2gph.ini (on PC), asn2gph.cnf (on Mac), or .asn2gphrc (on UNIX). Several
 18 styles and several filters can be specified, and the names for these can be
 19 presented in popup menus.
 20 
 21 Styles
 22 
 23 Styles control how features are rendered, specifying such details as color,
 24 line height, label font, and gap style. The [Styles] section lists the
 25 individual styles that are configured:
 26 
 27   [Styles]
 28   style1 = warm
 29   style2 = cool
 30   ...
 31 
 32 style00 is reserved as the built-in Default style, and should not be present
 33 in the configuration file.
 34 
 35 The [Styles] section can also have the following elements:
 36 
 37   maxarrowscale = 5
 38   minarrowpixels = 5
 39   shadesmears = false
 40 
 41 These can be overridden by settings in individual styles.
 42 
 43 Each style has a master section, and it must have an element specifying the
 44 name presented to the user:
 45 
 46   [warm.master]
 47   name = Bright Colors
 48 
 49 The master section can also override relevant global values set earlier:
 50 
 51   maxarrowscale = 5
 52   minarrowpixels = 5
 53   shadesmears = false
 54 
 55 The master section can also set defaults for the box and font used when the
 56 features of a named annotation are grouped together or when a filter
 57 displays a groupbox around its feature contents:
 58 
 59   annotboxcolor = dark grey
 60   annotlabelfont = Times, 12
 61   annotlabelcolor = black
 62   groupboxcolor = red
 63   grouplabelfont = Courier, 9
 64   grouplabelcolor = blue
 65 
 66 The master section, and specific feature sections, can include any of the
 67 following elements:
 68 
 69   color = 205, 133, 63
 70   labelfont = medium
 71   labelcolor = dark red
 72   label = above
 73   displaywith = box
 74   height = 20
 75   gap = line
 76   showarrow = no
 77   showtype = no
 78   showcontent = true
 79   shadesmears = false
 80 
 81 Note that "yes", "true", and "on" are all recognized as true, and "no",
 82 "false", and "off" are all recognized as false. Note also that named colors
 83 can be prefixed by "light" or "lt" for lighter, and "dark", "drk", or "dk"
 84 for darker.
 85 
 86 Individual features can have their own sections, which can override values
 87 inherited from the master section. Only the elements that are to be changed
 88 need to be specified:
 89 
 90   [warm.cds]
 91   color = magenta
 92   labelfont = program
 93   labelcolor = magenta
 94   showarrow = yes
 95   gap = angle
 96 
 97 Alignment sections can also have a format element, the same as Bioseq's.
 98 This specifies the information included in the feature's labels:
 99 
100   [warm.align]
101   format = fasta
102 
103 Import features (e.g., exon, variation) can have an intermediate section for
104 overriding default settings. Individual import features then inherit from
105 that section:
106 
107   [warm.imp]
108   color = gray
109   labelcolor = light gray
110   showcontent = false
111 
112   [warm.exon]
113   color = green
114   showcontent = true
115 
116 Several feature sections can also indicate a named style for inheritance,
117 allowing a set of attributes to be shared among unrelated groups of
118 features:
119 
120   [UseLabels]
121   label = left
122   showtype = true
123   showcontent = true
124   height = 15
125   
126   [warm.gene]
127   usenamedstyle = UseLabels
128   labelfont = Courier,12,b
129   showarrow = yes
130   
131   [warm.mrna]
132   usenamedstyle = UseLabels
133   displaywith = outlinebox
134 
135 The Bioseq style can have the following elements:
136 
137   [warm.bioseq]
138   label = left
139   format = accn
140   scale = true
141   labelfont = system
142   scalefont = small
143   height = 10
144   scaleheight = 20
145   color = green
146   labelcolor = dark green
147   scalecolor = black
148 
149 FILTERS
150 
151 Filters control how features are grouped for display, allowing different
152 kinds of features to be collected in separate passes. Each group is placed
153 below the previous one. The [Filters] section lists the individual filters
154 that are configured:
155 
156   [Filters]
157   filter1 = mol-bio
158   filter2 = single
159   ...
160 
161 filter00 is reserved as the built-in Default filter, and should not be
162 present in the configuration file.
163 
164 The [Filters] section can also have the following elements:
165 
166   maxlabelscale = 200
167   grouppadding = 2
168   rowpadding = 2
169 
170 These can be overridden by settings in individual filters and filter groups.
171 
172 Each filter has a main section, and it must have an element specifying the
173 name presented to the user:
174 
175   [mol-bio]
176   name = Molec Biol
177 
178 The main section can also specify the following optional elements:
179 
180   layout = compact
181   grouppadding = 3
182   rowpadding = 5
183   suppressbioseq = false
184   suppressgraphs = false
185   annotgroup = true
186   annotbox = true
187   annotlabel = above
188   annotboxcolor = grey
189   annotlabelcolor = black
190   annotlabelfont = program
191 
192 By default, the Bioseq and scale are placed above the first group, and
193 graphs (e.g., base quality scores) are placed below the last group. These
194 can be overridden with the "suppressbioseq" and "suppressgraphs" elements.
195 
196 If annotgroup is true (which it is by default) features and alignments that
197 are within a named annotation will be grouped separately. A box can
198 optionally be drawn around them (annotbox) and the section can be labeled
199 with the annotation's name (annotlabel). The other 'annot' color and font
200 settings override the style settings with the same names.
201 
202 The main section must also specify a list of filter groups:
203 
204   group1 = bioseq-and-scale
205   group2 = gene-mrna-cds-prot
206   group3 = rnas
207   group4 = intron-exon
208   group5 = everything-else
209   ...
210 
211 Each group has its own named sections, and these could be used by more than
212 one filter. The group lists the individual feature types collected in that
213 pass:
214 
215   [filters.gene-mrna-cds-prot]
216   feature1 = gene
217   feature2 = mrna
218   feature3 = cds
219   feature4 = prot
220 
221 Note that "everything" or "all" collect all remaining features, "rna" and
222 "prot" collect all remaining RNAs or proteins, respectively, and "bioseq"
223 and "graph" as feature values override the default placement of the Bioseq
224 or graphs.
225 
226 In each group, the following elements can also be specified:
227 
228   name = Gene-mRNA-CDS-Prots
229   layout = geneproducts
230   grouppadding = 3
231   rowpadding = 5
232   groupbox = true
233   groupboxcolor = 150, 100, 50
234   fillbox = false
235   grouplabel = above
236   grouplabelfont = large
237   grouplabelcolor = dark grey
238   label = above
239   showtype = true
240   showcontent = true
241   strand = both
242 
243 Features pass through the groups until they match. Thus, if two different
244 groups match the same type of feature, these features will only appear in
245 the first matching group. This simplifies the creation of "everything else"
246 groups. A filter that includes "everything" only displays features not yet
247 matched by a previous group.
248 
249 If an element of a filter group has the same name as one in a style section
250 (e.g., label, showtype, showcontent), any value specified in the filter
251 group overrides that set in the style section.
252 
253 LAYOUT METHODS
254 
255 A filter group can specify a layout method if it does not want to inherit
256 the default value. This determines how features in a group are packaged with
257 respect to each other. The possible choices are:
258 
259   inherit -      Inherits the default value.
260 
261   diagonal -     Each feature is placed in a different row.
262 
263   compact -      Attempts to minimize the number of rows, without permitting
264                  features or labels to overlap.
265 
266   bytype -       Features are grouped by type, and the groups are separated
267                  vertically. Within each group neither features nor labels
268                  will overlap.
269 
270   smear -        Features are grouped by type, but each group occupies only
271                  one row. Overlapping features are drawn as an ambiguous
272                  smear.
273 
274   geneproducts - Similar to compact, but genes, mRNAs, and CDS features are
275                  treated specially. Genes are displayed first, then pairs of
276                  mRNAs followed by the CDSs they encode. This clearly shows
277                  mRNA/CDS pair combinations in alternative splicings.
278 
279 PARSER REFERENCE
280 
281 When parsing colors, the following named colors are recognized:
282 
283   black, blue, brown, coral, cyan, gray, green, grey, lavender, magenta,
284   maroon, orange, olive, pink, purple, red, white, yellow
285 
286 Variations on these colors are supported with the light/lt or dark/drk/dk
287 prefixes.
288 
289 Colors can also be specified using a triplet of numbers to represent the
290 red, green, and blue intensities (in that order). The numbers must be
291 integers between 0 and 255 inclusive. The numbers can be separated with
292 commas, which improves readability.
293 
294 Fonts are parsed as the typeface name and the point size, separated by a
295 comma. For example:
296 
297   labelfont = Courier,12
298 
299 Modifiers can optionally be added after the size: "b" for bold, "i" for
300 italic, and "u" for underline (in any combination).
301 
302   labelfont = Helvetica,24,ib
303 
304 Also, a few named fonts are recognized: "system" and "program" are the
305 (platform-specific) default fonts. "small", "medium", and "large" are also
306 recognized.
307 
308 There are several ways that features can be rendered. These are controlled
309 by the displaywith element in a style. The following values are recognized:
310 
311   none, line, cappedline, box, outlinebox
312 
313 Feature labels can be displayed in several locations, which are controlled
314 by the label element. The values can be one of:
315 
316   above, top, left, below, inside, none
317 
318 Filter and annotation groups can also have labels. The grouplabel and
319 annotlabel element can be one of:
320 
321   above, top, left, below, none
322 
323 Sometimes it is desirable to create a filter group that only matches
324 features on a specific strand. This is done by specifying a strand element.
325 Values of "plus" or "minus" refer to features only on those strands. The
326 default value is "both".
327 
328 A Bioseq or alignment style has several options for its label, which are
329 controlled by the format element. These include:
330 
331   accession, accn, fasta, long
332 
333 The accession or accn choices show the accession.version (U54469.1), while
334 fasta shows the short FASTA parsable form (gb|U54469.1|), and long shows the
335 long FASTA form (gb|1322283|gb|U54469.1).
336 
337 Bioseq label locations can be one of:
338 
339   above, top, left, below, none
340 
341 PROGRAMMING
342 
343 asn2graphic uses the picture component of Vibrant, the graphical user
344 interface mocule of NCBI's C language software toolkit. Pictures are a
345 Vibrant memory structure containing the primitive graphical elements to be
346 displayed. Interactive programs then attach the picture to a viewer in order
347 to be displayed. Web servers can instead generate a GIF from the picture by
348 linking with the vibgif library, and do not link in the vibrant library.
349 
350 Applications must #include <asn2graphic.h> to get the basic function
351 prototypes. CreateGraphicView collects features on a Bioseq (optionally
352 limited to a specific subregion) and creates a SegmenT, the internal data
353 type for a picture:
354 
355   NLM_EXTERN SegmenT CreateGraphicView (
356     BioseqPtr bsp,
357     SeqLocPtr location,
358     Int4 scale,
359     CharPtr styleName,
360     CharPtr filterName,
361     CharPtr overrideLayout
362   );
363 
364 The following functions parse the configuration file and return lists of
365 style, filter, and layout names, respectively:
366 
367   NLM_EXTERN CharPtr PNTR GetStyleNameList (void);
368   NLM_EXTERN CharPtr PNTR GetFilterNameList (void);
369   NLM_EXTERN CharPtr PNTR GetLayoutNameList (void);
370 
371 Graphic view in Sequin has popup menus for Style and Filter populated from
372 these procedures.
373 
374 Functions in the private header <asn2graphicp.h> control parsing of the
375 configuration file, or generating styles and filters programmatically if you
376 do not wish to use or provide an asn2gph file. However, it is easier to use
377 TransientSetAppParam to simulate the configuration file than to use these
378 functions.
379 

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.