[Bioperl-l] quick pairwise alignment

Alper Yilmaz alperyilmaz at gmail.com
Tue Nov 25 13:15:56 EST 2008


Hi,

I am getting two nucleotide sequences from a database and I want to quickly
align and view the result online(I'll wrap it in HTML). The examples I saw
online require saving files (either output file or input file). I tried
StandAloneBlast and tried to pass the sequences as Bio::Seq elements as
shown below

First I tried the Bioperl tutorial, section "IV.2.2 Aligning 2 sequences
with Blast using bl2seq and AlignIO"

  $factory = Bio::Tools::Run::StandAloneBlast->new('outfile' => 'bl2seq.out');
  my $seq1='AGCTACGATCAGCACTACGACTACGACTACGACTACACTAGCTAC' ;
  my $seq2='AGCTACGATCACCACTACGACTACGGCTACGACTACACGAGCTAC' ;
  $bl2seq_report = $factory->bl2seq($seq1, $seq2);

The result I got was the following error:
------------- EXCEPTION: Bio::Root::Exception -------------
MSG:  AGCTACGATCAGCACTACGACTACGACTACGACTACACTAGCTAC  not Seq Object or file
name!


Then I used Bio::Seq objects as shown:

my $factory = Bio::Tools::Run::StandAloneBlast->new('outfile' =>
'/tmp/bl2seq.out');
my $seq1 = Bio::Seq->new(-id=>$seqname1,-seq=>$ntseq1);
my $seq2 = Bio::Seq->new(-id=>$seqname2,-seq=>$ntseq2);

my $alignment = $factory->bl2seq($seq1, $seq2);

- The result I got is bl2seq crashed error. As fas as I can tell
StandAloneBlast cannot write to temporary files that are defined by
"_rootio_tempfiles" in Bio::Root::IO. The detail is below:
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: bl2seq call crashed: 256 | No such file or directory | /usr/bin/bl2seq
-j /tmp/sNpLUbS6jJ -i /tmp/aNWLAj_ZDN -o /tmp/bl2seq.out


So, is there a way to do alignments without reading/writing files? Is there
a quick way to align two sequence that are kept in $seq1 and $seq2
variables? I had trouble installing Bioperl-Ext package, if there's a tool
in that package I can try harder to install Ext package.

thanks,
alper


More information about the Bioperl-l mailing list