[Bioperl-l] question about locatableseq object

Kevin Brown Kevin.M.Brown at asu.edu
Wed Jan 21 17:51:44 UTC 2009


The Sequence you give the bio::locatableseq needs to be the full
sequence from which it comes from and include gap characters.

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

Or

$seq = new Bio::LocatableSeq(
-seq         => 'ATCCACGTCTGAG-GA--TTC',
-display_id  => 'SEQ2',
-start       => 5,
-end         => 11,
);

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org 
> [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of Paolo Pavan
> Sent: Wednesday, January 21, 2009 10:18 AM
> To: bioperl-l at lists.open-bio.org
> Subject: [Bioperl-l] question about locatableseq object
> 
> 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
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 




More information about the Bioperl-l mailing list