[Bioperl-l] Problems to get secondary accessions from an object

stephan stephan.rosecker at ish.de
Wed Nov 9 12:04:36 EST 2005


Brian,

thanks for your answer.
Yes, I'am sure - my test sequence file (below) contains only one sequence.
I'm using bioperl 1.4 - I assume that "bioperl-live code" is
the newest code. I will test it.

A test with SeqIO works:

#!/xprog/perl/perl-5.9.1_inst/bin/perl
use lib "perl5";
use Bio::SeqIO;	
	my $seqio_object = Bio::SeqIO->new(-file => "s.swiss" );
	my $seq_object = $seqio_object->next_seq;
	my @acc = $seq_object->get_secondary_accessions;
	print $acc[0]."\n";
	print $acc[1]."\n";
	print $acc[2]."\n";

regards
stephan



s.swiss:

ID   128U_DROME     STANDARD;      PRT;   368 AA.
AC   Q9M641; P32234; AAR2D2; AAC3PO;
DT   01-OCT-1993 (Rel. 27, Created)
DT   01-OCT-1993 (Rel. 27, Last sequence update)
DT   01-FEB-1996 (Rel. 33, Last annotation update)
DE   GTP-binding protein 128UP.
GN   128UP OR GTP-BP.
OS   Drosophila melanogaster (Fruit fly).
OC   Eukaryota; Metazoa; Arthropoda; Hexapoda; Insecta; Pterygota;
OC   Neoptera; Endopterygota; Diptera; Brachycera; Muscomorpha;
OC   Ephydroidea; Drosophilidae; Drosophila.
OX   NCBI_TaxID=7227;
RN   [1]
RP   SEQUENCE FROM N.A.
RC   STRAIN=Oregon-R;
RX   MEDLINE=94166747; PubMed=8121394;
RA   Sommer K.A., Petersen G., Bautz E.K.F.;
RT   "The gene upstream of DmRP128 codes for a novel GTP-binding protein
RT   of Drosophila melanogaster.";
RL   Mol. Gen. Genet. 242:391-398(1994).
CC   -!- SIMILARITY: Belongs to the GTP1 / OBG family.
CC 
--------------------------------------------------------------------------
CC   This SWISS-PROT entry is copyright. It is produced through a 
collaboration
CC   between  the Swiss Institute of Bioinformatics  and the  EMBL 
outstation -
CC   the European Bioinformatics Institute.  There are no  restrictions 
on  its
CC   use  by  non-profit  institutions as long  as its content  is  in 
no  way
CC   modified and this statement is not removed.  Usage  by  and for 
commercial
CC   entities requires a license agreement (See 
http://www.isb-sib.ch/announce/
CC   or send an email to license at isb-sib.ch).
CC 
--------------------------------------------------------------------------
DR   EMBL; X71866; CAA50701.1; -.
DR   PIR; S42582; S42582.
DR   FlyBase; FBgn0010339; 128up.
DR   GO; GO:0005525; F:GTP binding; IDA.
DR   InterPro; IPR006074; GTP1/OBG_dom.
DR   InterPro; IPR006073; GTP1_OBG.
DR   InterPro; IPR006169; GTP1_OBG_sub.
DR   InterPro; IPR005225; Small_GTP.
DR   InterPro; IPR004095; TGS_dom.
DR   Pfam; PF01018; GTP1_OBG; 1.
DR   Pfam; PF02824; TGS; 1.
DR   PRINTS; PR00326; GTP1OBG.
DR   TIGRFAMs; TIGR00231; small_GTP; 1.
DR   PROSITE; PS00905; GTP1_OBG; 1.
KW   GTP-binding.
FT   NP_BIND      71     78       GTP (By similarity).
FT   NP_BIND     117    121       GTP (By similarity).
FT   NP_BIND     248    251       GTP (By similarity).
SQ   SEQUENCE   368 AA;  41129 MW;  07C592292BA12A6E CRC64;
      MITILEKISA IESEMARTQK NKATSAHLGL LKANVAKLRR ELISPKGGGG GTGEAGFEVA
      KTGDARVGFV GFPSVGKSTL LSNLAGVYSE VAAYEFTTLT TVPGCIKYKG AKIQLLDLPG
      IIEGAKDGKG RGRQVIAVAR TCNLIFMVLD CLKPLGHKKL LEHELEGFGI RLNKKPPNIY
      YKRKDKGGIN LNSMVPQSEL DTDLVKTILS EYKIHNADIT LRYDATSDDL IDVIEGNRIY
      IPCIYLLNKI DQISIEELDV IYKIPHCVPI SAHHHWNFDD LLELMWEYLR LQRIYTKPKG
      QLPDYNSPVV LHNERTSIED FCNKLHRSIA KEFKYALVWG SSVKHQPQKV GIEHVLNDED
      VVQIVKKV
//

Brian Osborne schrieb:
> Stephan,
> 
> Your code looks correct - are you sure that your sequences have secondary
> accessions? The bioperl-live code retrieves these accessions correctly, my
> script is below.
> 
> Brian O.
> 
> #!/usr/bin/perl
> 
> use strict;
> $ENV{BIOPERL_INDEX_TYPE} = "SDBM_File";
> $ENV{BIOPERL_INDEX} = ".";
> use Bio::Index::Swissprot;
> 
> my @accs = qw(P09651
>                   P12942
>                   P13798
>                   P58428);
> my $file_name = "multiple.sw";
> my $inx = Bio::Index::Swissprot->new(-filename => $file_name . ".idx",
>                                                   -write_flag => 1);
> $inx->id_parser(\&get_id);
> $inx->make_index($file_name);
> 
> for my $acc (@accs) {
>     my $seq = $inx->fetch($acc);
>     print $seq->seq(),"\n";
>     my @seconds = $seq->get_secondary_accessions;
>     print "@seconds\n";
> }
> 
> sub get_id {
>     my $line = shift;
>     $line =~ /AC\s+([A-Z]\d+);/;
>     $1;
> }
> 
> 
> 



> 
> On 11/9/05 9:19 AM, "stephan" <stephan.rosecker at ish.de> wrote:
> 
> 
>>Hi,
>>
>>I have problems to get the secondary_accessions from an seq object.
>>
>>E.G
>>
>>$inx = Bio::Index::Swissprot->new($Index_File_Name);
>>$prot = $inx->fetch( $accarray[ $_[0] ] );
>>#"$accarray[ $_[0]" is an array of accessions
>>
>>print "Description: " . $prot->description . "\n";
>>print "Accessions: " .$sec . "\n";
>>print "Species: " . $prot->species->binomial() . "\n";
>>print "Length: " . $prot->length . "\n";
>>#this looks good
>>
>>@a = $prot->get_secondary_accessions;
>>#@a is empty!
>>
>>Seems that $prot is not a reference to a rich:seq object or somthing
>>other is wrong.
>>
>>Hope that someone can help me.
>>
>>regards
>>stephan
>>
>>
>>_______________________________________________
>>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