[Bioperl-l] Structure::IO

Bernd Web bernd.web at gmail.com
Thu Jul 27 10:14:13 UTC 2006


Hi

Thanks for your notes. The text I pasted comes from
http://doc.bioperl.org/releases/bioperl-1.5.1/ but indeed Entry.pm
(v1.25 2006/07/04) shows a different POD.

I am trying to get annotation out of PDB. ID is not a problem, but I
would like to have the HEADER and possibly comment fields to a (FastA)
description line, but how?

Bio::Structure::Entry v.1.25 does not list the annotation method in
the POD anymore (due to a missing empty line before =head).
$struc->annotation still exists; I can get the keys but not the values
with $struc->annotation($struc->seqres) (Can't locate object method
"get_Annotations" via package "Bio::PrimarySeq").
(Example script attached).

The POD states: annotation: $obj->annotation($seq_obj). So I thought
of a PrimarySeq object to pass to annotation.

The PrimarySeq object ($struc->seqres) does not contain a description:
$struc->seqres->desc is uninitialized.

Is it possible to get annotation from header/comments fields with
Bio::Structure?

Best regards,
Bernd


On 7/26/06, Brian Osborne <osborne1 at optonline.net> wrote:
> Bernd,
>
> I'm not following your question. The POD in the latest Bio::Structure::Entry
> shows:
>
> =head2 chain()
>
>  Title   : chain
>  Usage   : @chains  = $structure->chain($chain);
>  Function: Connects a Chain or a list of Chain objects to a
>             Bio::Structure::Entry.
>  Returns : List of Bio::Structure::Chain objects
>  Args    : A Chain or a reference to an array of Chain objects
>
> =cut
>
> Which is not what you've copied and pasted. What version of Bioperl do you
> use?
>
> Brian O.
>
>
>
> On 7/25/06 6:47 AM, "Bernd Web" <bernd.web at gmail.com> wrote:
>
> > Hi,
> >
> > Does someone have experience with Bio::Structure::IO?
> > The example III.9.1 from the bptutorial.pl covers most, but what is e.g. the
> > chain() method of Bio::Structure::Entry doing? The POD states:
> >
> >  Title   : chain
> >  Usage   : @chains  = $structure->chain($chain);
> >  Function: Connects a (or a list of) Chain objects to a Bio::Structure::Entry.
> >  Returns : list of Bio::Structure::Residue objects
> >  Args    : One Residue or a reference to an array of Residue objects
> >
> > But in e.g
> > my $stream = Bio::Structure::IO->new(-file => $filename,
> > -format => 'pdb');
> > while ( my $struc = $stream->next_structure() ) {
> >     for my $chain ($struc->get_chains) {
> > my $chainid = $chain->id;
> > my @chains = $struc->chain($chain);
> >    }
> > }
> >
> > I get Bio::Structure::Chain=HASH(0x9f1ab50).
> >
> > What is the function of the chain method and how to use it?
> >
> > Best regards,
> > bernd
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
>
-------------- next part --------------
#!/usr/bin/perl -w

use warnings;
use strict;
use Bio::Structure::IO;

my $filename = $ARGV[0];

my $stream = Bio::Structure::IO->new(	-file => $filename, 
					-format => 'pdb');
					
while ( my $struc = $stream->next_structure() ) {
	print "SEQRES DESC: ", $struc->seqres->desc, "\n";

	print join(" ", keys %{$struc->annotation($struc->seqres)}), "\n";
	print join(" ", keys %{$struc->annotation()}), "\n"; 
	print join(" ", values %{$struc->annotation()}), "\n"; #(partly) works
	print join(" ", values %{$struc->annotation($struc->seqres)}), "\n"; #does not work
}


More information about the Bioperl-l mailing list