DNA Sequence alignments in MATLAB behaving a bit weirdly

1 view (last 30 days)
Hi,
I have a large number of 30 base pair DNA sequences and I'm trying to get all pairwise alignments between them. I'm not interested in the score of the alignment so I made up a simple scoring matrix that allows me to count how many mismatches there are given the best alignment. I tried a couple things as sanity check, and now I'm not sure what's going on anymore. Essentially, I tried to align two sequences that are offset by one base. However, all the alignment functions in MATLAB that I have tried (nwalign, swalign, localalign) fail to see this and report that there are 12 mismatches between the sequences instead of 1. I've included the code for the test case below. What am I screwing up? Much appreciated..
%if true
a = 'AGTCAGTCAGTC';
b = 'GTCAGTCAGTCA';
mat = [0,1,1,1;
1,0,1,1;
1,1,0,1;
1,1,1,0];
nwalign(a,b,'alphabet','nt','scoringmatrix',mat,'gapopen',1)
%end
  1 Comment
Ingrid Tigges
Ingrid Tigges on 23 Jun 2013
Did I understand you correctly that you are seeing 12 mismatches when you are using a default scoring matrix? If I use for example this code
[x,y]=nwalign(a,b,'alphabet','nt','gapopen',1)
I only see one mismatch in the output of y.

Sign in to comment.

Answers (0)

Categories

Find more on Genomics and Next Generation Sequencing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!