[Bioperl-l] Re: [Bioperl-guts-l] genbank accession from swissprot

James Wasmuth james.wasmuth at ed.ac.uk
Wed Sep 1 09:29:30 EDT 2004


Oh, my mistake, Hilmar fixed this about a month ago and the updated 
version is in the CVS -

http://cvs.bioperl.org/cgi-bin/viewcvs/viewcvs.cgi/bioperl-live/Bio/SeqIO/swiss.pm

so it should now give:

gene_name => Value: apaG; Atu0431; AGR_C_759


-james


Jinal Jhaveri wrote:

>Hi James,
>
>Thanks for your help. This still doesn't solve the problem of fetching 
>OrderedLocusNames field.
>
>thanks
>--Jinal
>On Wednesday 01 September 2004 08:35 am, you wrote:
>  
>
>>Hi Jinal,
>>
>>you need to delete the $seqio->next_seq from the eval block. This has
>>the effect of removing the entry from the object. When you later use the
>>next_seq method, $seqio is emtpy.
>>
>>-james
>>
>>Jinal Jhaveri wrote:
>>    
>>
>>>Hi everyone,
>>>
>>>I am trying to fetch the genbank locustag from the swissprot entry. My
>>>entry looks like this:
>>>
>>>DT   01-OCT-2004 (Rel. 45, Last annotation update)
>>>DE   Protein apaG.
>>>GN   Name=apaG; OrderedLocusNames=Atu0431, AGR_C_759;
>>>OS   Agrobacterium tumefaciens (strain C58 / ATCC 33970).
>>>OC   Bacteria; Proteobacteria; Alphaproteobacteria; Rhizobiales;
>>>OC   Rhizobiaceae; Rhizobium/Agrobacterium group; Agrobacterium.
>>>OX   NCBI_TaxID=176299;
>>>
>>>
>>>I am interested in OrderedLocusNames i.e Atu0431 from the GN line.
>>>Currently my code looks like follows. Its not giving me the requed field
>>>though. Does anyone have any links / ideas / suggestions? Am I doing
>>>anything wrong?
>>>
>>>Code Snippet:
>>>
>>>my $sprotfile = shift; #name of the input sprot file
>>>
>>>if ($sprotfile eq '') {
>>> print "Please error the input swissprot file name:\n Usage perl
>>>sprot_to_tab.pl";
>>> exit(1);
>>> }
>>>
>>>eval {
>>>   $seqio = Bio::SeqIO->new(-file => "$sprotfile",-format => 'swiss');
>>>   $seq = $seqio->next_seq;
>>>};
>>>
>>>if ($@ ne '') {
>>>   print "ERROR in opening the swissprot file",$@;
>>>   exit(1);
>>>}
>>>
>>>
>>>#Reading the seq_object from the sprot file
>>>
>>>print "NCBI:Sequence:Length\n";
>>>while( my $seq = $seqio->next_seq ){
>>> print "\nSequence is :".$seq->seq."\tAccnumber".$seq->accession_number;
>>>
>>> $ac= $seq->annotation();
>>> foreach $key ( $ac->get_all_annotation_keys() ) {
>>>      @values = $ac->get_Annotations($key);
>>>      foreach $value ( @values ) {
>>>                    print "Annotation ",$key," stringified value ",
>>>$value->as_text,"\n";
>>>        }
>>> }
>>>
>>>...
>>>
>>>
>>>
>>>_______________________________________________
>>>Bioperl-guts-l mailing list
>>>Bioperl-guts-l at portal.open-bio.org
>>>http://portal.open-bio.org/mailman/listinfo/bioperl-guts-l
>>>      
>>>

-- 
"Until man duplicates a blade of grass, nature can laugh at his so-called scientific knowledge...."
            --Thomas Edison 

Blaxter Nematode Genomics Group  |
School of Biological Sciences    |
Ashworth Laboratories            | tel: +44 131 650 7403
University of Edinburgh          | web: www.nematodes.org
Edinburgh                        |
EH9 3JT                          |
UK                               |	




More information about the Bioperl-l mailing list