Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
url = https://github.com/ComparativeGenomicsToolkit/sonLib
[submodule "taffy/submodules/abPOA"]
path = taffy/submodules/abPOA
url = https://github.com/yangao07/abPOA.git
url = https://github.com/ComparativeGenomicsToolkit/abPOA.git
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ sonLib:
ln -f ${sonLibDir}/*.a ${LIBDIR}
ln -f ${sonLibDir}/sonLib.a ${LIBDIR}/libsonLib.a

# abPOA names its library after the SIMD level it is built for (avx2=1 gives libabpoa_avx2.a, no
# level gives libabpoa.a), so link whichever one was built as libabpoa.a, as cactus does
abPOA:
mkdir -p ${LIBDIR} ${INCLDIR}
cd taffy/submodules/abPOA && ${MAKE}
ln -f taffy/submodules/abPOA/lib/*.a ${LIBDIR}
for lib in libabpoa_sse2.a libabpoa_sse41.a libabpoa_avx2.a libabpoa_avx512bw.a libabpoa.a; do \
if [ -f taffy/submodules/abPOA/lib/$${lib} ]; then ln -f taffy/submodules/abPOA/lib/$${lib} ${LIBDIR}/libabpoa.a; fi; \
done
ln -f taffy/submodules/abPOA/include/*.h ${INCLDIR}
rm -fr ${INCLDIR}/simde && cp -r taffy/submodules/abPOA/include/simde ${INCLDIR}

Expand Down
16 changes: 10 additions & 6 deletions taffy/impl/merge_adjacent_alignments.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ static abpoa_para_t* construct_abpoa_params(void) {
// progressive toggle
abpt->progressive_poa = 1;

// keep the last gap at the end of the alignment, as abPOA always did before v1.5.4
abpt->put_gap_at_end = 1;

// generate the substitution matrix
abpt->use_score_matrix = 0;
abpoa_post_set_para(abpt);
Expand Down Expand Up @@ -310,9 +313,9 @@ static int len_rev_cmp(const void* i1, const void* i2, void* length_list) {
* abPOA is set up once and reused for every gap alignment. Building the parameters is expensive out
* of proportion to the work: abpoa_post_set_para refills a 65536 entry global lookup table each
* time, and doing that once per merge dominated the run time of taffy norm on alignments made of
* many small blocks. The parameters are constant, and abpoa_msa resets the handle as its first act,
* so one instance serves every call. This is not thread safe, and neither is abPOA's use of the
* global tables that make it worth doing.
* many small blocks. The parameters are constant, and the handle is reset before every call (see
* align_interstitial_gaps_abpoa), so one instance serves every call. This is not thread safe, and
* neither is abPOA's use of the global tables that make it worth doing.
*/
static abpoa_t *shared_abpoa = NULL;
static abpoa_para_t *shared_abpoa_params = NULL;
Expand Down Expand Up @@ -396,10 +399,11 @@ int64_t align_interstitial_gaps_abpoa(Alignment *alignment) {
}

// run abpoa: todo try sorting on length
// abpoa_msa resets the shared handle as its first act, but it returns before doing so when
// handed no sequences, which would leave the previous call's alignment for us to read back. The
// seq_no == 0 return above means that cannot happen; this is here so it stays that way.
// abpoa_msa only starts afresh when the handle holds no sequences: since abPOA v1.5.6 it otherwise
// adds the new ones to the previous call's graph (incremental MSA). So reset the shared handle
// here, to the size abpoa_msa itself resets to.
assert(seq_no > 0);
abpoa_reset(ab, abpoa_params, 1024);
abpoa_msa(ab, abpoa_params, seq_no, NULL, seq_lens, bseqs, NULL, NULL);

// copy the results from the abpoa matrix back into the left_gap_sequences
Expand Down
2 changes: 1 addition & 1 deletion taffy/submodules/abPOA
Submodule abPOA updated 64 files
+15 −2 .github/workflows/linux-CI.yml
+14 −1 .github/workflows/macos-CI.yml
+32 −30 .github/workflows/pypi.yml
+3 −0 .gitignore
+186 −29 CMakeLists.txt
+3 −1 MANIFEST.in
+113 −37 Makefile
+86 −52 README.md
+1 −1 abpoa.pc.in
+2 −1 example.c
+21 −11 include/abpoa.h
+35 −212 include/simd_instruction.h
+1 −1 include/simde
+142 −0 incre_example.c
+16 −0 pyproject.toml
+33 −5 python/README.md
+5 −4 python/cabpoa.pxd
+65 −41 python/example.py
+178 −33 python/pyabpoa.pyx
+13 −20 setup.py
+48 −18 src/abpoa.c
+21 −11 src/abpoa.h
+60 −23 src/abpoa_align.c
+625 −786 src/abpoa_align_simd.c
+1 −2 src/abpoa_align_simd.h
+84 −0 src/abpoa_dispatch_simd.c
+156 −23 src/abpoa_graph.c
+2 −0 src/abpoa_graph.h
+690 −396 src/abpoa_output.c
+34 −0 src/abpoa_output.h
+2 −1 src/abpoa_plot.c
+42 −31 src/abpoa_seed.c
+14 −1 src/abpoa_seq.c
+1 −0 src/abpoa_seq.h
+630 −0 src/abpoa_simd.c
+36 −0 src/abpoa_simd.h
+15 −0 src/abpoa_simd_internal.h
+9 −0 src/kalloc.h
+9 −0 src/kdq.h
+9 −0 src/kstring.h
+0 −20 src/simd_check.c
+35 −212 src/simd_instruction.h
+10 −0 src/utils.c
+8 −0 src/utils.h
+12 −6 sub_example.c
+252 −0 test_data/3alleles.fa
+60 −0 test_data/heter.fq
+2 −0 tests/ref_consensus.txt
+4 −0 tests/ref_heter.txt
+2 −0 tests/ref_msa.txt
+85 −0 tests/run_all.sh
+34 −0 tests/test_aligned_alloc.c
+95 −0 tests/test_cmake_dispatch.sh
+64 −0 tests/test_cmake_lib_only.sh
+49 −0 tests/test_cmake_subdir.sh
+21 −0 tests/test_cmake_subdir/CMakeLists.txt
+15 −0 tests/test_cmake_subdir/test_parent.c
+46 −0 tests/test_dual_link.c
+36 −0 tests/test_dual_link.sh
+43 −0 tests/test_no_simd_include.sh
+22 −0 tests/test_opaque_header.c
+64 −0 tests/test_portable_alloc.sh
+170 −0 tests/test_score_range.sh
+56 −0 tests/test_symbol_namespacing.sh