[Bioperl-l] How to distinguish pdb Helix from Sheet?
Jason Stajich
jason at cgt.duhs.duke.edu
Mon Nov 24 14:05:53 EST 2003
I'm not entirely sure of the best way to do this - but here is something
to get you started. If you work out a good strategy to the data I think
we'd appreciate any useable scripts back in Bioperl. There seem to a
scant few doing structural stuff and using Bioperl so we don't have a lot
of good example applications written yet for the Structure objects.
use Bio::Structure::IO;
use strict;
my $in = new Bio::Structure::IO(-format => 'pdb',
-file => $filename);
# first 2 nums are from the rol definition
# that Kris sets up in the pdb parser
# the 3rd number is the index of the
# Chain ID for that type of feature
my %rol_length = ('sheet' => [8,70,5],
'helix' => [8,76,4]);
my $struc = $in->next_structure;
foreach my $type ( keys %rol_length ) {
my $uct = uc($type);
my @header = $struc->annotation->get_Annotations($type);
my $h = shift @header;
next unless defined $h;
my ($rol_begin,$rol_end,$chain_index) = @{$rol_length{$type}};
my $length = $rol_end - $rol_begin +1;
my $k = $h->value;
my $uct = uc($type);
# change the whole concatenated string into \n delimited
# string
$k =~ s/(.{$length})/$uct$1\n/g;
$k .= "\n";
# print $k; # print if you want to see the whole $type record
my @records = split(/\n/,$k);
foreach my $r ( @records ) {
# based on
# http://www.rcsb.org/pdb/docs/format/pdbguide2.2/guide2.2_frame.html
my @line = split(/\s+/,$r);
print "chain $line[$chain_index] contains $uct\n";
}
}
--jason
On Fri, 21 Nov 2003, Jeff Donner wrote:
> Hi,
>
> How can you tell which chains are HELIX and which SHEET
> after you've read a pdb file with Bio::Structure::IO?
>
> Is it possible even?
>
> Thanks,
>
> Jeff Donner
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu
More information about the Bioperl-l
mailing list