Bio::G...eogram(3pm)
π 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, thenextis 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
- 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