diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2013-10-29 16:14:59 -0400 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2013-10-29 16:14:59 -0400 |
commit | d7f79dfe426c8357cce324980ab90e788671354d (patch) | |
tree | 9d5dfb84c1ed8748b4653e4fc6fde6190ed18ac6 | |
parent | b31de056a5b87c2aa58635871495c96de70859e6 (diff) |
update tpyes for quikr_train.c
-rw-r--r-- | src/c/quikr_train.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/c/quikr_train.c b/src/c/quikr_train.c index d90eb72..344f926 100644 --- a/src/c/quikr_train.c +++ b/src/c/quikr_train.c @@ -29,8 +29,9 @@ int main(int argc, char **argv) { // revision number int revision = 0; // iterators - long long i = 0; - long long position = 0; + long long i = 0; + unsigned long long j = 0; + unsigned long long position = 0; int verbose = 0; @@ -129,14 +130,14 @@ int main(int argc, char **argv) { // 4 ^ Kmer gives us the width, or the number of permutations of ACTG with // kmer length - long width = pow(4, kmer); - unsigned long sequences = count_sequences(fasta_filename); + unsigned long width = pow(4, kmer); + unsigned long long sequences = count_sequences(fasta_filename); if(sequences == 0) { fprintf(stderr, "Error: %s contains 0 fasta sequences\n", fasta_filename); } if(verbose) { - printf("sequences: %ld\nwidth: %ld\n", sequences, width); + printf("sequences: %llu\nwidth: %ld\n", sequences, width); printf("Writing our sensing matrix to %s\n", output_file); } @@ -166,7 +167,6 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - char *str = malloc(4096); if(str == NULL) { fprintf(stderr, strerror(errno)); @@ -211,8 +211,8 @@ int main(int argc, char **argv) { // relace A, C, G and T with 0, 1, 2, 3 respectively // everything else is 5 - for(i = 0; i < seq_length; i++) { - str[i] = alpha[(int)str[i]]; + for(j = 0; j < seq_length; j++) { + str[j] = alpha[(int)str[j]]; } // set counts to zero @@ -224,7 +224,7 @@ int main(int argc, char **argv) { unsigned long multiply = 1; // for each char in the k-mer check if it is an error char - for(i = position + kmer - 1; i >= position; i--){ + for(i = position + kmer - 1; i >= (signed)position; i--){ if(str[i] >> 2) { mer = width; position = i; @@ -242,8 +242,8 @@ int main(int argc, char **argv) { counts[mer]++; } - for(i = 0; i < width; i++) { - gzprintf(output, "%lld\n", counts[i]); + for(j = 0; j < width; j++) { + gzprintf(output, "%lld\n", counts[j]); } } |