Question: PERL : How to do a local alignement with a matrix EDNAFULL (Smith-Waterman algorythm)
0
2.7 years ago by
jawhar.saks10
France
jawhar.saks10 wrote:

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.

ADD COMMENTlink
modified 2.7 years ago by Jean-Karim Heriche21k • written 2.7 years ago by jawhar.saks10
1
2.7 years ago by
EMBL Heidelberg, Germany
Jean-Karim Heriche21k wrote:

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 COMMENTlink written 2.7 years ago by Jean-Karim Heriche21k

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

ADD REPLYlink written 2.7 years ago by jawhar.saks10

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 REPLYlink modified 2.7 years ago • written 2.7 years ago by jawhar.saks10
Please log in to add an answer.

Content
Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1140 users visited in the last hour