[Bioperl-l] parsing SwissProt records -- need help

Anand Venkatraman bioperlanand at yahoo.com
Thu Oct 14 19:13:08 EDT 2004


HI,

I am new to Bioperl and I am using it to parse data
from SwissProt Records. 

I am trying to get all the accession numbers from the
SwissProt file. I am facing problems when I have more
than 1 accession number in 1 line - like for example

-------------------------
AC   P15456; Q9SAW0;
-------------------------
Sometimes they might go on for two lines as seen here

----------------------------------------------------------
ID   1A26_HUMAN     STANDARD;      PRT;   365 AA.
AC   P30450; O02963; O78073; P79563; Q30208; Q31623;
Q95377; Q9BD15;
AC   Q9BD19; Q9MW42; Q9TQK5;
----------------------------------------------------------


I tried this bit of code, but it only gives me the 1st
accession number it finds - P15456 from the 1st
example -  but I want to get both P15646 and Q9SAW0;

------------------------------------------------------------------
use strict;
use Bio::SeqIO;

my $sp_file = shift @ARGV or die$!;
my $seqio_object = Bio::SeqIO->new(-file => $sp_file,
-format => "swiss");

while (my  $seq_object = $seqio_object->next_seq) {
      print "Accession:
",$seq_object->accession_number(), "\n";
   }
------------------------------------------------------------------

Is there a way around?

Thanks in advance.

Anand

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Bioperl-l mailing list