From fdc2ab95726b27ffabf70a73c00c266aa2717873 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Wed, 12 Mar 2014 16:06:25 -0400 Subject: update cli for reverse-compliment counting --- kmer_continuous_count.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'kmer_continuous_count.c') diff --git a/kmer_continuous_count.c b/kmer_continuous_count.c index a7c35f0..7eb617d 100644 --- a/kmer_continuous_count.c +++ b/kmer_continuous_count.c @@ -11,13 +11,14 @@ void help() { - printf("usage: kmer_continuous_count -i input_file -k kmer [-n] [-l] ...\n\n" + printf("usage: kmer_continuous_count -i input_file -k kmer [-c] [-n] [-l] ...\n\n" "count mers in size k from a fasta file, but do so continuously\n" "\n" - " --input -i input fasta file to count\n" - " --kmer -k size of mers to count\n" - " --nonzero -n only print non-zero values\n" - " --label -l print mer along with value\n" + " --input -i input fasta file to count\n" + " --kmer -k size of mers to count\n" + " --compliment -c count compliment of sequences\n" + " --nonzero -n only print non-zero values\n" + " --label -l print mer along with value\n" "\n" "Report all bugs to mutantturkey@gmail.com\n" "\n" @@ -40,6 +41,7 @@ int main(int argc, char **argv) { bool nonzero = false; bool label = false; bool kmer_set = false; + bool count_compliment = false; unsigned long long width = 0; @@ -48,6 +50,7 @@ int main(int argc, char **argv) { static struct option long_options[] = { {"input", required_argument, 0, 'i'}, {"kmer", required_argument, 0, 'k'}, + {"compliment", required_argument, 0, 'c'}, {"nonzero", no_argument, 0, 'n'}, {"label", no_argument, 0, 'l'}, {"help", no_argument, 0, 'h'}, @@ -59,7 +62,7 @@ int main(int argc, char **argv) { int option_index = 0; int c = 0; - c = getopt_long (argc, argv, "i:k:nlvh", long_options, &option_index); + c = getopt_long (argc, argv, "i:k:cnlvh", long_options, &option_index); if (c == -1) break; @@ -72,6 +75,9 @@ int main(int argc, char **argv) { kmer = atoi(optarg); kmer_set = true; break; + case 'c': + count_compliment = true; + break; case 'n': nonzero = true; break; @@ -116,7 +122,7 @@ int main(int argc, char **argv) { width = pow_four(kmer); - unsigned long long *counts = get_continuous_kmer_counts_from_file(fh, kmer); + unsigned long long *counts = get_continuous_kmer_counts_from_file(fh, kmer, count_compliment); // If nonzero is set, only print non zeros if(nonzero) { -- cgit v1.2.3