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

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

πŸ’– NAME πŸ’–

Bio::Graphics::Glyph::ideogram β€” the ideogram glyph, bestie. Yes it's a real manual page (perl v5.30.0, dated 2019-11-25, if you were wondering) and yes we're gonna get through all of it together 🫢


✨ SYNOPSIS ✨

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

Like, that's it. That's the whole synopsis. Go read those two. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this glyph draws a section of a chromosome ideogram. It's giving science class but make it cute.

It relies on certain data from the feature to figure out:

  • which color should be used (that's the stain, bestie),
  • and whether the segment is a telomere, a centromere, or just a regular old cytoband.

Here's the tea: the centromeres and the 'var'-marked bands get rendered with diagonal black-on-white patterns if the -patterns option is true. If it's not true? They get rendered in dark gray instead. And no, this isn't just aesthetic β€” it's literally to prevent a libgd2 crash on certain 64-bit platforms when rendering patterned images 😭 so do not come for the gray, the gray is load-bearing.

The cytobandband features would typically be formatted like this in GFF3:

...
ChrX    UCSC    cytoband        136700001       139000000       .       .       .       Parent=ChrX;Name=Xq27.1;Alias=ChrXq27.1;stain=gpos75;
ChrX    UCSC    cytoband        139000001       140700000       .       .       .       Parent=ChrX;Name=Xq27.2;Alias=ChrXq27.2;stain=gneg;
ChrX    UCSC    cytoband        140700001       145800000       .       .       .       Parent=ChrX;Name=Xq27.3;Alias=ChrXq27.3;stain=gpos100;
ChrX    UCSC    cytoband        145800001       153692391       .       .       .       Parent=ChrX;Name=Xq28;Alias=ChrXq28;stain=gneg;
ChrY    UCSC    cytoband        1       1300000 .       .       .       Parent=ChrY;Name=Yp11.32;Alias=ChrYp11.32;stain=gneg;

which in this case is a GFF-ized cytoband coordinate file from UCSC:

http://hgdownload.cse.ucsc.edu/goldenPath/hg16/database/cytoBand.txt.gz

and the corresponding GBrowse config options would be like this to
create an ideogram overview track for the whole chromosome:

The 'chromosome' feature below would aggregated from bands and centromere using the default
chromosome aggregator

[CYT:overview]
feature       = chromosome
glyph         = ideogram
fgcolor       = black
bgcolor       = gneg:white gpos25:silver gpos50:gray
                gpos:gray  gpos75:darkgray gpos100:black acen:cen gvar:var
arcradius     = 6
height        = 25
bump          = 0
label         = 0

A script to reformat UCSC annotations to  GFF3 format can be found at
the end of this documentation.
πŸŽ€ Heads up: that middle bit is one single GFF3 file and one single GBrowse config, so if you're copying it, copy it all β€” the ..., the URL, and the config block are all part of the same flow.

🌸 OPTIONS 🌸

The following options are standard among all Glyphs. See Bio::Graphics::Glyph for a full explanation.

  • -fgcolor β€” Foreground color. Default: black
  • -outlinecolor β€” Synonym for -fgcolor.
  • -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)

The following options are specific to the ideogram glyph. πŸ‘‘

  • -bgcolor β€” Band coloring string. Default: none
  • -bgfallback β€” Coloring to use when no bands are present. Default: yellow

-bgcolor is used to map each chromosome band's "stain" attribute into a color or pattern. It is a string that looks like this:

gneg:white gpos25:silver gpos50:gray \
gpos:gray  gpos75:darkgray gpos100:black acen:cen gvar:var

So what that's saying is: use "white" for features whose stain attribute is "gneg", "silver" for those whose stain attribute is "gpos25", and so on, and so on, forever and ever amen πŸ’«

Several special values are recognized:

  • "stalk" β€” draws a narrower gray region and is usually used to indicate an acrocentric stalk.
  • "var" β€” creates a diagonal black-on-white pattern.
  • "cen" β€” draws a centromere.

If -bgcolor is just a color name, like "yellow", the glyph will ignore all bands and just draw a filled in chromosome. Slay, simple.

If -bgfallback is set to a color name or value, then the glyph will fall back to the indicated background color if the chromosome contains no bands. 🩹


🧚 UCSC TO GFF CONVERSION SCRIPT 🧚

The following short script can be used to convert a UCSC cytoband annotation file into GFF format. If you have the lynx web-browser installed you can call it like this in order to download and convert the data in a single operation:

fetchideogram.pl http://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/cytoBand.txt.gz

Otherwise you will need to download the file first. Note the difference between this script and input data from previous versions of ideogram.pm: UCSC annotations are used in place of NCBI annotations. πŸ‘€

#!/usr/bin/perl

use strict; my %stains; my %centros; my %chrom_ends;

foreach (@ARGV) {
    if (/^(ftp|http|https):/) {      $_ = "lynx --dump $_ |gunzip -c|";
    } elsif (/\.gz$/) {      $_ = "gunzip -c $_ |";
    }
    print STDERR "Processing $_\n"; }

print "##gff-version 3\n"; while(<>) {
    chomp;
    my($chr,$start,$stop,$band,$stain) = split /\t/;
    $start++;
    $chr = ucfirst($chr);
    if(!(exists($chrom_ends{$chr})) || $chrom_ends{$chr} < $stop)
    {      $chrom_ends{$chr} = $stop;
    }
    my ($arm) = $band =~ /(p|q)\d+/;
    $stains{$stain} = 1;
    if ($stain eq 'acen')
    {      $centros{$chr}->{$arm}->{start} = $stop;
     $centros{$chr}->{$arm}->{stop} = $start;      next;
    }
    $chr =~ s/chr//i;
    print
qq/$chr\tUCSC\tcytoband\t$start\t$stop\t.\t.\t.\tParent=$chr;Name=$chr;Alias=$chr$band;stain=$stain;\n/;
}

foreach my $chr(sort keys %chrom_ends) {
    my $chr_orig = $chr;
    $chr =~ s/chr//i;
    print
qq/$chr\tUCSC\tcentromere\t$centros{$chr_orig}->{p}->{stop}\t$centros{$chr_orig}->{q}->{start}\t.\t+\t.\tParent=$chr;Name=$chr\_cent\n/;
}
πŸ’€ No cap, run it exactly as written. The $stains{$stain} = 1; line is there, the next is there, the \_ escape is there. Don't "clean it up", bestie, that's how the glyph's input gets born.

😭 BUGS 😭

Please report them. That's it, that's the whole section. Please. Report. Them. πŸ™


🌈 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 πŸ‘‘

Gudmundur A. Thorisson <mummi@cshl.edu>

Copyright (c) 2001-2006 Cold Spring Harbor Laboratory


πŸ’œ CONTRIBUTORS πŸ’œ

Sheldon McKay <mckays@cshl.edu<gt>

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!! πŸ’– Written by the perl v5.30.0 era, dated 2019-11-25, and living in the Bio::G...eogram(3pm) slot of your local manual. Go draw a chromosome, you absolute icon. πŸŽ€βœ¨

πŸ“¦ where this page comes from