[Bioperl-l] Bioperl 1.4 to 1.5.2, adding qualifiers to Bio::Seq-objects

Adam Sjøgren adsj at novozymes.com
Wed Feb 7 17:11:32 UTC 2007


  Hi.


I am transitioning from Bioperl 1.4 to 1.5.2, and the qualifiers I add
to features in Bio::Seq objects have stopped appearing when I output
them as EMBL or GenBank-files.

Below is a test-script that exercises the problem.

I guess I should be doing something else when adding qualifiers, now
with 1.5.2 (as reading an EMBL-file with Bio::SeqIO and outputting it
again of course works perfectly), but I can't deduce what from perldoc
Bio::SeqFeature::Generic - it still lists the add_tag_value method,
and calling it doesn't croak nor warn.

I have found some comments on this in the release notes of 1.5.0¹ on
the Bioperl wiki, but I must admit I wasn't able to extract what
methods I should be calling instead.

If someone could point me to the relevant documentation or tell me
what method to use instead, I would be happy as a clam.


  Best regards,

    Adam

== =
use Test::More tests=>2;

use strict;
use warnings;

use Bio::Seq;
use Bio::SeqFeature::Generic;
use IO::String;
use Bio::SeqIO;

my $seq=Bio::Seq->new(
                      -seq=>'actgactgactg',
                     );

$seq->display_id('D27');
$seq->accession_number('DB:D27');

my $seq_feature=Bio::SeqFeature::Generic->new(
                                              -strand=>1,
                                              -primary=>'source',
                                             );
$seq_feature->set_attributes(-start=>2, -end=>8);
$seq_feature->add_tag_value(note=>'TEST');
$seq_feature->add_tag_value(db_xref=>'DB:D27');

$seq->add_SeqFeature($seq_feature);

my $raw='';
my $fh=IO::String->new($raw);
my $out=Bio::SeqIO->new(-format=>'EMBL', -fh=>$fh);
$out->write_seq($seq);

ok($raw=~m!/note!, 'Qualifier note found');
ok($raw=~m!/db_xref!, 'Qualifier db_xref found');
== =


¹ <http://www.bioperl.org/wiki/Core_1.4.0_1.5.0_delta>

-- 
                                                          Adam Sjøgren
                                                    adsj at novozymes.com



More information about the Bioperl-l mailing list