Skip to content

Commit

Permalink
v1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Yan Gao committed Jul 13, 2021
1 parent 7f36134 commit 0c8f941
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
[![Build Status](https://img.shields.io/travis/yangao07/abPOA/master.svg?label=Master)](https://travis-ci.org/yangao07/abPOA)
[![License](https://img.shields.io/badge/License-MIT-black.svg)](https://github.com/yangao07/abPOA/blob/master/LICENSE)
<!-- [![PyPI](https://img.shields.io/pypi/v/pyabpoa.svg?style=flat)](https://pypi.python.org/pypi/pyabpoa) -->
## Updates (v1.2.4)
## Updates (v1.2.5)

- Fix an overflow bug
- Fix a bug in abpoa_poa

## Getting started
Download the [latest release](https://github.com/yangao07/abPOA/releases):
```
wget https://github.com/yangao07/abPOA/releases/download/v1.2.4/abPOA-v1.2.4.tar.gz
tar -zxvf abPOA-v1.2.4.tar.gz && cd abPOA-v1.2.4
wget https://github.com/yangao07/abPOA/releases/download/v1.2.5/abPOA-v1.2.5.tar.gz
tar -zxvf abPOA-v1.2.5.tar.gz && cd abPOA-v1.2.5
```
Make from source and run with test data:
```
Expand Down Expand Up @@ -65,7 +65,7 @@ abPOA supports three alignment modes (global, local, extension) and flexible sco
It right now supports SSE2/SSE4.1/AVX2/AVX512F/AVX512BW vectorization and more advanced instructions
will be supported in the future.

For more information, please refer to our [preprint paper](https://doi.org/10.1101.2.40.05.07.083196).
For more information, please refer to our [preprint paper](https://doi.org/10.1101.2.50.05.07.083196).

## <a name="install"></a>Installation

Expand All @@ -80,9 +80,9 @@ You can also build abPOA from source files.
Make sure you have gcc (>=6.4.0) and zlib installed before compiling.
It is recommended to download the [latest release](https://github.com/yangao07/abPOA/releases).
```
wget https://github.com/yangao07/abPOA/releases/download/v1.2.4/abPOA-v1.2.4.tar.gz
tar -zxvf abPOA-v1.2.4.tar.gz
cd abPOA-v1.2.4; make
wget https://github.com/yangao07/abPOA/releases/download/v1.2.5/abPOA-v1.2.5.tar.gz
tar -zxvf abPOA-v1.2.5.tar.gz
cd abPOA-v1.2.5; make
```
Or, you can use `git clone` command to download the source code.
This gives you the latest version of abPOA, which might be still under development.
Expand All @@ -94,8 +94,8 @@ cd abPOA; make
### <a name="binary"></a>Pre-built binary executable file for Linux/Unix
If you meet any compiling issue, please try the pre-built binary file:
```
wget https://github.com/yangao07/abPOA/releases/download/v1.2.4/abPOA-v1.2.4_x64-linux.tar.gz
tar -zxvf abPOA-v1.2.4_x64-linux.tar.gz
wget https://github.com/yangao07/abPOA/releases/download/v1.2.5/abPOA-v1.2.5_x64-linux.tar.gz
tar -zxvf abPOA-v1.2.5_x64-linux.tar.gz
```

## <a name="usage"></a>General usage
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
description = "pyabpoa: SIMD-based partial order alignment using adaptive band",
long_description = long_description,
long_description_content_type="text/markdown",
version = "1.2.4",
version = "1.2.5",
url = "https://github.com/yangao07/abPOA",
author = "Yan Gao",
author_email = "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion src/abpoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ char PROG[20] = "abpoa";
#define _bO BOLD UNDERLINE "O" NONE
#define _bA BOLD UNDERLINE "A" NONE
char DESCRIPTION[100] = _ba "daptive " _bb "anded " _bP "artial " _bO "rder " _bA "lignment";
char VERSION[20] = "1.2.4";
char VERSION[20] = "1.2.5";
char CONTACT[30] = "[email protected]";

const struct option abpoa_long_opt [] = {
Expand Down
33 changes: 17 additions & 16 deletions src/abpoa_align.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,23 @@ int abpoa_poa(abpoa_t *ab, abpoa_para_t *abpt, uint8_t **seqs, int *seq_lens, in
fprintf(stderr, "seq: # %d\n", i);
#endif
res.graph_cigar = 0; res.n_cigar = 0;
abpoa_align_sequence_to_graph(ab, abpt, qseq, qlen, &res);
if (abpt->amb_strand && (res.best_score < MIN_OF_TWO(qlen, ab->abg->node_n-2) * abpt->max_mat * .3333)) { // TODO .3333
rc_qseq = (uint8_t*)_err_malloc(sizeof(uint8_t) * qlen);
for (j = 0; j < qlen; ++j) {
if (qseq[qlen-i-1] < 4) rc_qseq[i] = 3 - qseq[qlen-i-1];
else rc_qseq[i] = 4;
}
abpoa_res_t rc_res; rc_res.n_cigar = 0, rc_res.graph_cigar = 0;
simd_abpoa_align_sequence_to_graph(ab, abpt, rc_qseq, qlen, &rc_res);
if (rc_res.best_score > res.best_score) {
abpoa_res_copy(&res, &rc_res);
qseq = rc_qseq;
abs->is_rc[read_id] = 1;
}
if (rc_res.n_cigar) free(rc_res.graph_cigar);
}
if (abpoa_align_sequence_to_graph(ab, abpt, qseq, qlen, &res) >= 0) {
if (abpt->amb_strand && (res.best_score < MIN_OF_TWO(qlen, ab->abg->node_n-2) * abpt->max_mat * .3333)) { // TODO .3333
rc_qseq = (uint8_t*)_err_malloc(sizeof(uint8_t) * qlen);
for (j = 0; j < qlen; ++j) {
if (qseq[qlen-j-1] < 4) rc_qseq[j] = 3 - qseq[qlen-j-1];
else rc_qseq[j] = 4;
}
abpoa_res_t rc_res; rc_res.n_cigar = 0, rc_res.graph_cigar = 0;
simd_abpoa_align_sequence_to_graph(ab, abpt, rc_qseq, qlen, &rc_res);
if (rc_res.best_score > res.best_score) {
abpoa_res_copy(&res, &rc_res);
qseq = rc_qseq;
abs->is_rc[read_id] = 1;
}
if (rc_res.n_cigar) free(rc_res.graph_cigar);
}
}
abpoa_add_graph_alignment(ab, abpt, qseq, qlen, NULL, res, read_id, tot_n_seq, 1);
if (abs->is_rc[read_id]) free(qseq);
if (res.n_cigar) free(res.graph_cigar);
Expand Down
4 changes: 2 additions & 2 deletions src/simd_abpoa_align.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ int abpoa_cg_dp(SIMDi *q, SIMDi *dp_h, SIMDi *dp_e1, SIMDi *dp_e2, SIMDi *dp_f1,
}
tot_dp_sn += (end_sn - beg_sn + 1);
#ifdef __DEBUG__
fprintf(stderr, "index: %d (node: %d): beg, end: %d, %d\n", index_i, node_id, beg, end);
// fprintf(stderr, "index: %d (node: %d): beg, end: %d, %d\n", index_i, node_id, beg, end);
#endif
/* loop query */
// new init start
Expand Down Expand Up @@ -1560,7 +1560,7 @@ int abpoa_cg_global_align_sequence_to_graph_core(abpoa_t *ab, int beg_node_id, i
// printf("dp_sn: %d\n", tot_dp_sn);
// printf("dp_sn: %d, node_n: %d, seq_n: %d\n", tot_dp_sn, graph->node_n, qlen);
abpoa_global_get_max(graph, beg_index, end_node_id, index_map, DP_H2E2F, 5*dp_sn, qlen, dp_end, &best_score, &best_i, &best_j);
simd_abpoa_print_cg_matrix(int32_t, beg_index, end_index);
// simd_abpoa_print_cg_matrix(int32_t, beg_index, end_index);
fprintf(stderr, "best_score: (%d, %d) -> %d\n", best_i, best_j, best_score);
res->best_score = best_score;
abpoa_cg_backtrack(DP_H2E2F, pre_index, pre_n, dp_beg, dp_end, dp_sn, abpt->m, mat, gap_ext1, gap_ext2, gap_oe1, gap_oe2, beg_index, best_i, best_j, qlen, graph, abpt, query, res);
Expand Down

0 comments on commit 0c8f941

Please sign in to comment.