Bio::G...script(3pm)
π NAME π
Bio::Graphics::Glyph::decorated_transcript β bestie, this glyph draws processed transcripts with protein decorations on them. Periodt.
πΈ SYNOPSIS πΈ
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
β¨ DESCRIPTION β¨
okay so. This glyph takes the whole Bio::Graphics::Glyph::processed_transcript vibe and levels it UP β it lets you draw protein decorations (think: signal peptides, transmembrane domains, protein domains, the whole little entourage) right on top of your gene models. iconic behavior honestly.
Right now the glyph can draw decorations as colored boxes or outlined boxes, either inside or around CDS segments. You specify protein decorations at the 'mRNA' transcript level, in protein coordinates, and the glyph is the one doing the math β it automatically maps those protein coords onto nucleotide coords for you. no cap. And if a decoration spans an exon-exon junction? The glyph just splits it between the exons. easy. By default the glyph auto-assigns different colors to different types of protein decorations, and decorations of the same type always get the same color. consistent queen behavior. π
You can hand it protein decorations two ways: either with mRNA features inside GFF files (example down below β¬οΈ) or dynamically through a callback function using the additional_decorations option (check the glyph options, bestie).
Here's what an mRNA feature looks like in a GFF file, carrying two protein decorations β one signal peptide predicted by SignalP and one transmembrane domain predicted by TMHMM:
"chr1 my_source mRNA 74796 75599 . + . ID=rna_gene-1;protein_decorations=SignalP40:SP:1:23:0:my_comment,TMHMM:TM:187:209:0"
π Each protein decoration = six fields, colon-separated π
- type β the decoration type. For example, used to specify the decoration source (e.g.
'SignalP40'). - name β the decoration name. Used as the decoration label by default (e.g.
'SP'for signal peptide). - start β start coordinate at the protein level (1-based coordinate).
- end β end coordinate at the protein level.
- score β optional. The score associated with a decoration (e.g. a Pfam E-value). You can use this score to dynamically filter or color decorations via callbacks (see glyph options).
- description β optional. A user-defined description of the decoration. The glyph itself ignores this description, but it gets made available to callback functions for inspection. Special characters like
':'or','that might interfere with the GFF tag parser should be avoided. do not put those in, fr fr.
If callback functions are used as glyph parameters (see below), the callback gets called for each decoration separately. So like β the callback can be called multiple times for a given CDS feature, but every time with a different decoration that overlaps with that CDS. The currently drawn (active) decoration is made available to the callback via the glyph method 'active_decoration'. That active decoration comes back as a Bio::Graphics::Feature object, with the decoration data fields mapped to corresponding feature attributes like this:
- type -->
$glyph->active_decoration->type - name -->
$glyph->active_decoration->name - nucleotide start coordinate -->
$glyph->active_decoration->start - nucleotide end coordinate -->
$glyph->active_decoration->end - protein start coordinate -->
$glyph->active_decoration->get_tag_values('p_start') - protein end coordinate -->
$glyph->active_decoration->get_tag_values('p_end') - score -->
$glyph->active_decoration->score - description -->
$glyph->active_decoration->description
Bonus: the glyph passed to the callback also lets you reach the parent glyph and parent feature if you need them (use $glyph->parent or $glyph->parent->feature). slay. π¦
π OPTIONS π
This glyph inherits all options from the Bio::Graphics::Glyph::processed_transcript glyph. And on top of that, it recognizes these glyph-specific ones:
-decoration_visibleβ Specifies whether decorations should be visible or not. Default:false. For selective display of individual decorations, specify a callback function and return1or0after inspecting the active decoration of the glyph.-decoration_colorβ Decoration background color. If no color is specified, colors are assigned automatically by decoration type and name, whereas decorations of identical type and name are assigned the same color. Default:<auto>. A special color'transparent'can be used here in combination with the option'decoration_border'to draw decorations as outlines. π-decoration_borderβ Decoration border style. By default, decorations are drawn without border ('none'or0). Default:0 (none). Other valid options here include'solid'or'dashed'.-decoration_border_colorβ Color of decoration border. Default:black.-decoration_labelβ Decoration label. If not specified, the second data field of the decoration is used as label. Default:true (decoration name). Set this option to0to get unlabeled decorations. If the label text extends beyond the size of the decorated segment, the label will be clipped. Clipping does not occur for SVG output.-decoration_label_positionβ Position of decoration label. Labels can be drawn'inside'decorations (default) or'above'and'below'decorations. Default:inside.-decoration_label_colorβ Decoration label color. If not specified, this color is complementary todecoration_color(e.g., yellow text on blue background, white on black, etc.). If the decoration background color is transparent and no decoration label color is specified, the foreground color of the underlying transcript glyph is used as default.-additional_decorationsβ Additional decorations to those specified in the GFF file. Expected is a string in the same format as described above for GFF files. Default:undefined. This parameter is intended to be used as a callback function, which inspects the currently processed transcript feature (first parameter to callback) and returns additional protein decorations that should be drawn. π«Ά-decoration_heightβ Decoration height. Unless specified otherwise, the height of the decoration is the height of the underlying transcript glyph minus 2, such that the decoration is drawn within transcript boundaries. Default:CDS height-2.-decoration_positionβ Currently decorations can only be drawn inside CDS segments. Default:inside.-flip_minusβ If set to1, features on the negative strand will be drawn flipped. Default:false. This is not particularly useful in GBrowse, but becomes handy if multiple features should be drawn within the same panel, left-aligned, and on top of each other, for example to allow for easy gene structure comparisons.
π BUGS π
Strandedness arrows are decorated incorrectly. Currently, the glyph plots a rectangular box over the arrow instead of properly coloring the arrow. it's giving rectangle-over-arrow, not it.
Overlapping decorations are drawn on top of each other without particular order. The only solution to this problem at this point is to reduce decorations to a non-overlapping set.
For SVG output, or if drawn not inside decorations, decoration labels are not clipped. Similar as for overlapping decorations, this can result in labels being drawn on top of each other. π
Please report all errors. (genuinely, do it, we wanna know π₯Ί)
π SEE ALSO π
Bio::Graphics::Panel, Bio::Graphics::Glyph, Bio::Graphics::Glyph::decorated_gene, Bio::Graphics::Glyph::processed_transcript
π§ AUTHOR π§
Christian Frech <cfa24@sfu.ca>
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, mwah π
β¨ This one's from perl v5.30.0, dated 2019-11-25 β a certified classic, no notes. ππ
π¦ 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