[Bioperl-l] Bio::Structure::IO and single chain output

Jon Manning jrm at compbio.dundee.ac.uk
Fri Jul 22 04:39:40 EDT 2005


Hi all,

I've been using Bio::Structure::IO to read PDB files. I'm currently 
trying to calculate solvent accessibilities on a per-chain basis, so 
want to spit out Bio::Structure::Chain objects to PDB-format files so I 
can feed them alone to NAccess. I've tried passing them directly to the 
IO object, this looked like it might work:

...
$out = Bio::Structure::IO->new(-file => ">test.pdb",
                                  '-format' => 'pdb');

$out->write_structure($chain);
...

(where $chain is a Bio::Structure::Chain)

But I get this sort of error:

------------- EXCEPTION  -------------
MSG:  Bio::Structure::Chain=HASH(0x8dc7368) is not a StructureI 
compliant module.
STACK Bio::Structure::IO::pdb::write_structure 
/usr/lib/perl5/site_perl/5.8.5/Bio/Structure/IO/pdb.pm:531
STACK toplevel ./structureIOtest.pl:26


So I then thought to create a Bio::Structure::Entry object, add the 
chain, and feed that to IO, like:

...
my $entry = Bio::Structure::Entry->new(-id  => 'structure_id');
$entry->chain($chainobject);
$out = Bio::Structure::IO->new(-file => ">test.pdb",
                                  '-format' => 'pdb');

$out->write_structure($entry);
...

But I've clearly misunderstood the entry initialisation somewhere, 
because I get this sort of error:

Use of uninitialized value in concatenation (.) or string at 
/usr/lib/perl5/site_perl/5.8.5/Bio/Structure/Entry.pm line 331, <GEN0> 
line 12836.

------------- EXCEPTION  -------------
MSG: add_chain: first argument needs to be a Model object ()

STACK Bio::Structure::Entry::add_chain 
/usr/lib/perl5/site_perl/5.8.5/Bio/Structure/Entry.pm:330
STACK Bio::Structure::Entry::get_chains 
/usr/lib/perl5/site_perl/5.8.5/Bio/Structure/Entry.pm:386
STACK Bio::Structure::Entry::chain 
/usr/lib/perl5/site_perl/5.8.5/Bio/Structure/Entry.pm:300
STACK toplevel ./structureIOtest.pl:25

--------------------------------------


I'd really appreciate some pointers on how to go about doing this.

Thanks,

Jon



More information about the Bioperl-l mailing list