/usr/share/perl5/Bio/Graphics.pm is in libbio-graphics-perl 2.40-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | package Bio::Graphics;
use strict;
use Bio::Graphics::Panel;
our $VERSION = '2.40';
1;
=head1 NAME
Bio::Graphics - Generate GD images of Bio::Seq objects
=head1 SYNOPSIS
# 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;
=head1 DESCRIPTION
Please see L<Bio::Graphics::Panel> for the full interface. Also try
the script glyph_help.pl for quick help on glyphs and their options.
=head1 SEE ALSO
L<Bio::Graphics::Panel>,
L<Bio::Graphics::Glyph>,
L<Bio::SeqI>,
L<Bio::SeqFeatureI>,
L<Bio::Das>,
L<Bio::DB::GFF::Feature>,
L<Ace::Sequence>,
L<GD>
L<glyph_help.pl>
=head1 FEEDBACK
=head2 Mailing Lists
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
=head2 Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via the
web:
http://bugzilla.open-bio.org/
=head1 AUTHOR
Lincoln Stein E<lt>lstein@cshl.orgE<gt>.
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.
=cut
|