[Bioperl-l] Locuslink parser
Hilmar Lapp
hlapp at gnf.org
Thu Feb 12 14:09:51 EST 2004
On Thursday, February 12, 2004, at 09:46 AM, Law, Annie wrote:
> I am most intereste in obtaining the fields locuslink id, GO id,
> accession number, unigene id.
The locuslink ID is the $seq->accession_number. GO should be there as
term annotations, unigene ID and other accessions should be present as
dbxref annotations.
You can test for an annotation being a term annotation or a dbxref:
foreach my $ann (@annotations) {
if ($ann->isa("Bio::Ontology::TermI")) {
# this is an ontology term as annotation
}
if ($ann->isa("Bio::Annotation::DBLink")) {
# this is a dbxref annotation
}
}
Using the map function you can easily filter for annotation types, for
example:
@term_annotations = map { $_->isa("Bio::Ontology::TermI"); }
$seq->get_Annotations();
BTW if you want to get all annotations from a seq object, you can just
say $seq->get_Annotations() and omit the key.
Hth,
-hilmar
--
-------------------------------------------------------------
Hilmar Lapp email: lapp at gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
-------------------------------------------------------------
More information about the Bioperl-l
mailing list