[Bioperl-l] question about locatableseq object

Paolo Pavan paolo.pavan at gmail.com
Wed Jan 21 17:17:59 UTC 2009


Hi all,
I have a question about the use of Bio::LocatableSeq. I haven't understood
the use of the -start and -end parameters, I found that they indicate the
position from where in a larger sequence the locatableSeq may have been
extracted. So I immagine that is possible to set a reference sequence and
set the position of another sequence referring to the first. But it seems I
haven't understood how, where is my fault and how I can solve the problem?
Below the code.
Thank you in advance,
Paolo

 use Bio::SimpleAlign;
use Bio::LocatableSeq;
use Bio::AlignIO;

my $aln = Bio::SimpleAlign->new();

$seq = new Bio::LocatableSeq(
-seq         => 'ACGTACGTACGT',
-display_id  => 'SEQ1',
-start       => 1,
-end         => 12,
);
$aln->add_seq($seq);



$seq = new Bio::LocatableSeq(
-seq         => 'ACGTCT',
-display_id  => 'SEQ2',
-start       => 5,
-end         => 11,
);
$aln->add_seq($seq);

Bio::AlignIO->new(-format =>'CLUSTALW')->write_aln ($aln);



the result is:
SEQ1/1-12              ACGTACGTACGT
SEQ2/6-12              ACGTCT
                       ****  ******
while I expect:
SEQ1/1-12              ACGTACGTACGT
SEQ2/6-12              ----ACGTCT



More information about the Bioperl-l mailing list