summaryrefslogtreecommitdiff
path: root/src/matlab/quikrCustomTrained.m
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2013-06-07 21:33:07 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2013-06-07 21:33:07 -0400
commita3ca860501cfe7202eb60cc98e65b572e164fd70 (patch)
treedf9e4610c086ee2d2a5d66cef05edc802b3b1f53 /src/matlab/quikrCustomTrained.m
parent7665d8e216c63a7c4ce8fc982767529273365941 (diff)
quikrCustomTranied was not using the specified kmer. Use the correct kmer and also rename rws and clmns to rows and columns respectively
:
Diffstat (limited to 'src/matlab/quikrCustomTrained.m')
-rw-r--r--src/matlab/quikrCustomTrained.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/matlab/quikrCustomTrained.m b/src/matlab/quikrCustomTrained.m
index c7961c7..e594951 100644
--- a/src/matlab/quikrCustomTrained.m
+++ b/src/matlab/quikrCustomTrained.m
@@ -10,12 +10,12 @@ if nargin~=4
error('There must be exactly 4 input arguments: the training matrix, the /path/to/input/fastafile, the k-mer size, and lambda');
end
-[rws, clumns]=size(trainingmatrix); %get the size of the training matrix
-if rws~=4^k
+[rows, columns]=size(trainingmatrix); %get the size of the training matrix
+if rows~=4^k
error('Wrong k-mer size for input training matrix');
end
-[status, counts]=unix(['count-kmers -r 6 -1 -u ' inputfasta]); %count the 6-mers in the fasta file, in the forward direction, return the counts without labels
+[status, counts]=unix([sprintf('count-kmers -r %d -1 -u ',k) ' ' inputfasta]); %count the k-mers in the fasta file, in the forward direction, return the counts without labels.
if status ~= 0
error('count-kmers failed: ensure count-kmers is in your path.');
@@ -25,7 +25,7 @@ counts=counts/sum(counts); %normalize the counts into a probability vector
yaux=[0;lambda*counts]; %form the sample vector
-Aaux=[ones(1,clumns);lambda*trainingmatrix]; %form the k-mer sensing matrix
+Aaux=[ones(1,columns);lambda*trainingmatrix]; %form the k-mer sensing matrix
warning off
xstar=lsqnonneg(Aaux,yaux); %perform the non-negative lease squares
warning on