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

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

πŸ’– 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_extra instead ⚠️
  • -show_mismatch β€” when combined with -draw_target, highlights mismatched bases in the mismatch color. can be 0 (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_color or -deletion_color are 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_target will cause the DNA of the hit sequence to be displayed when the magnification is high enough to allow individual bases to be drawn.
  • -ragged_extra will 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_mismatch will cause mismatched bases to be highlighted in with the color indicated by -mismatch_color. a -show_mismatch value 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_target has the opposite meaning from -canonical_strand, which is used in conjunction with -draw_dna to 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