Bio::Graphics(3pm)
π NAME π
Bio::Graphics β bestie, this module generates GD images of Bio::Seq objects. That's the whole vibe. Periodt. β¨
π SYNOPSIS π
okay so real talk, here's the code, and I'm giving it to you character for character because you deserve accuracy:
# This script generates a PNG picture of a 10K region containing a
# set of red features and a set of blue features. Call it like this:
# red_and_blue.pl > redblue.png
# you can now view the picture with your favorite image application
# This script parses a GenBank or EMBL file named on the command
# line and produces a PNG rendering of it. Call it like this:
# render.pl my_file.embl | display -
use strict;
use Bio::Graphics;
use Bio::SeqFeature::Generic;
use Bio::SeqIO;
my $file = shift or die "provide a sequence file as the argument";
my $io = Bio::SeqIO->new(-file=>$file) or die "could not create Bio::SeqIO";
my $seq = $io->next_seq or die "could not find a sequence in the file";
my @features = $seq->all_SeqFeatures;
# sort features by their primary tags
my %sorted_features;
for my $f (@features) {
my $tag = $f->primary_tag;
push @{$sorted_features{$tag}},$f;
}
my $wholeseq = Bio::SeqFeature::Generic->new(-start=>1,-end=>$seq->length);
my $panel = Bio::Graphics::Panel->new(
-length => $seq->length,
-key_style => 'between',
-width => 800,
-pad_left => 10,
-pad_right => 10,
);
$panel->add_track($wholeseq,
-glyph => 'arrow',
-bump => 0,
-double=>1,
-tick => 2);
$panel->add_track($wholeseq,
-glyph => 'generic',
-bgcolor => 'blue',
-label => 1,
);
# general case
my @colors = qw(cyan orange blue purple green chartreuse magenta yellow aqua);
my $idx = 0;
for my $tag (sort keys %sorted_features) {
my $features = $sorted_features{$tag};
$panel->add_track($features,
-glyph => 'generic',
-bgcolor => $colors[$idx++ % @colors],
-fgcolor => 'black',
-font2color => 'red',
-key => "${tag}s",
-bump => +1,
-height => 8,
-label => 1,
-description => 1,
);
}
print $panel->png;
exit 0;
π¦ DESCRIPTION π¦
ngl, the full interface lives over in Bio::Graphics::Panel β go read that, bestie, that's where the real tea is. π
Also!! run the script glyph_help.pl for quick help on glyphs and their options. it's giving instant answers. iconic. β¨
π SEE ALSO π
the whole squad, no cap:
Bio::Graphics::PanelBio::Graphics::GlyphBio::SeqIBio::SeqFeatureIBio::DasBio::DB::GFF::FeatureAce::SequenceGD glyph_help.pl
π«Ά FEEDBACK π«Ά
π Mailing Lists
user feedback is literally an integral part of the evolution of this and other Bioperl modules. so send your comments and suggestions, preferably to the Bioperl mailing list. your participation is much appreciated, fr fr. π₯Ή
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π Reporting Bugs
found a bug? report it to the Bioperl bug tracking system so we can keep track of the bugs and their resolution β that's the whole point, bestie. bug reports can be submitted via the web:
http://bugzilla.open-bio.org/
β¨ 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 a wrap, my love π this page came to you courtesy of perl v5.30.0, dated 2019-11-25, and the manual name is Bio::Graphics(3pm). go forth and render some gorgeous glyphs, you absolute main character. ππ¦π
π¦ 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