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

πŸ“¦
version 2.40 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Bio::Graphics::Glyph::graded_segments πŸ’–

okay bestie, gather round, because this is the graded_segments glyph from the Bio::Graphics family, and it's genuinely one of the cutest little visualization tools out here. it lives in the User Contributed Perl Documentation corner of your perldoc, and yes, we're gonna read the whole thing together. no skimming. periodt. πŸ’…


✨ NAME ✨

Bio::Graphics::Glyph::graded_segments β€” the "graded_segments" glyph. that's it, that's the whole name, and it's iconic for it. πŸ‘‘


✨ SYNOPSIS ✨

See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.

like, the synopsis is literally just "go read the other docs first." she's lowkey sending you to the group chat archives. 🫢


✨ DESCRIPTION ✨

so here's the tea: this glyph is identical to the "alignment" glyph, and its whole job is drawing features that are made up of discontinuous segments. πŸ¦‹

and the cute part? the color intensity of each segment is proportionate to the score. higher score = deeper color = more drama. it's giving heatmap but make it fashion. 🌈


✨ OPTIONS ✨

the standard ones (all glyphs have these, no cap)

Bio::Graphics::Glyph has the full explanation if you want the deep lore, but here's the rundown:

  • -fgcolor β€” Foreground color. Default: black. πŸ–€
  • -outlinecolor β€” Synonym for -fgcolor. (same energy, different name)
  • -bgcolor β€” Background color. Default: turquoise. πŸ’Ž slay
  • -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).

the glyph-specific ones (alignment glyph exclusives πŸ’…)

  • -max_score β€” Maximum value of the feature's "score" attribute. Default: Calculated.
  • -min_score β€” Minimum value of the feature's "score" attribute. Default: Calculated.
  • -vary_fg β€” Vary the foreground color as well as the background. Default: 0 (false).
  • -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.
🧠 heads up bestie: if max_score and min_score are not specified, the glyph will calculate the local maximum and minimum scores at run time. and since lots of scoring functions are exponential, you may wanna take the log of your scores before passing them into this glyph. not me being helpful. πŸ’œ

🌸 Simplifying the display of alignment features for large segments 🌸

okay this section is the main character, let's talk about it.

the "merge_parts" option is used for semantic zooming. the vibe: if features are small and dense, they will not be displayed very well** for large segments, and the color-coding will be lost. 😭

if merge-parts is set to a true value, adjacent alignment parts will be merged until a gap exceeding a calculated or user-specified value is encountered. ✨

unless specified, 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. and the way that threshold increases exponentially?? that's the whole point β€” it allows more aggressive merging of alignment features as the size of the displayed sequence grows larger. she scales with you, fr fr. πŸ“ˆ


the score math (yes we're doing math, stay with me πŸ“)

the score of the merged feature is calculated as a weighted average.

example time, because numbers > vibes here:

  • two adjacent HSPs
  • each 400 bp in length
  • 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%. πŸ’–

and the merge_parts option is turned off by default. so if you wanted it, you have to ask for it. consent first, always. πŸ™ˆ


✨ BUGS ✨

Please report them.

(that's literally it. she's a woman of few words and honestly? respect. πŸ’€)


✨ SEE ALSO ✨

the whole extended family, no one left out:

  • Bio::Graphics::Panel
  • Bio::Graphics::Glyph
  • Bio::Graphics::Glyph::arrow
  • Bio::Graphics::Glyph::cds
  • Bio::Graphics::Glyph::crossbox
  • Bio::Graphics::Glyph::diamond
  • Bio::Graphics::Glyph::dna
  • Bio::Graphics::Glyph::dot
  • Bio::Graphics::Glyph::ellipse
  • Bio::Graphics::Glyph::extending_arrow
  • Bio::Graphics::Glyph::generic
  • Bio::Graphics::Glyph::graded_segments
  • Bio::Graphics::Glyph::heterogeneous_segments
  • Bio::Graphics::Glyph::line
  • Bio::Graphics::Glyph::pinsertion
  • Bio::Graphics::Glyph::primers
  • Bio::Graphics::Glyph::rndrect
  • Bio::Graphics::Glyph::segments
  • Bio::Graphics::Glyph::ruler_arrow
  • Bio::Graphics::Glyph::toomany
  • Bio::Graphics::Glyph::transcript
  • Bio::Graphics::Glyph::transcript2
  • Bio::Graphics::Glyph::translation
  • Bio::Graphics::Glyph::triangle
  • Bio::DB::GFF
  • Bio::SeqI
  • Bio::SeqFeatureI
  • Bio::Das
  • GD

go read them all, bestie. iykyk. 🧚


✨ AUTHOR ✨

Lincoln Stein <lstein@cshl.org> 🫢

Copyright (c) 2001 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, you ate it up πŸ’…βœ¨

this was pulled from perl v5.30.0, dated 2019-11-25, filed under the Bio::G...egments(3pm) manual page β€” and now you know everything she knows. mwah. πŸŽ€πŸ‘‘πŸ’–

πŸ“¦ where this page comes from