Bio::G...gnment(3pm)
๐ Bio::G...gnment(3pm) ๐
okay bestie, so this is a page from the User Contributed Perl Documentation, and it's all about the merged_alignment glyph. no cap, it's a whole vibe. let's get into it ๐ซถ
โจ NAME โจ
Bio::Graphics::Glyph::merged_alignment โ the "merged_alignment" glyph, aka the icon it is ๐
๐ธ SYNOPSIS ๐ธ
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
๐ฆ DESCRIPTION ๐ฆ
So this glyph is lowkey doing the same thing as graded_segments, except the bgcolor of the segments (those are the sub-features, bestie) is controlled by binned scores. yes really. and it ALSO supports semantic zooming so your glyph drawing stays cute and optimized when you're displaying big big sequences. main character behaviour, honestly.
๐ OPTIONS ๐
These ones are standard across all the Glyphs, no matter which one you pick. if you want the full explanation, go read Bio::Graphics::Glyph โ she explains everything.
-fgcolorโ Foreground color. Default:black-outlinecolorโ Synonym for-fgcolor-bgcolorโ Background color. Default:turquoise-fillcolorโ Synonym for-bgcolor-linewidthโ Line width. Default:1-heightโ Height of glyph. Default:10-fontโ Glyph font. Default:gdSmallFont-connectorโ Connector type. Default:0 (false)-connector_colorโ Connector color. Default:black-labelโ Whether to draw a label. Default:0 (false)-descriptionโ Whether to draw a description. Default:0 (false)-hiliteโ Highlight color. Default:undef (no color)
and THEN, the merged-alignment glyph has its own extra little glyph-specific options, because she's special like that โจ
-max_scoreโ Maximum value of the feature's"score"attribute. Default:Calculated-min_scoreโ Minimum value of the feature's"score"attribute. Default:Calculated-bincolorsโ Colors assigned to bins (in order). Default:lightgrey powderblue cornflowerblue blue-binsโ Bins to which scores are assigned. Default:Calculated-merge_partsโ Whether to simplify the alignment at low magnification. Default:0 (false)-max_gapโ Do not merge across gaps that exceed this threshold. Default:Calculated
ngl, if max_score and min_score aren't specified, the glyph will calculate the local maximum and minimum scores at run time. she's self-sufficient ๐
and if the bins aren't specified, they get calculated based on the number of colors you assigned and the local (or user-specified) minimum and maximum scores. calculated bins are all equal in size. periodt.
user-specified bins are expressed as ranges, like this:
bins = 0-50 50-70 70-90 90-100
where each range means greater than the lower number and less than or equal to the higher number. so like, 0-50 is "more than 0, up to and including 50". iykyk.
๐ Simplifying the display of alignment features for large segments ๐
The merge_parts option is the one doing semantic zooming. here's the tea: if features are small and dense, they will NOT display very well on large segments and the color-coding just gets lost ๐ญ. so if merge-parts is set to a true value, adjacent alignment parts get merged together until a gap exceeding a calculated or user-specified value is encountered. slay.
unless you specify it, the maximum gap allowed for merging adjacent features is calculated as (L/10000)*(L/500), where L = the length of the sequence displayed in the browser. the exponentially increasing gap threshold means more aggressive merging of alignment features as the size of the displayed sequence grows larger. it's giving adaptive.
the score of the merged feature is calculated as a weighted average. for example, consider two adjacent HSPs that are each 400 bp in length and have scores of 60% and 70%. if the merge_parts option is set to a true value, the two HSPs would be merged in the display to a single 800 bp alignment block with an average score of 65%. math ate, honestly ๐งฎโจ
The merge_parts option is turned off by default. (yes, off. don't come for me.)
๐ SAMPLE CONFIGURATION ๐
Sample gbrowse configuration stanzas for an alignment feature using this glyph. the scores are assumed to be expressed as percent identity (0-100).
# base configuration
[BLASTZ]
feature = blastz_alignment
glyph = merged_alignment
bincolors = #A0A0A0 powderblue cornflowerblue blue
bins = 60-70 70-80 80-90 90-100
category = Sequence Similarity Tracks
height = 6
bump = 1
label = 1
fgcolor = black
key = BLASTZ
and now, semantic zooming with a defined maximum gap between merged features for different zoom levels ๐
# if the displayed segment is >= 20000 in length,
# use the merge_parts option to simplify the alignment
# display
[BLASTZ:20000]
feature = blastz_alignment
merge_parts = 1
max_gap = 50 # do not merge across gaps > 50 bp
# if the displayed segment is >= 50000 in length
[BLASTZ:50000]
feature = blastz_alignment
merge_parts = 1
max_gap = 500 # do not merge across gaps > 500 bp
--OR-- bestie, you can do it the other way instead:
semantic zooming with a dynamically calculated maximum gap:
# if the displayed segment is >= 20000 in length,
[BLASTZ:20000]
feature = blastz_alignment
merge_parts = 1
๐ BUGS ๐
Please report them. (yes, that's the whole thing. she said what she said ๐)
โญ SEE ALSO โญ
Bio::Graphics::Panel, Bio::Graphics::Glyph Bio::DB::GFF, Bio::SeqI, Bio::SeqFeatureI, Bio::Das, GD
๐ AUTHOR ๐
Sheldon McKay <mckays@cshl.edu>
Copyright (c) 2005 Cold Spring Harbor Laboratory
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty.
okay that's the whole page, bestie, you're so welcome ๐ซถ this came from the User Contributed Perl Documentation for perl v5.30.0, dated 2019-11-25, and it's the merged_alignment glyph page (Bio::G...gnment(3pm)) in all her glory. go forth and merge those parts ๐โจ๐
๐ฆ where this page comes from
- debian bookworm: libbio-graphics-perl 2.40-6 ยท Perl
- debian trixie: libbio-graphics-perl 2.40-6 ยท Perl
- ubuntu jammy: libbio-graphics-perl 2.40-6 ยท Perl
- ubuntu noble: libbio-graphics-perl 2.40-6 ยท Perl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms