PERL : How to do a local alignement with a matrix EDNAFULL (Smith-Waterman algorythm)
1
0
Entering edit mode
7.1 years ago
jawhar.saks ▴ 10

Hello everybody.

I'm stuck on a problem and can't find a way out.

Like said in the title i wish to do a local alignement with a EDNAFULL matrix (to be able to work with iupac extended code for Dna). I'd like to output an alignment.

I'm working on a bigger code on perl, that's why i'm looking for perl solutions before trying external implementations.

I'll explain with an example what i want to do before sharing the solutions i tryed.

I start from :

    I start from : 
Sequence 1 : CTGATCCG
Sequence 2 : ATCGTCTGATYCNYNCTNATCS
    And i want to get :
Output1 :
         Alignement : 
     .....CTGATCCG.........
          ||||||||
     ATCGTCTGATYCNYNCTNATCS

Output 2 : CTGATYCN score : x%

To do that, i need to do a smith-waterman alignement i think. And i need to work with an EDNAFULL matix. It means this one for exemple :

    A   T   G   C   S   W   R   Y   K   M   B   V   H   D   N
A   5  -4  -4  -4  -4   1   1  -4  -4   1  -4  -1  -1  -1  -2
T  -4   5  -4  -4  -4   1  -4   1   1  -4  -1  -4  -1  -1  -2
G  -4  -4   5  -4   1  -4   1  -4   1  -4  -1  -1  -4  -1  -2
C  -4  -4  -4   5   1  -4  -4   1  -4   1  -1  -1  -1  -4  -2
S  -4  -4   1   1  -1  -4  -2  -2  -2  -2  -1  -1  -3  -3  -1
W   1   1  -4  -4  -4  -1  -2  -2  -2  -2  -3  -3  -1  -1  -1
R   1  -4   1  -4  -2  -2  -1  -4  -2  -2  -3  -1  -3  -1  -1
Y  -4   1  -4   1  -2  -2  -4  -1  -2  -2  -1  -3  -1  -3  -1
K  -4   1   1  -4  -2  -2  -2  -2  -1  -4  -1  -3  -3  -1  -1
M   1  -4  -4   1  -2  -2  -2  -2  -4  -1  -3  -1  -1  -3  -1
B  -4  -1  -1  -1  -1  -3  -3  -1  -1  -3  -1  -2  -2  -2  -1
V  -1  -4  -1  -1  -1  -3  -1  -3  -3  -1  -2  -1  -2  -2  -1
H  -1  -1  -4  -1  -3  -1  -3  -1  -3  -1  -2  -2  -1  -2  -1  
D  -1  -1  -1  -4  -3  -1  -1  -3  -1  -3  -2  -2  -2  -1  -1
N  -2  -2  -2  -2  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1

To achieve that, i found two Bioperl modules that may do it pretty well.

The first is :

"Bio::Tools::pSW - pairwise Smith Waterman object" here

And the second that may do the job is :

"Bio::Tools::dpAlign - Perl extension to do pairwise dynamic programming sequence alignment" here

To use them i realised that i had to get bioperl-ext

I found the documentation and files here

They say that Staden Package is needed.

But they add :

Currently, the Bio::SeqIO::staden::read extension only works with io_lib v. 1.8.11 or 1.8.12;

And the thing is i couldn't get this version.

I tryed with the last version. But Bioperl-ext makefile don't like the Io_lib in staden packages... The perl Makefile.Pl crash the moment i point the folder wich supposed to contain the io_lib...

Here is the solution that was suposed to do it :

use Bio::Tools::pSW;
use Bio::AlignIO;

 my $objetalign = Bio::Tools::pSW->new( '-matrix' => 'EDNAFULL',
                                       '-gap' => 12,
                                       '-ext' => 2,
                                       );

    $objetalign->align_and_show($sequence1,$sequence2,STDOUT);
    my $aln = $objetalign->pairwise_alignment($sequence1,$sequence2);
    my $alnout = Bio::AlignIO->new(-format => 'msf',
                                  -fh     => \*STDOUT);

    $alnout->write_aln($aln);

My questions are multiples:

Do you have another solution to do the job easily on perl ?

Do you know if the tools i try to use are still functional ? Many links about them don't work anymore...

Is it possible to do it with Bioperl basic packages ?

I'm hoping so hard that someone will stop by and say like :

"Oh, it's easy, use the Bioperl::Yolo package and you'll get it done"...Dreams you know....

Oh and feel free to correct me if i made a mistake, or ask if i forgot some informations.

Thank you for reading me. I know, it was long, but i tryed to give you any detail that seamed important.

smith-waterman perl local alignment ednafull • 3.2k views
ADD COMMENT
1
Entering edit mode
7.1 years ago

The bioperl modules are often wrapper for other programs. In your case, you could use the water program from the EMBOSS suite with Bio::Factory::EMBOSS Failing this, you could still write your own perl wrapper for the program of your choice.

ADD COMMENT
0
Entering edit mode

This looks totally like it !! I'll try it tonight, thank you.

ADD REPLY
0
Entering edit mode

Well i tryed to install emboss first and i'm stuck i don't know how to proceed.

I tryed to follow tutorials like

This one

or

This One

But couldn't get it installed, and for Bio::Factory::EMBOSS When i try to install it threw cpan with the command : install Bio::Factory::EMBOSS It say that i need Required executable for Bio::Tools::Run::[...] packages but i can't find a way to install them all...

One positive thing, i found out mEMBOSS, i forgot to precise i'm on Windows for the moment. It was in this post on this forum. It's Emboss tools for windows, it does the trick.

I'd steel love to implement this function to my code anyway, if you could help me find a way to make that idea work. I'd appreciate.

Thank you for your post anyway.

ADD REPLY

Login before adding your answer.

Traffic: 2693 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6