Bio::G...gnment(3pm)

๐Ÿ“ฆ
version 2.40 ยท 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

๐Ÿ’– 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