[Bioperl-l] avoiding feature parsing

Marc Logghe Marc.Logghe at devgen.com
Fri Jun 10 05:05:30 EDT 2005


Hi Danny,

> my $seqio = Bio::SeqIO->new(-file => "$dir/$gi", -format => "fasta");
> 
> and to my surprise it seems to parse the genbank files 
> correctly but only gets the sequence, which seems to solve 
> the problem.  My only question is "Is this the expected 
> behavior and can I rely on this working?  And.  Is their any 

Problem is, bioperl actually has parsed the complete gebank record,
*including* the feature table. Of course, they do not show up in the
fasta dump, but all features are attached to the sequence object
anyways. This is the default behaviour.
But you can say to the builder that you are not interested in the
features.
>From the perldoc of Bio::Seq::SeqBuilder:

my $builder = $seqio->sequence_builder();
# if you need only sequence, id, and description (e.g. for
# conversion to FASTA format):
$builder->want_none();
$builder->add_wanted_slot('display_id','desc','seq');

# if you want everything except the sequence and features
$builder->want_all(1); # this is the default if it's untouched
$builder->add_unwanted_slot('seq','features');

HTH,
Marc



More information about the Bioperl-l mailing list