Bio::G...gments(3pm)
π Bio::G...gments β the "segments" glyph, bestie edition π
okay so this is the manual page for Bio::Graphics::Glyph::segments, aka the "segments" glyph, and I'm gonna walk you through it like we're texting at 1am. it's a Perl module, it's part of the Bio::Graphics situation, and it's lowkey iconic for drawing things that come in pieces. let's go π¦
β¨ NAME β¨
Bio::Graphics::Glyph::segments β the "segments" glyph. that's it, that's the name, periodt π
πΈ SYNOPSIS πΈ
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
like, go read those two first, bestie, they're the parent vibes π«Ά
π DESCRIPTION π
So. This glyph is for drawing features that are made of discontinuous segments β lil broken-up bits, you know? and here's the tea: unlike graded_segments or alignment, every segment here is a uniform color. it does not care about the score of the segment. no score-based color drama here, it's giving consistent. π
π METHODS π
This module overrides the maxdepth() method so it returns 1 β unless you explicitly set it with the -maxdepth option. what does that mean for you? it means any module inheriting from segments will only ever get presented with one level of subfeatures. if you want more levels, bestie, you gotta override the maxdepth() method yourself. no cap. π
π OPTIONS π
The following options are standard among all Glyphs. if you want the full explanation, go see Bio::Graphics::Glyph.
-fgcolorβ foreground color. default:blackπ€-outlinecolorβ synonym for-fgcolor. same thing, different name, we love a rebrand β¨-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)-strand_arrowβ whether to indicate strandedness. default:0(false)-hiliteβ highlight color. default:undef(no color)
and in addition, the following glyph-specific options are recognized (this is the good part, stay with me π):
-draw_dnaβ if true, draw the dna residues when the magnification level allows. default:0(false)-draw_targetβ if true, draw the dna residues of the TARGET sequence when the magnification level allows. see "Displaying Alignments". default:0(false)-draw_protein_targetβ if true, draw the protein residues of the TARGET sequence when the magnification level allows. see "Displaying Alignments". default:0(false)-ragged_extraβ when combined with-draw_target, draw extra bases beyond the end of the alignment. the value is the maximum number of extra bases. see "Displaying Alignments". default:0(false)-ragged_startβ Deprecated option. use-ragged_extrainstead β οΈ-show_mismatchβ when combined with-draw_target, highlights mismatched bases in the mismatch color. can be0(don't display);1(display when the DNA fits); or another positive integer (display when the region in view is <= this value). see "Displaying Alignments". default:0(false)-mismatch_onlyβ when combined with-draw_target, draws only the mismatched bases in the alignment. implies-show_mismatch. see "Displaying Alignments". default:0(false)-mismatch_colorβ the mismatch color to use. default:'lightgrey'-insertion_colorβ the color to use for insertions relative to the reference. default:'green'-deletion_colorβ the color to use for deletions relative to the reference. default:'red'-indel_colorβ the color to use for indels, used only if-insertion_coloror-deletion_colorare absent. default:'lightgrey'-true_targetβ show the target DNA in its native (plus strand) orientation, even if the alignment is to the minus strand. see "Displaying Alignments". default:0(false)-realignβ attempt to realign sequences at high mag to account for indels. see "Displaying Alignments". default:0(false)
so if the -draw_dna flag is set to a true value, then when the magnification is high enough, the underlying DNA sequence will be shown. π heads up though: this option is mutually exclusive with -draw_target. see Bio::Graphics::Glyph::generic for more details.
The -draw_target, -ragged_extra, and -show_mismatch options only work with seqfeatures that implement the hit() method (Bio::SeqFeature::SimilarityPair). here's the breakdown, bestie:
-draw_targetwill cause the DNA of the hit sequence to be displayed when the magnification is high enough to allow individual bases to be drawn.-ragged_extrawill cause the alignment to be extended at the extreme ends by the indicated number of bases, and it's useful for looking for polyAs and cloning sites at the ends of ESTs and cDNAs.-show_mismatchwill cause mismatched bases to be highlighted in with the color indicated by-mismatch_color. a-show_mismatchvalue of"1"will highlight mismatches only when the base pairs are displayed. a positive integer will cause mismatches to be shown whenever the region in view is less than or equal to the requested value.
At high magnifications, minus strand matches will automatically be shown as their reverse complement (so that the match has the same sequence as the plus strand of the source dna). but if you'd rather see the actual sequence of the target as it appears on the minus strand, then set -true_target to true. π§
ngl, watch out:-true_targethas the opposite meaning from-canonical_strand, which is used in conjunction with-draw_dnato draw minus strand features as if they appear on the plus strand. don't mix these up, i'm begging π
π Displaying Alignments π
When the -draw_target option is true, this glyph can be used to display nucleotide alignments such as BLAST, FASTA or BLAT similarities. at high magnification, this glyph will attempt to show how the sequence of the source (query) DNA matches the sequence of the target (the hit). for this to work, the feature must implement the hit() method, and both the source and the target DNA must be available. if you pass the glyph a series of Bio::SeqFeature::SimilarityPair objects, then these criteria will be satisfied. slay. β¨
Without additional help, this glyph cannot display gapped alignments correctly. to display gapped alignments, you can use the Bio::Graphics::Brower::Realign module, which is part of the Generic Genome Browser package (http://www.gmod.org). if you wish to install the Realign module and not the rest of the package, here is the recipe:
cd Generic-Genome-Browser-1.XX
perl Makefile.PL DO_XS=1
make
make install_site
If possible, build the gbrowse package with the DO_XS=1 option. this compiles a C-based DP algorithm that both gbrowse and gbrowse_details will use if they can. if DO_XS is not set, then the scripts will use a Perl-based version of the algorithm that is 10-100 times slower. π yes, ten to a hundred. we're not joking.
The display of alignments can be tweaked using the -ragged_extra, -show_mismatch, -true_target, and -realign options. see the options section for further details.
There is also a -draw_protein_target option, which is designed for protein to nucleotide alignments. it draws the target sequence every third base pair and is supposed to align correctly with the forward and reverse translation glyphs. this option is experimental at the moment, and may not work correctly, to use with care. π
π BUGS π
Please report them. (that's the whole thing. they're just like "please report them." honestly? iconic minimalism.)
π«Ά SEE ALSO π«Ά
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
π 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.
and that's the whole page, bestie!! π this one was generated by perl v5.30.0 on 2019-11-25, which is like. ancient. but the knowledge is timeless. go draw some segments, you got this π β¨π¦
π¦ 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