Skip to content

Commit

Permalink
main.c don't print mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengyao Zhao committed Jul 19, 2016
1 parent ae11032 commit 2dd739d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC = gcc
CXX = g++
CFLAGS := -Wall -pipe -g#-O3
CFLAGS := -Wall -pipe -O3
CXXFLAGS := $(CFLAGS)
LOBJS = ssw.o
LCPPOBJS = ssw_cpp.o
Expand Down
4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* main.c
* Created by Mengyao Zhao on 06/23/11.
* Version 1.0
* Last revision by Mengyao Zhao on 06/24/16.
* Last revision by Mengyao Zhao on 07/19/16.
*/

#include <stdlib.h>
Expand Down Expand Up @@ -168,7 +168,7 @@ static void ssw_write (s_align* a,
uint32_t length = cigar_int_to_len(a->cigar[c]);
fprintf(stdout, "%lu%c", (unsigned long)length, letter);
}
fprintf(stderr, "%s\tmismatch: %d\n", read->name.s, mismatch);
// fprintf(stderr, "%s\tmismatch: %d\n", read->name.s, mismatch);
fprintf(stdout, "\t*\t0\t0\t");
for (c = a->read_begin1; c <= a->read_end1; ++c) fprintf(stdout, "%c", read_seq[c]);
fprintf(stdout, "\t");
Expand Down
10 changes: 0 additions & 10 deletions src/ssw.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,17 +857,12 @@ void align_destroy (s_align* a) {
}

uint32_t* add_cigar (uint32_t* new_cigar, int32_t* p, int32_t* s, uint32_t length, char op) {
// int i;
if ((*p) >= (*s)) {
// fprintf(stderr, "s_old:%d\tp: %d\n", *s, *p);
// for (i = 0; i < *s; ++i) fprintf(stderr, "new_cigar[%d]: %d\n", i, new_cigar[i]);
++(*s);
kroundup32(*s);
// fprintf(stderr, "s: %d\tnew_cigar_before: %p\n", *s, new_cigar);
new_cigar = (uint32_t*)realloc(new_cigar, (*s)*sizeof(uint32_t));
}
new_cigar[(*p) ++] = to_cigar_int(length, op);
// fprintf(stderr, "new_cigar_after: %p\n", new_cigar);
return new_cigar;
}

Expand All @@ -879,11 +874,9 @@ uint32_t* store_previous_m (int8_t choice, // 0: current not M, 1: current match
uint32_t* new_cigar) {

if ((*length_m) && (choice == 2 || !choice)) {
// fprintf(stderr, "call add_cigar in =\n");
new_cigar = add_cigar (new_cigar, p, s, (*length_m), '=');
(*length_m) = 0;
} else if ((*length_x) && (choice == 1 || !choice)) {
// fprintf(stderr, "call add_cigar in X\n");
new_cigar = add_cigar (new_cigar, p, s, (*length_x), 'X');
(*length_x) = 0;
}
Expand Down Expand Up @@ -936,20 +929,17 @@ int32_t mark_mismatch (int32_t ref_begin1,
read += length;
mismatch_length += length;
new_cigar = store_previous_m (0, &length_m, &length_x, &p, &s, new_cigar);
// fprintf(stderr, "call add_cigar in I\n");
new_cigar = add_cigar (new_cigar, &p, &s, length, 'I');
}else if (op == 'D') {
ref += length;
mismatch_length += length;
new_cigar = store_previous_m (0, &length_m, &length_x, &p, &s, new_cigar);
// fprintf(stderr, "call add_cigar in D\n");
new_cigar = add_cigar (new_cigar, &p, &s, length, 'D');
}
}
new_cigar = store_previous_m (0, &length_m, &length_x, &p, &s, new_cigar);

length = readLen - read_end1 - 1;
// fprintf(stderr, "call add_cigar in S\n");
if (length > 0) new_cigar = add_cigar(new_cigar, &p, &s, length, 'S');

(*cigarLen) = p;
Expand Down

0 comments on commit 2dd739d

Please sign in to comment.