[Bioperl-l] Bio::DB::Fasta

Lincoln Stein lstein at cshl.edu
Thu Dec 11 17:11:22 EST 2003


Odd.  That module hasn't been changed in ages.

I'll look into it after I fix the Bio::Graphics problems.  I want to get 1.4 
out too.

Lincoln

On Thursday 11 December 2003 11:32 am, Jason Stajich wrote:
> There seems to be something wrong with the offsets in Bio::DB::Fasta
>
> $db->seq($id, $start => $end);
>
> Is returning and invalid value.
>
> We need to fix this pre-1.4 release.
> I don't have time to delve into the mysteries right now, but have
> submitted a bug report.
>
> #!/usr/bin/perl -w
> use strict;
> use Bio::DB::Fasta;
> use Bio::Index::Fasta;
> use Test;
> BEGIN { plan tests => 1}
> use Bio::SeqIO;
> use Bio::PrimarySeq;
> my $dbfile = 'db.fas';
> my $fas_db = Bio::DB::Fasta->new($dbfile);
>
> my $idx_db = Bio::Index::Fasta->new(-filename => '/tmp/test.idx',
> 				    -write_flag=> 1);
> $idx_db->make_index($dbfile);
>
> my ($id,$start,$end) = ('id1', 78408, 80349);
>
> my $seq1 = $fas_db->seq($id, $start => $end);
> my $seq2 = $idx_db->get_Seq_by_acc($id);
>
> my $out = Bio::SeqIO->new(-format => 'fasta', -file => ">o.fa");
> $out->write_seq(Bio::PrimarySeq->new(-id => 'db::fasta',
> 				-seq => $seq1));
>
> $out->write_seq(Bio::PrimarySeq->new(-id => 'index::fasta',
> 				-seq => $seq2->subseq($start,$end)));
>
>
> ok($seq1, $seq2->subseq($start,$end) );

-- 
========================================================================
Lincoln D. Stein                           Cold Spring Harbor Laboratory
lstein at cshl.org			                  Cold Spring Harbor, NY
========================================================================




More information about the Bioperl-l mailing list