diff options
author | Calvin <calvin@EESI> | 2013-06-12 12:39:37 -0400 |
---|---|---|
committer | Calvin <calvin@EESI> | 2013-06-12 12:39:37 -0400 |
commit | e1712839c4b091179f35ee9849c20b2581a9fc8f (patch) | |
tree | 0f8579db200b25a5d505ca4cf6a5068db29fa618 | |
parent | 13351ef77d9f9f1cd130e7cf3fb9ce5b5cfc83e8 (diff) |
add --version and -V
-rw-r--r-- | src/c/Makefile | 9 | ||||
-rw-r--r-- | src/c/multifasta_to_otu.1 | 3 | ||||
-rw-r--r-- | src/c/multifasta_to_otu.c | 9 | ||||
-rw-r--r-- | src/c/quikr.1 | 3 | ||||
-rw-r--r-- | src/c/quikr.c | 9 | ||||
-rw-r--r-- | src/c/quikr_train.1 | 3 | ||||
-rw-r--r-- | src/c/quikr_train.c | 9 |
7 files changed, 36 insertions, 9 deletions
diff --git a/src/c/Makefile b/src/c/Makefile index 152121a..35bc645 100644 --- a/src/c/Makefile +++ b/src/c/Makefile @@ -1,11 +1,14 @@ +VERSION=\"v1.0.3\" UNAME := $(shell uname) CC = gcc -QUIKR_TRAIN_CFLAGS = -O3 -s -mtune=native -Wall -lm -lz -D$(UNAME) -QUIKR_CFLAGS = -O3 -s -mtune=native -Wextra -Wall -lm -pthread -L../ -I../ -std=gnu99 -fopenmp -D$(UNAME) -lz +QUIKR_TRAIN_CFLAGS = -O3 -s -mtune=native -Wall -lm -lz -D$(UNAME) -DVERSION=$(VERSION) +MULTIFASTA_CFLAGS = -O3 -s -mtune=native -Wextra -Wall -lm -lz -pthread -L../ -I../ -std=gnu99 -fopenmp -D$(UNAME) -DVERSION=$(VERSION) +QUIKR_CFLAGS= -O3 -s -mtune=native -Wextra -Wall -lm -lz -std=gnu99 -D$(UNAME) -DVERSION=$(VERSION) + all: quikr_train_ quikr_ multifasta_to_otu_ multifasta_to_otu_: - $(CC) multifasta_to_otu.c quikr_functions.c nnls.c -o multifasta_to_otu $(QUIKR_CFLAGS) + $(CC) multifasta_to_otu.c quikr_functions.c nnls.c -o multifasta_to_otu $(MULTIFASTA_CFLAGS) quikr_train_: $(CC) quikr_train.c quikr_functions.c -o quikr_train $(QUIKR_TRAIN_CFLAGS) quikr_: diff --git a/src/c/multifasta_to_otu.1 b/src/c/multifasta_to_otu.1 index 2a00d5c..7e1fb83 100644 --- a/src/c/multifasta_to_otu.1 +++ b/src/c/multifasta_to_otu.1 @@ -51,6 +51,9 @@ the OTU table, with NUM_READS_PRESENT for each sample which is compatible with Q .TP .B \-v, --verbose verbose mode. +.TP +.B \-V, --version +print version. .SH USAGE 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 multifasta_to_otu will run one job per cpu core. diff --git a/src/c/multifasta_to_otu.c b/src/c/multifasta_to_otu.c index 01a4f0e..6d704dd 100644 --- a/src/c/multifasta_to_otu.c +++ b/src/c/multifasta_to_otu.c @@ -13,7 +13,7 @@ #define sensing_matrix(i,j) (sensing_matrix[width*i + j]) #define solutions(i,j) (solutions[sequences*i+ j]) -#define USAGE "Usage:\n\tmultifasta_to_otu [OPTION...] - create a QIIME OTU table based on Quikr results. \n\nOptions:\n\n-i, --input-directory\n\tthe directory containing the samples' fasta files of reads (note each file should correspond to a separate sample)\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. (sensing 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-j, --jobs\n\t specifies how many jobs to run at once. (default value is the number of CPUs)\n\n-o, --output\n\tthe OTU table, with NUM_READS_PRESENT for each sample which is compatible with QIIME's convert_biom.py (or a sequence table if not OTU's)\n\n-v, --verbose\n\tverbose mode." +#define USAGE "Usage:\n\tmultifasta_to_otu [OPTION...] - create a QIIME OTU table based on Quikr results. \n\nOptions:\n\n-i, --input-directory\n\tthe directory containing the samples' fasta files of reads (note each file should correspond to a separate sample)\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. (sensing 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-j, --jobs\n\t specifies how many jobs to run at once. (default value is the number of CPUs)\n\n-o, --output\n\tthe OTU table, with NUM_READS_PRESENT for each sample which is compatible with QIIME's convert_biom.py (or a sequence table if not OTU's)\n\n-v, --verbose\n\tverbose mode.\n\n-V, --version\n\tprint version." int main(int argc, char **argv) { @@ -58,11 +58,12 @@ int main(int argc, char **argv) { {"sensing-fasta", required_argument, 0, 'f'}, {"sensing-matrix", required_argument, 0, 's'}, {"verbose", no_argument, 0, 'v'}, + {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} }; int option_index = 0; - c = getopt_long (argc, argv, "k:l:f:s:i:o:j:hv", long_options, &option_index); + c = getopt_long (argc, argv, "k:l:f:s:i:o:j:hvV", long_options, &option_index); if (c == -1) break; @@ -92,6 +93,10 @@ int main(int argc, char **argv) { case 'v': verbose = 1; break; + case 'V': + printf("%s\n", VERSION); + exit(EXIT_SUCCESS); + break; case 'h': puts(USAGE); exit(EXIT_SUCCESS); diff --git a/src/c/quikr.1 b/src/c/quikr.1 index 9b32667..4afb52e 100644 --- a/src/c/quikr.1 +++ b/src/c/quikr.1 @@ -47,6 +47,9 @@ OTU_FRACTION_PRESENT a vector representing the percentage of database sequence's .B \-v, --verbose 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 diff --git a/src/c/quikr.c b/src/c/quikr.c index f588c5f..9946a30 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-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.\n\n-d, --debug\n\tdebug mode, read manpage for more details" int main(int argc, char **argv) { @@ -45,13 +45,14 @@ int main(int argc, char **argv) { {"sensing-fasta", required_argument, 0, 'f'}, {"sensing-matrix", required_argument, 0, 's'}, {"verbose", no_argument, 0, 'v'}, + {"version", no_argument, 0, 'V'}, {"debug", no_argument, 0, 'd'}, {0, 0, 0, 0} }; int option_index = 0; - c = getopt_long (argc, argv, "k:l:f:s:i:o:hdv", long_options, &option_index); + c = getopt_long (argc, argv, "k:l:f:s:i:o:hdvV", long_options, &option_index); if (c == -1) break; @@ -81,6 +82,10 @@ int main(int argc, char **argv) { case 'v': verbose = 1; break; + case 'V': + printf("%s\n", VERSION); + exit(EXIT_SUCCESS); + break; case 'h': printf("%s\n", USAGE); exit(EXIT_SUCCESS); diff --git a/src/c/quikr_train.1 b/src/c/quikr_train.1 index 6a058cd..ba6d17f 100644 --- a/src/c/quikr_train.1 +++ b/src/c/quikr_train.1 @@ -34,6 +34,9 @@ the sensing matrix. (a gzip'd text file) .TP .B \-v, --verbose verbose mode. +.TP +.B \-V, --version +print version. .SH EXAMPLES Use quikr_train to generate a sensing matrix from rdp7.fasta. This uses 6mers by default. .P diff --git a/src/c/quikr_train.c b/src/c/quikr_train.c index b169fcc..b5b111f 100644 --- a/src/c/quikr_train.c +++ b/src/c/quikr_train.c @@ -10,7 +10,7 @@ #include "quikr_functions.h" -#define USAGE "Usage:\n\tquikr_train [OPTION...] - train a database for use with quikr.\n\nOptions:\n\n-i, --input\n\tthe database of sequences to create the sensing matrix (fasta format)\n\n-k, --kmer\n\tspecify what size of kmer to use. (default value is 6)\n\n-o, --output\n\tthe sensing matrix. (a gzip'd text file)\n\n-v, --verbose\n\tverbose mode." +#define USAGE "Usage:\n\tquikr_train [OPTION...] - train a database for use with quikr.\n\nOptions:\n\n-i, --input\n\tthe database of sequences to create the sensing matrix (fasta format)\n\n-k, --kmer\n\tspecify what size of kmer to use. (default value is 6)\n\n-o, --output\n\tthe sensing matrix. (a gzip'd text file)\n\n-v, --verbose\n\tverbose mode.\n\n-V, --version\n\tprint version." int main(int argc, char **argv) { @@ -36,6 +36,7 @@ int main(int argc, char **argv) { while (1) { static struct option long_options[] = { {"verbose", no_argument, 0, 'v'}, + {"version", no_argument, 0, 'V'}, {"input", required_argument, 0, 'i'}, {"kmer", required_argument, 0, 'k'}, {"output", required_argument, 0, 'o'}, @@ -44,7 +45,7 @@ int main(int argc, char **argv) { int option_index = 0; - c = getopt_long (argc, argv, "i:o:k:hv", long_options, &option_index); + c = getopt_long (argc, argv, "i:o:k:hvV", long_options, &option_index); if (c == -1) break; @@ -62,6 +63,10 @@ int main(int argc, char **argv) { case 'v': verbose = 1; break; + case 'V': + printf("%s\n", VERSION); + exit(EXIT_SUCCESS); + break; case 'h': printf("%s\n", USAGE); exit(EXIT_SUCCESS); |