[Bioperl-l] accessing optional qualifiers within features?

Samuel Aparicio saparici@hgmp.mrc.ac.uk
Mon, 13 Nov 2000 10:58:58 +0000


This is a multi-part message in MIME format.
--------------E69CE02889B7D1790E02343A
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit


Hi - Thanks for this, the example makes it clearer. I confess I had sort of
found
the module but hadn't made sense of the documentation in relation to the
description
of embl/genbank feature descriptions. If it is of any use I could contribute
a couple
of lines and simple examples to the documentation to help (I may not be the
right person
for this though! )

kind regards

Sam

ps - I think there may be a ) missing from the ($feat->has_tag("note")) to
close? ;-)

Hilmar Lapp wrote:

> Samuel Aparicio wrote:
> >
> > Hi everyone
> > I am wondering if there is a method in Bioperl which allows access to
> > optional qualifiers with features in a genbank/embl entry. For example,
> > being able to parse out
> > the value of /note in the example below.
> >
> >  repeat_region   1586..1760
> >                      /note="L1M1 repeat: matches 5299..5484 of
> > consensus"
> >
>
> Bio::Seq has a method all_SeqFeatures(). For every element of the returned
> array (a Bio::SeqFeatureI compliant object) you can call
> has_tag("tag_name") and each_tag_value("tag_name") in order to query for
> existence and retrieve the values associated with a tag. So,
>
> foreach $feat ($seq->all_SeqFeatures()) {
>         if(($feat->primary_tag() eq "repeat_region") &&
>            ($feat->has_tag("note")) {
>                 foreach $val ($feat->each_tag_value("note")) {
>                         print "note: $val\n";
>                 }
>         }
> }
>
> Hope this helps. BTW the mentioned methods are documented in the perldoc
> pages of their modules (Bio::Seq and Bio::SeqFeature::Generic).
>
>         Hilmar
> --
> -----------------------------------------------------------------
> Hilmar Lapp                                email: hlapp@gmx.net
> GNF, San Diego, Ca. 92122                  phone: +1 858 812 1757
> -----------------------------------------------------------------

--------------E69CE02889B7D1790E02343A
Content-Type: text/x-vcard; charset=us-ascii;
 name="saparici.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Samuel Aparicio
Content-Disposition: attachment;
 filename="saparici.vcf"

begin:vcard 
n:Aparicio;Samuel
tel;fax:+44 1223 336902
tel;work:+44 1223 762663
x-mozilla-html:TRUE
url:www.cimr.cam.ac.uk
org:CIMR - Wellcome Trust Centre for the Study of Molecular Mechanisms in Disease;Department of Oncology
version:2.1
email;internet:saparici@hgmp.mrc.ac.uk
title:Principal Investigator
adr;quoted-printable:;;CIMR Wellcome/MRC Building=0D=0AAddenbrookes;Cambridge;;CB2 2XY;United Kingdom
x-mozilla-cpt:;3
fn:Samuel Aparicio
end:vcard

--------------E69CE02889B7D1790E02343A--