[Bioperl-l] Structure::IO
Brian Osborne
osborne1 at optonline.net
Thu Jul 27 13:44:33 UTC 2006
Bernd,
I'll need to take a look a closer look at the POD but from your description
it seems it's wrong, or certainly incomplete. To get the HEADER line you'll
do something like:
my $stream = Bio::Structure::IO->new(-file => $filename,
-format => 'pdb');
my $struc = $stream->next_structure();
my $anncoll = $struc->annotation;
my @headers = $anncoll->get_Annotations('header');
This implies that all these top-level annotations are associated with the
entry, not with the chains. I don't use Bio::Structure so don't assume this
is true for all annotations.
There are 2 ways to explore this further. One is to look at t/StructIO.t or
other tests, useful examples are frequently found in the tests. The other is
to run your script in the debugger:
>perl -d pdb.pl 1CAM.pdb
By examining the variables your script creates using the "x" command you get
to see exactly where strings are stored and what the names of the keys are,
this is how I found the HEADER line. Type "h" for the debugger's Help.
Brian O.
On 7/27/06 6:14 AM, "Bernd Web" <bernd.web at gmail.com> wrote:
> 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
>>
>>
>>
More information about the Bioperl-l
mailing list