[Bioperl-l] Module to draw transmembrane protein toplogoy
Tim Nugent
t.nugent at cs.ucl.ac.uk
Mon Feb 19 17:29:48 UTC 2007
Hi everyone,
I've written a perl module to display transmembrane protein topology
using GD. There are various options, including labels, helix/loop
dimensions, colour schemes etc but it only requires a string or array
containing the protein topology (e.g. transmembrane helix start/stop
points). It produces output like this:
http://www.cs.ucl.ac.uk/staff/T.Nugent/images/blue.png
http://www.cs.ucl.ac.uk/staff/T.Nugent/images/yellow.png
using the code at the bottom.
Here is a the module:
http://www.cs.ucl.ac.uk/staff/T.Nugent/source/DrawTransmembrane.pm
I've never submitted anything to Bioperl before - is this sort of thing
likely to be of use to others? I imagine it would sit alongside some of
the Bio::Graphics stuff.
Best wishes,
Tim
#!/usr/bin/perl
use strict;
use warnings;
use lib '/scratch0/NOT_BACKED_UP/tnugent/perl5lib'; ## path to module
use DrawTransmembrane;
my @topology = (20,45,59,70,86,109,145,168,194,220);
my %labels = ('5' => '5 - Sulphation Site',
'21' => '1st Helix',
'47' => '40 - Mutation',
'60' => 'Voltage Sensor',
'72' => '72 - Mutation 2',
'73' => '73 - Mutation 3',
'138' => '138 - Glycosylation Site',
'170' => '170 - Phosphorylation Site',
'200' => 'Last Helix');
my $im = DrawTransmembrane->draw_transmembrane(-title => 'This is a
cartoon displaying transmembrane helices.',
-topology => \@topology,
-n_terminal => 'out',
-helix_width => 48,
-helix_height => 125,
-short_loop_limit => 10,
-long_loop_limit => 35,
-loop_width => 25,
-colour_scheme => 'yellow',
-labels => \%labels,
-text_offset => -10);
## print the .png file
my $output = 'test.png';
open(OUTPUT, ">$output");
binmode OUTPUT;
print OUTPUT $im->png;
close OUTPUT;
my $system = `display $output`;
--
Tim Nugent (MRes)
Research Student
Bioinformatics Unit
Department of Computer Science
University College London
Gower Street
London WC1E 6BT
Tel: 020-7679-0410
t.nugent at ucl.ac.uk
More information about the Bioperl-l
mailing list