Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengyao Zhao committed Jun 24, 2016
2 parents 26ebac0 + 7d84de2 commit 2f05f4a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
12 changes: 12 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.*~
example_c
example_cpp
libssw.so
libsswjni.so
ssw.jar
ssw.o
ssw/Aligner.class
ssw/Alignment.class
ssw/Example.class
ssw_cpp.o
ssw_test
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $(JAVA_JAR): $(JAVA_OBJ)
jar cvfe $@ ssw.Example $^

%.class: %.java
javac $<
javac -cp ./ $<

ssw.o: ssw.c ssw.h
$(CC) -c -o $@ $< $(CFLAGS)
Expand Down
14 changes: 7 additions & 7 deletions src/ssw_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ void BuildSwScoreMatrix(const uint8_t& match_score,

// The score matrix looks like
// // A, C, G, T, N
// score_matrix_ = { 2, -2, -2, -2, 0, // A
// -2, 2, -2, -2, 0, // C
// -2, -2, 2, -2, 0, // G
// -2, -2, -2, 2, 0, // T
// 0, 0, 0, 0, 0};// N
// score_matrix_ = { 2, -2, -2, -2, -2, // A
// -2, 2, -2, -2, -2, // C
// -2, -2, 2, -2, -2, // G
// -2, -2, -2, 2, -2, // T
// -2, -2, -2, -2, -2};// N

int id = 0;
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
matrix[id] = ((i == j) ? match_score : static_cast<int8_t>(-mismatch_penalty));
++id;
}
matrix[id] = 0;
matrix[id] = static_cast<int8_t>(-mismatch_penalty); // For N
++id;
}

for (int i = 0; i < 5; ++i)
matrix[id++] = 0;
matrix[id++] = static_cast<int8_t>(-mismatch_penalty); // For N

}

Expand Down

0 comments on commit 2f05f4a

Please sign in to comment.