From: Mongkut Piantanakulchai on
Dear Lucio,

I have another question to ask about affinegapmex or simplegapmex.
From your example code, sent1 and sent2 are needed to be converted using
uint8 function.
My question is "can affinegapmex or simplegapmex deal with number greater than 127?" because the maximum value for int8 is 127.

As an exmaple, I am trying to compare two sequence (I don't want to convert them to characters but to use numbers instead, however my numbers exceeds 127)
sent1=[1 150 23]
sent2=[150 23 3]

I tried to change the code from uint8 to uint16 but it seems that the results are not correct.

Thanks in advance,

Mongkut P.



"Lucio Cetto" <lcetto(a)nospam.mathworks.com> wrote in message <hs13bk$rvi$1(a)fred.mathworks.com>...
> This is not officially documented but I think should be easy to do. Create a function that calls affinegapmex (or simplegapmex) in the same way nwalign calls them. These private functions require sequences of integers (which are not limited to 24 symbols). Place a stop point in the debuger to learn how these private functions are called from within nwalign.
>
> Here there is a try:
> function alignment = alignsentences(sent1,sent2)
>
> M = eye(256).*2 - 1;
> [~, path(:,2), path(:,1)] = affinegapmex(uint8(sent1), uint8(sent2), -2, -1, M, 1);
> path = path(sum(path,2)>0,:);
> path = flipud(path);
> alignment = repmat(('--')',1,size(path,1));
> alignment(1,path(:,1)>0) = sent2;
> alignment(2,path(:,2)>0) = sent1;
>
> Then:
> >> alignsentences('This is a nice test','This is a very nice test')
>
> ans =
>
> This is a very nice test
> This is a -----nice test
>
> HTH
> Lucio
>
> "Mongkut Piantanakulchai" <mongkutp.remove.this(a)gmail.com> wrote in message <hs0kbk$b47$1(a)fred.mathworks.com>...
> > Thanks for pointing me out.
> > After reading the help carefully I found that NWALIGN() allow me to put my own scoring matrix.
> > However, it only limits me with 24x24 scoring matrix (so my customized scoring matrix should be 24x24)
> > It just come to my mind that I can map my sequence characters into 24 types + specifying my own scoring matrix?
> >
> > Any other idea?
> >
> > Thanks !
> >
> > Mongkut