.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Bio::Graphics::Glyph::whiskerplot 3pm" .TH Bio::Graphics::Glyph::whiskerplot 3pm "2019-11-25" "perl v5.30.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Graphics::Glyph::whiskerplot \- The whiskerplot glyph .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& See L and L. .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This glyph is used for drawing features associated with numeric data using \*(L"box and whisker\*(R" style data points, which display the mean value, extreme ranges and first and third quartiles (or standard deviation). The boxes drawn by this glyph are similar to , except that they are oriented vertically so that the position and height of the box indicates the mean value and spread of the data, and the width indicates the genomic extent of the value. .PP Like the xyplot glyph (from which it inherits the whiskerplot is designed to work on a single feature group that contains subfeatures. It is the subfeatures that carry the score information. The best way to arrange for this is to create an aggregator for the feature. We'll take as an example a histogram of repeat density in which interval are spaced every megabase and the score indicates the number of repeats in the interval; we'll assume that the database has been loaded in in such a way that each interval is a distinct feature with the method name \*(L"density\*(R" and the source name \*(L"repeat\*(R". Furthermore, all the repeat features are grouped together into a single group (the name of the group is irrelevant). If you are using Bio::DB::GFF and Bio::Graphics directly, the sequence of events would look like this: .PP .Vb 6 \& my $agg = Bio::DB::GFF::Aggregator\->new(\-method => \*(Aqrepeat_density\*(Aq, \& \-sub_parts => \*(Aqdensity:repeat\*(Aq); \& my $db = Bio::DB::GFF\->new(\-dsn=>\*(Aqmy_database\*(Aq, \& \-aggregators => $agg); \& my $segment = $db\->segment(\*(AqChr1\*(Aq); \& my @features = $segment\->features(\*(Aqrepeat_density\*(Aq); \& \& my $panel = Bio::Graphics::Panel\->new; \& $panel\->add_track(\e@features, \& \-glyph => \*(Aqxyplot\*(Aq, \& \-scale => \*(Aqboth\*(Aq, \&); .Ve .PP If you are using Generic Genome Browser, you will add this to the configuration file: .PP .Vb 2 \& aggregators = repeat_density{density:repeat} \& clone alignment etc .Ve .PP Note that it is a good idea to add some padding to the left and right of the panel; otherwise the scale will be partially cut off by the edge of the image. .PP The mean (or median) of the data will be taken from the feature score. The range and quartile data must either be provided in a feature tag named \*(L"range\*(R", or must be generated dynamically by a \&\-range callback option passed to add_track. The data returned by the tag or option should be an array reference containing the following five fields: .PP .Vb 1 \& [$median,$range_low,$range_high,$quartile_low,$quartile_high] .Ve .PP where \f(CW$range_low\fR and \f(CW$range_high\fR correspond to the low and high value of the \*(L"whiskers\*(R" and \f(CW$quartile_low\fR and \f(CW$quartile_high\fR correspond to the low and high value of the \*(L"box.\*(R" .PP If \f(CW$median\fR is undef or missing, then the score field of the feature will be used instead. It may be useful to repeat the median in the score field in any case, in order to allow the minimum and maximum range calculations of the graph itself to occur. .PP See Examples for three ways of generating an image. .SS "\s-1OPTIONS\s0" .IX Subsection "OPTIONS" The following options are standard among all Glyphs. See Bio::Graphics::Glyph for a full explanation. .PP .Vb 2 \& Option Description Default \& \-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\- \& \& \-fgcolor Foreground color black \& \& \-outlinecolor Synonym for \-fgcolor \& \& \-bgcolor Background color turquoise \& \& \-fillcolor Synonym for \-bgcolor \& \& \-linewidth Line width 1 \& \& \-height Height of glyph 10 \& \& \-font Glyph font gdSmallFont \& \& \-label Whether to draw a label 0 (false) \& \& \-description Whether to draw a description 0 (false) \& \& \-hilite Highlight color undef (no color) .Ve .PP In addition, the alignment glyph recognizes all the options of the xyplot glyph, as well as the following glyph-specific option: .PP .Vb 2 \& Option Description Default \& \-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\- \& \& \-range Callback to return median, none \- data comes from feature "range" tag \& range and quartiles for each \& sub feature .Ve .SH "EXAMPLES" .IX Header "EXAMPLES" Here are three examples of how to use this glyph. .SS "Example 1: Incorporating the numeric data in each subfeature" .IX Subsection "Example 1: Incorporating the numeric data in each subfeature" .Vb 2 \& #!/usr/bin/perl \& use strict; \& \& use Bio::Graphics; \& use Bio::SeqFeature::Generic; \& \& my $bsg = \*(AqBio::SeqFeature::Generic\*(Aq; \& \& my $feature = $bsg\->new(\-start=>0,\-end=>1000); \& \& for (my $i=0;$i<1000;$i+=20) { \& my $y = (($i\-500)/10)**2; \& my $range = make_range($y); \& my $part = $bsg\->new(\-start=>$i,\-end=>$i+16, \& \-score=>$y,\-tag => { range=>$range }); \& $feature\->add_SeqFeature($part); \& } \& \& my $panel = Bio::Graphics::Panel\->new(\-length=>1000,\-width=>800,\-key_style=>\*(Aqbetween\*(Aq, \& \-pad_left=>40,\-pad_right=>40); \& $panel\->add_track($feature, \& \-glyph=>\*(Aqarrow\*(Aq, \& \-double=>1, \& \-tick=>2); \& \& $panel\->add_track($feature, \& \-glyph=>\*(Aqwhiskerplot\*(Aq, \& \-scale=>\*(Aqboth\*(Aq, \& \-height=>200, \& \-min_score => \-500, \& \-key =>\*(AqWhiskers\*(Aq, \& \-bgcolor => \*(Aqorange\*(Aq, \& ); \& print $panel\->png; \& \& sub make_range { \& my $score = shift; \& my $range_top = $score + 5*sqrt($score) + rand(50); \& my $range_bottom = $score \- 5*sqrt($score) \- rand(50); \& my $quartile_top = $score + 2*sqrt($score) + rand(50); \& my $quartile_bottom = $score \- 2*sqrt($score) \- rand(50); \& return [$score,$range_bottom,$range_top,$quartile_bottom,$quartile_top]; \& } .Ve .SS "Example 2: Generating the range data with a callback" .IX Subsection "Example 2: Generating the range data with a callback" .Vb 2 \& #!/usr/bin/perl \& use strict; \& \& use Bio::Graphics; \& use Bio::SeqFeature::Generic; \& \& my $bsg = \*(AqBio::SeqFeature::Generic\*(Aq; \& my $feature = $bsg\->new(\-start=>0,\-end=>1000); \& \& for (my $i=0;$i<1000;$i+=20) { \& my $y = (($i\-500)/10)**2; \& my $part = $bsg\->new(\-start=>$i,\-end=>$i+16,\-score=>$y); \& $feature\->add_SeqFeature($part); \& } \& \& my $panel = Bio::Graphics::Panel\->new(\-length=>1000,\-width=>800,\-key_style=>\*(Aqbetween\*(Aq, \& \-pad_left=>40,\-pad_right=>40); \& $panel\->add_track($feature, \& \-glyph=>\*(Aqarrow\*(Aq, \& \-double=>1, \& \-tick=>2); \& \& $panel\->add_track($feature, \& \-glyph=>\*(Aqwhiskerplot\*(Aq, \& \-scale=>\*(Aqboth\*(Aq, \& \-height=>200, \& \-min_score => \-500, \& \-key =>\*(AqWhiskers\*(Aq, \& \-bgcolor => \*(Aqorange\*(Aq, \& \-range => \e&make_range, \& ); \& print $panel\->png; \& \& sub make_range { \& my $feature = shift; \& my $score = $feature\->score; \& my $range_top = $score + 5*sqrt($score) + rand(50); \& my $range_bottom = $score \- 5*sqrt($score) \- rand(50); \& my $quartile_top = $score + 2*sqrt($score) + rand(50); \& my $quartile_bottom = $score \- 2*sqrt($score) \- rand(50); \& return [$score,$range_bottom,$range_top,$quartile_bottom,$quartile_top]; \& } .Ve .SS "Example 3: Generating the image from a FeatureFile" .IX Subsection "Example 3: Generating the image from a FeatureFile" .IP "The file:" 4 .IX Item "The file:" .Vb 4 \& [general] \& pixels = 840 \& pad_left = 40 \& pad_right = 40 \& \& [contig] \& glyph = arrow \& double = 1 \& tick = 2 \& \& [data] \& glyph = whiskerplot \& scale = both \& height = 200 \& min_score = \-500 \& max_score = 2800 \& key = Whiskers \& bgcolor = orange \& \& chr1 . contig 1 1000 . . . Contig chr1 \& chr1 . data 0 16 2500 . . Dataset data1; range 2209,2769,2368,2619 \& chr1 . data 20 36 2304 . . Dataset data1; range 2051,2553,2163,2435 \& chr1 . data 40 56 2116 . . Dataset data1; range 1861,2384,1983,2253 \& chr1 . data 60 76 1936 . . Dataset data1; range 1706,2181,1819,2059 \& chr1 . data 80 96 1764 . . Dataset data1; range 1516,1995,1646,1849 \& chr1 . data 100 116 1600 . . Dataset data1; range 1359,1834,1513,1699 \& chr1 . data 120 136 1444 . . Dataset data1; range 1228,1654,1330,1565 \& chr1 . data 140 156 1296 . . Dataset data1; range 1105,1520,1198,1385 \& chr1 . data 160 176 1156 . . Dataset data1; range 983,1373,1062,1270 \& chr1 . data 180 196 1024 . . Dataset data1; range 853,1184,914,1116 \& chr1 . data 200 216 900 . . Dataset data1; range 722,1093,801,965 \& chr1 . data 220 236 784 . . Dataset data1; range 621,945,724,859 \& chr1 . data 240 256 676 . . Dataset data1; range 532,833,605,742 \& chr1 . data 260 276 576 . . Dataset data1; range 433,714,485,653 \& chr1 . data 280 296 484 . . Dataset data1; range 331,600,418,545 \& chr1 . data 300 316 400 . . Dataset data1; range 275,535,336,459 \& chr1 . data 320 336 324 . . Dataset data1; range 198,434,270,374 \& chr1 . data 340 356 256 . . Dataset data1; range 167,378,219,322 \& chr1 . data 360 376 196 . . Dataset data1; range 114,303,118,249 \& chr1 . data 380 396 144 . . Dataset data1; range 39,248,87,197 \& chr1 . data 400 416 100 . . Dataset data1; range 17,173,68,141 \& chr1 . data 420 436 64 . . Dataset data1; range \-14,125,18,84 \& chr1 . data 440 456 36 . . Dataset data1; range \-8,74,11,64 \& chr1 . data 460 476 16 . . Dataset data1; range \-46,77,0,43 \& chr1 . data 480 496 4 . . Dataset data1; range \-40,43,\-7,36 \& chr1 . data 500 516 0 . . Dataset data1; range \-43,0,\-43,22 \& chr1 . data 520 536 4 . . Dataset data1; range \-6,52,\-4,54 \& chr1 . data 540 556 16 . . Dataset data1; range \-5,38,\-27,52 \& chr1 . data 560 576 36 . . Dataset data1; range \-43,109,18,66 \& chr1 . data 580 596 64 . . Dataset data1; range \-1,134,3,112 \& chr1 . data 600 616 100 . . Dataset data1; range 49,186,69,124 \& chr1 . data 620 636 144 . . Dataset data1; range 79,225,71,169 \& chr1 . data 640 656 196 . . Dataset data1; range 124,289,120,266 \& chr1 . data 660 676 256 . . Dataset data1; range 154,378,197,320 \& chr1 . data 680 696 324 . . Dataset data1; range 220,439,249,396 \& chr1 . data 700 716 400 . . Dataset data1; range 291,511,331,458 \& chr1 . data 720 736 484 . . Dataset data1; range 350,627,400,572 \& chr1 . data 740 756 576 . . Dataset data1; range 446,718,502,633 \& chr1 . data 760 776 676 . . Dataset data1; range 515,833,576,777 \& chr1 . data 780 796 784 . . Dataset data1; range 606,959,724,856 \& chr1 . data 800 816 900 . . Dataset data1; range 747,1058,799,1004 \& chr1 . data 820 836 1024 . . Dataset data1; range 817,1231,958,1089 \& chr1 . data 840 856 1156 . . Dataset data1; range 961,1341,1069,1225 \& chr1 . data 860 876 1296 . . Dataset data1; range 1103,1511,1219,1385 \& chr1 . data 880 896 1444 . . Dataset data1; range 1218,1660,1338,1535 \& chr1 . data 900 916 1600 . . Dataset data1; range 1377,1828,1496,1703 \& chr1 . data 920 936 1764 . . Dataset data1; range 1547,2020,1674,1858 \& chr1 . data 940 956 1936 . . Dataset data1; range 1691,2188,1824,2043 \& chr1 . data 960 976 2116 . . Dataset data1; range 1869,2376,2019,2225 \& chr1 . data 980 996 2304 . . Dataset data1; range 2040,2554,2178,2418 .Ve .IP "The script to render it" 4 .IX Item "The script to render it" .Vb 1 \& #!/usr/bin/perl \& \& use strict; \& use Bio::Graphics::FeatureFile; \& \& my $data = Bio::Graphics::FeatureFile\->new(\-file=>\*(Aqtest.gff\*(Aq); \& \& my(undef,$panel) = $data\->render; \& print $panel\->png; .Ve .SH "BUGS" .IX Header "BUGS" Please report them. .SH "SEE ALSO" .IX Header "SEE ALSO" Bio::Graphics::Panel, Bio::Graphics::Track, Bio::Graphics::Glyph::transcript2, Bio::Graphics::Glyph::anchored_arrow, Bio::Graphics::Glyph::arrow, Bio::Graphics::Glyph::box, Bio::Graphics::Glyph::primers, Bio::Graphics::Glyph::segments, Bio::Graphics::Glyph::toomany, Bio::Graphics::Glyph::transcript, .SH "AUTHOR" .IX Header "AUTHOR" Lincoln Stein .PP Copyright (c) 2001 Cold Spring Harbor Laboratory .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See \s-1DISCLAIMER\s0.txt for disclaimers of warranty.