From 5df6980969d7fefd0ca90769bd3b566cb5210c01 Mon Sep 17 00:00:00 2001 From: Calvin Date: Tue, 14 May 2013 17:00:33 -0400 Subject: have matlab use global executables --- src/matlab/quikrCustomTrained.m | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/matlab/quikrCustomTrained.m') diff --git a/src/matlab/quikrCustomTrained.m b/src/matlab/quikrCustomTrained.m index b58aa31..c7961c7 100644 --- a/src/matlab/quikrCustomTrained.m +++ b/src/matlab/quikrCustomTrained.m @@ -15,19 +15,9 @@ if rws~=4^k error('Wrong k-mer size for input training matrix'); end -if (isunix && not(ismac)) - [status, counts]=unix([sprintf('./count-linux -r %d -1 -u ',k) ' ' inputfasta]); %count the 6-mers in the fasta file, in the forward direction, return the counts without labels. - if status ~= 0 - error('./count-linux failed: ensure count-linux is an executable. Try chmod a+rx count-linux. Be sure matlab/octave is in the same directory as count-linux'); - end -elseif ismac - [status, counts]=unix([sprintf('./count-osx -r %d -1 -u ',k) ' ' inputfasta]); %count the 6-mers in the fasta file, in the forward direction, return the counts without labels. - if status ~= 0 - error('./count-osx failed: ensure count-linux is an executable. Try chmod a+rx count-osx. Be sure matlab/octave is in the same directory as count-osx'); - end -elseif ispc - error('Windows is not yet supported'); -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 +if status ~= 0 + error('count-kmers failed: ensure count-kmers is in your path.'); counts=textscan(counts,'%f'); %read them in as floats. counts=counts{:}; @@ -39,4 +29,4 @@ Aaux=[ones(1,clumns);lambda*trainingmatrix]; %form the k-mer sensing matrix warning off xstar=lsqnonneg(Aaux,yaux); %perform the non-negative lease squares warning on -xstar=xstar/sum(xstar); %return the results as a probability vector \ No newline at end of file +xstar=xstar/sum(xstar); %return the results as a probability vector -- cgit v1.2.3