summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/c/quikr.13
-rw-r--r--src/c/quikr.c30
2 files changed, 1 insertions, 32 deletions
diff --git a/src/c/quikr.1 b/src/c/quikr.1
index 4afb52e..ee0960e 100644
--- a/src/c/quikr.1
+++ b/src/c/quikr.1
@@ -49,9 +49,6 @@ verbose mode.
.TP
.B \-V, --version
print version.
-.TP
-.B \-d, --debug
-debug mode, this will save our sensing matrix and sample matrix (A and B matricies) in files called 'sensing.matrix' and 'count.matrix' for debugging purposes
.SH EXAMPLES
Use quikr to calculate the estimated frequencies for sample.fa, using rdp7.fasta as the sensing matrix we generated with quikr_train. This uses 6-mers by default, and a lambda value of 10000:
.P
diff --git a/src/c/quikr.c b/src/c/quikr.c
index 8389cf4..c209515 100644
--- a/src/c/quikr.c
+++ b/src/c/quikr.c
@@ -12,7 +12,7 @@
#include "quikr_functions.h"
#define sensing_matrix(i,j) (sensing_matrix[width*i + j])
-#define USAGE "Usage:\n\tquikr [OPTION...] - Calculate estimated frequencies of bacteria in a sample.\n\nOptions:\n\n-i, --input\n\tthe sample's fasta file of NGS READS (fasta format)\n\n-f, --sensing-fasta\n\tlocation of the fasta file database used to create the sensing matrix (fasta format)\n\n-s, --sensing-matrix\n\t location of the sensing matrix. (trained from quikr_train)\n\n-k, --kmer\n\tspecify what size of kmer to use. (default value is 6)\n\n-l, --lambda\n\tlambda value to use. (default value is 10000)\n\n-o, --output\n\tOTU_FRACTION_PRESENT a vector representing the percentage of database sequence's presence in sample. (csv output)\n\n-v, --verbose\n\tverbose mode.\n\n-V, --version\n\tprint version.\n\n-d, --debug\n\tdebug mode, read manpage for more details"
+#define USAGE "Usage:\n\tquikr [OPTION...] - Calculate estimated frequencies of bacteria in a sample.\n\nOptions:\n\n-i, --input\n\tthe sample's fasta file of NGS READS (fasta format)\n\n-f, --sensing-fasta\n\tlocation of the fasta file database used to create the sensing matrix (fasta format)\n\n-s, --sensing-matrix\n\t location of the sensing matrix. (trained from quikr_train)\n\n-k, --kmer\n\tspecify what size of kmer to use. (default value is 6)\n\n-l, --lambda\n\tlambda value to use. (default value is 10000)\n\n-o, --output\n\tOTU_FRACTION_PRESENT a vector representing the percentage of database sequence's presence in sample. (csv output)\n\n-v, --verbose\n\tverbose mode.\n\n-V, --version\n\tprint version."
int main(int argc, char **argv) {
@@ -77,8 +77,6 @@ int main(int argc, char **argv) {
case 'o':
output_filename = optarg;
break;
- case 'd':
- debug = 1;
case 'v':
verbose = 1;
break;
@@ -170,32 +168,6 @@ int main(int argc, char **argv) {
for(x = 0; x < width; x++)
count_matrix[x] = count_matrix[x] * lambda;
- // output our matricies if we are in verbose mode
- if(debug) {
- FILE *sensing_matrix_fh = fopen( "sensing.matrix", "w");
- if(sensing_matrix_fh == NULL) {
- fprintf(stderr, "could not open sensing.matrix for writing.\n");
- exit(EXIT_FAILURE);
- }
- for(x = 0; x < sequences; x++) {
- for( y = 0; y < width; y++) {
- fprintf(sensing_matrix_fh, "%.10f\t", sensing_matrix(x, y));
- }
- fprintf(sensing_matrix_fh, "\n");
- }
- fclose(sensing_matrix_fh);
-
- FILE *count_matrix_fh = fopen("count.matrix", "w");
- if(count_matrix_fh == NULL) {
- fprintf(stderr, "could not open sensing.matrix for writing.\n");
- exit(EXIT_FAILURE);
- }
- for(x = 0; x < width; x++) {
- fprintf(count_matrix_fh, "%.10f\n", count_matrix[x]);
- }
- fclose(count_matrix_fh);
- }
-
double *solution = nnls(sensing_matrix, count_matrix, sequences, width);
// normalize our solution vector