From a3ca860501cfe7202eb60cc98e65b572e164fd70 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Fri, 7 Jun 2013 21:33:07 -0400 Subject: quikrCustomTranied was not using the specified kmer. Use the correct kmer and also rename rws and clmns to rows and columns respectively : --- src/matlab/quikrCustomTrained.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/matlab/quikrCustomTrained.m') 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 -- cgit v1.2.3