[Bioperl-l] Parsing Entrez Gene ASN.1

Stefan Kirov stefan.kirov at bms.com
Wed Nov 28 22:16:18 UTC 2007


Here is an example for GO, will send the one for KEGG later:
my $eio=new Bio::SeqIO(-file=>$file,-format=>'entrezgene',
 	-service_record=>'yes');#, -locuslink=>'convert');
while (my $seq=$eio->next_seq) {
 	my $gid=$seq->accession_number;
 	foreach my $ot ($ann->get_Annotations('OntologyTerm')) {
     		next if ($ot->term->authority eq 'STS marker'); #Do not need STS markers
     		my $evid=$ot->comment;
     		$evid=~s/evidence: //i;
     		my @ref=$ot->term->get_references; #Really there should be just one?
     		my $id=$ot->identifier;
     		my $fid='GO:' . sprintf("%07u",$id);
     		print join("\t",$gid,$ot->ontology->name,$ot->name,$evid,$fid, at ref?$ref[0]->medline:''),"\n";
 	}
}
Please note there is a bug in the parser that makes it suck a lot of RAM. 
I am fixing this and will commit probably by the week's end- you will have 
to update at that point. If you work with few records this should not 
matter.
Stefan


On Thu, 29 Nov 2007, Smithies, Russell wrote:

> Has anyone got a good example of parsing ASN.1 with
> Bio::SeqIO::entrezgene?
> I'm trying to get GO ids and KEGG terms out but it's quite deeply nested
> and my Perl isn't that good  :-(
>
> Russell
> =======================================================================
> Attention: The information contained in this message and/or attachments
> from AgResearch Limited is intended only for the persons or entities
> to which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipients is prohibited by AgResearch
> Limited. If you have received this message in error, please notify the
> sender immediately.
> =======================================================================
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>



More information about the Bioperl-l mailing list