[Bioperl-l] Understanding LocatableSeq

Wes Barris wes.barris at csiro.au
Mon Nov 3 18:10:26 EST 2003


Hi,

I am trying to create an msf alignment of several LocatableSeq objects.
I have tried setting the "start" and "end" attributes of each LocatableSeq
object before adding it to the alignment but the resulting sequences are
still not aligned in the SimpleAlign object.  What am I doing wrong?

#!/usr/local/bin/perl -w
#
#
use strict;
use Bio::AlignIO;
#
my $aln = new Bio::SimpleAlign();
my $lseq;
$lseq = new Bio::LocatableSeq();
$lseq->seq('GATCGATC');
$lseq->id('this');
$lseq->start(1);
$lseq->end(8);
$aln->add_seq($lseq);

$lseq = new Bio::LocatableSeq();
$lseq->seq('ATCGAT');
$lseq->id('that');
$lseq->start(2);
$lseq->end(7);
$aln->add_seq($lseq);

my $outstream = new Bio::AlignIO(-format=>'msf', -file=>">junk.msf");
$outstream->write_aln($aln);
undef $outstream;


The output looks like this:


NoName   MSF: 2  Type: N  Tue Nov  4 09:01:58 2003  Check: 00 ..

  Name: this/1-8  Len:    8  Check:  2590  Weight:  1.00
  Name: that/2-7  Len:    6  Check:  1547  Weight:  1.00

//

this/1-8              GATCGATC
that/2-7              ATCGAT	<--- Should't this be shifted one position to the right?


I am using bioperl-1.2.3.
-- 
Wes Barris
E-Mail: Wes.Barris at csiro.au




More information about the Bioperl-l mailing list