diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | doc/cli.markdown | 12 | ||||
| -rw-r--r-- | src/c/quikr.1 | 3 | ||||
| -rw-r--r-- | src/c/quikr.c | 30 | 
4 files changed, 8 insertions, 39 deletions
| @@ -1,7 +1,7 @@  PREFIX = "/usr/"  all: nbc c -install:  +install: nbc c   	@echo installing executable files to ${DESTDIR}${PREFIX}/bin  	@mkdir -p ${DESTDIR}${PREFIX}/bin  	@cp -vf src/nbc/probabilities-by-read ${DESTDIR}${PREFIX}/bin/probabilities-by-read diff --git a/doc/cli.markdown b/doc/cli.markdown index e12f6a9..fa7bab3 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -47,7 +47,6 @@ quikr returns the solution vector as a csv file.      -o, --output OTU_FRACTION_PRESENT a vector representing the percentage of database sequence's presence in sample. (csv output)      -v, --verbose verbose mode.      -V, --version print version. -    -d, --debug debug mode, read manpage for more details  ## Multifasta\_to\_otu ##  The Multifasta\_to\_otu tool is a handy wrapper for quikr which lets the user @@ -58,7 +57,7 @@ Warning: this program will use a large amount of memory, and CPU time. You can  reduce the number of cores used, and thus memory, by specifying the -j flag  with aspecified number of jobs. Otherwise python with run one job per cpu core. -# Pre-processing of Multifasta\_to\_otu  # +### Pre-processing of Multifasta\_to\_otu  ###  * Please name fasta files of sample reads with <sample id>.fa<*> and place them    into one directory without any other file in that directory (for example, no @@ -67,7 +66,7 @@ with aspecified number of jobs. Otherwise python with run one job per cpu core.  * Fasta files of reads must have a suffix that starts with .fa (e.g.: .fasta and    .fa are valid while .fna is NOT) -### Usage ### +#### Usage ####      multifasta_to_otu's arguments:      -i, --input-directory the directory containing the samples' fasta files of  @@ -92,10 +91,11 @@ with aspecified number of jobs. Otherwise python with run one job per cpu core.  Unweighted.)  Pre-requisites: -1. <quikr_otu_table.txt> + +1. quikr_otu_table.txt (The OTU Table generated with multifasta_to_otu  2. the tree of the database sequences that were used (e.g.  dp7\_mafft.fasttree,     gg\_94\_otus\_4feb2011.tre, etc.) -3. your-defined <qiime_metadata_file.txt> +3. your-defined qiime_metadata_file.txt ( a Qiime Map file)  The QIIME procedue: @@ -105,7 +105,7 @@ The QIIME procedue:      make_3d_plots.py -i <quikr_otu_project_name>_weighted.txt -o <3d_pcoa_plotdirectory> -m <qiime_metadata_file> -#### Broken Pipe Errors #### +## Broken Pipe Errors ##  Make sure that you have the count-kmers and probablilties-by-read in your  $PATH, and that they are executable.  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 | 
