From 75b61da3ab27712bd96690b1e52a4c3c12788d49 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Mon, 14 Apr 2014 13:15:47 -0400 Subject: merge --- Makefile | 15 ++++++++++----- kmer_locations.c | 5 +++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 745ee16..6e3f42f 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ VERSION=\"0.0.5\" CC = g++ CFLAGS = -O3 -s -march=native -Wall -Wextra -DVERSION=$(VERSION) -std=c++11 -DESTDIR = /usr/local/ +DESTDIR = /usr/local -all: libkmer.so kmer_total_count kmer_counts_per_sequence kmer_utils.o kmer_locations +all: libkmer.so kmer_total_count kmer_counts_per_sequence kmer_utils.o \ + kmer_locations kmer_continuous_count kmer_utils.o: kmer_utils.c $(CC) -c kmer_utils.c -O $(CFLAGS) -fPIC @@ -23,12 +24,16 @@ kmer_continuous_count: kmer_utils.o kmer_continuous_count.c kmer_utils.h kmer_locations: kmer_utils.o kmer_locations.c kmer_utils.h $(CC) kmer_utils.o kmer_locations.c -o kmer_locations $(CLIBS) $(CFLAGS) clean: - rm -vf kmer_locations kmer_total_count kmer_counts_per_sequence kmer_continuous_count kmer_utils.o libkmer.so + rm -vf kmer_total_count kmer_counts_per_sequence kmer_continuous_count \ + kmer_utils.o libkmer.so kmer_locations debug: CFLAGS = -ggdb -Wall -Wextra -DVERSION=$(VERSION)\"-debug\" -std=c++11 debug: all install: all - @cp -vf kmer_counts_per_sequence kmer_total_count kmer_continuous_count $(DESTDIR)/bin/ - @cp -vf libkmer.so $(DESTDIR)/lib/ + install kmer_counts_per_sequence $(DESTDIR)/bin + install kmer_total_count $(DESTDIR)/bin + install kmer_continuous_count $(DESTDIR)/bin + install kmer_locations $(DESTDIR)/bin + cp -vf libkmer.so $(DESTDIR)/lib/ diff --git a/kmer_locations.c b/kmer_locations.c index 56bf934..a6a2dc9 100644 --- a/kmer_locations.c +++ b/kmer_locations.c @@ -223,7 +223,6 @@ int main(int argc, char **argv) { } - unsigned long long sequence = 0; unsigned long long global_position = 0; while ((read = getdelim(&line, &len, '>', fh)) != -1) { @@ -241,6 +240,9 @@ int main(int argc, char **argv) { // strip out all other newlines to handle multiline sequences size_t seq_length = strnstrip(seq, '\n', strlen(seq)); + if(seq[seq_length - 1] == '>') + seq_length --; + for(k = 0; k < seq_length; k++) { seq[k] = alpha[(int)seq[k]]; } @@ -266,7 +268,6 @@ int main(int argc, char **argv) { if(seq_length != 0) { seq_length--; } - sequence++; global_position += seq_length; } -- cgit v1.2.3