[Bioperl-l] Extracting a particular feature from a sequence

Marc Logghe Marc.Logghe at devgen.com
Thu May 19 11:36:33 EDT 2005


Hi Michael,
I don't know what kind of information you need from the features but if
you are after the sequence I often use EMBOSS' extractfeat to do that.
The command looks like:
extractfeat test.gb -type CDS -tag gene -value STY2701
So you can specify the feature type, the tag name and value. Besides the
sequence, you can add more feature info (e.g. other tag values) to the
description line using the -describe option. Full docs at
http://emboss.sourceforge.net/apps/extractfeat.html
HTH,
ML



> -----Original Message-----
> From: bioperl-l-bounces at portal.open-bio.org 
> [mailto:bioperl-l-bounces at portal.open-bio.org] On Behalf Of 
> michael watson (IAH-C)
> Sent: Thursday, May 19, 2005 4:12 PM
> To: bioperl-l at portal.open-bio.org
> Subject: [Bioperl-l] Extracting a particular feature from a sequence
> 
> Hi
> 
> Sorry if this documentation exists, but if it does I haven't 
> been able to find it.
> 
> I want to find a feature with a particular tag=value pairing 
> in a sequence file.  The Feature and Annotation HOWTO 
> suggests a combination of grep and get_SeqFeatures:
> 
> my @cds_features = grep { $_->primary_tag eq 'CDS' }
> 	Bio::SeqIO->new(-file => $gb_file)->next_seq->get_SeqFeatures;
> 
> However, if I want to examine a feature for a particular gene 
> within a sequence containing an entire bacterial genome, the 
> above code is somewhat cumbersome, having to iterate through 
> all the features just to find one.
> 
> Just wondering if there was a method I could use to extract 
> just a single feature, something really nice like:
> 
> $seq->get_SeqFeature(-primary_tag => 'CDS', -locus_tag => 'STY2701');
> 
> Thanks
> Mick
> 
> _______________________________________________
> 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