[Bioperl-l] Bio::Index::PDB

Shawn Hoon shawnh at stanford.edu
Tue Oct 14 16:11:58 EDT 2003


Yeah, but I needed to have it return a Bio::Structure type object so I 
needed to inherit
from a Bio::Index::AbstractStructure as opposed to a 
Bio::Index::AbstractSeq

But yes, definitely this looks like a good feature to have especially 
as I'm now finding,
some of the astral pdb type files have different headers from the 
normal pdb files..

shawn


On Tuesday, October 14, 2003, at 5:18AM, Brian Osborne wrote:

> Shawn,
>
> Both Bio::Index::Fasta and Bio::DB::Fasta allow you to stipulate the 
> key you
> want to use, as in:
>
> my $inx = Bio::Index::Fasta->new( -filename   => $file_name . ".idx",
>                                     -write_flag => 1 );
> $inx->id_parser(\&get_id);
> # make the index
> $inx->make_index($file_name);
>
> # where get_id() could look like:
>
> # here is where the retrieval key is specified
>   sub get_id {
>      my $header = shift;
>      $header =~ /^>.*\bsp\|([A-Z]\d{5}\b)/;
>      $1;
>   }
>
> I've found this capability to be very useful myself.
>
> Brian O.
>
>
> -----Original Message-----
> From: bioperl-l-bounces at portal.open-bio.org
> [mailto:bioperl-l-bounces at portal.open-bio.org]On Behalf Of Shawn Hoon
> Sent: Monday, October 13, 2003 9:18 PM
> To: BioPerl List
> Subject: [Bioperl-l] Bio::Index::PDB
>
> Hi,
> I wrote an indexer along the lines of the sequence index modules  for
> PDB structure files.
> Basically a lot of copying from Bio::Index::Fasta
>
> Basically 2 modules added:
>
> Bio::Index::AbstractStructure (which inherits from 
> Bio::Index::Abstract)
> Bio::Index::PDB
>
> Usage:
>
>      use Bio::Index::PDB;
>      use strict;
>
>      my $Index_File_Name = shift;
>      my $inx = Bio::Index::PDB->new('-filename' => $Index_File_Name);
>      my $out = Bio::Structure::IO->new('-format' => 'pdb','-fh' =>
> \*STDOUT);
>
>      foreach my $id (@ARGV) {
>          my $struct= $inx->fetch($id); # Returns Bio::Structure object
>          $out->write_structure($struct);
>      }
>
> Is this along the lines of how indexers are implemented? If so, I will
> go ahead and commit them.
>
>
> shawn
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l



More information about the Bioperl-l mailing list