forked from smarco/WFA2-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patching WFA2-lib to prevent C macros from bleeding into the environm…
…ent. See - WFA2-lib smarco#35 and - vcflib vcflib/vcflib#359 External tools will no longer include files wavefront_align.h or wavefront_aligner.h. That includes the bindings that come with WFA2-lib itself - they included wavefront_aligner.h wrapped as external "C". These no longer include files, such as commons.h, that define macros and variables that are mostly internal to WFA. To bind external tools I have introduced a new include file 'wfa.h' that contains the function definitions and minimal data structures. This file is now included by wavefront_aligner.h so WFA2-lib sees the same definitions. Also I included wfa.hpp that uses a C calling convention for C++, so there is no need to wrap the include file in extern "C". To make it work I had to remove almost all includes to utils/commons.h from the headers. If this causes compile errors in other tools, have them include the file at the .c level (not .h). I also merged wavefront_align.h into wfa.h, so as not to have to include wavefront_alignment.h fully every time. To validate that it works I called some macros by vcflib - after this patch they no longer are seen. Finally I included a guix.scm file that allows us to create an isolated build environment using different versions of C compilers etc. See the header of guix.scm for instructions. Notes: it is better to use newer `#pragma once' for header files that the ifndef construct
- Loading branch information
Showing
79 changed files
with
412 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
;; Set up build environment using GNU Guix packages | ||
;; | ||
;; CC0 license, Pjotr Prins (c) 2022 | ||
;; | ||
;; To use this file to build HEAD: | ||
;; | ||
;; guix build -f guix.scm | ||
;; | ||
;; To get a development container (emacs shell will work) | ||
;; | ||
;; guix shell -C -D -f guix.scm | ||
;; | ||
;; For the tests you need /bin/bash. In a container create it with | ||
;; | ||
;; mkdir -p /bin ; ln -s $GUIX_ENVIRONMENT/bin/bash /bin/bash | ||
;; | ||
;; and run the tests with | ||
;; | ||
;; env CC=gcc make | ||
;; ./tests/wfa.utest.sh | ||
|
||
(use-modules | ||
((guix licenses) #:prefix license:) | ||
(guix gexp) | ||
(guix packages) | ||
(guix git-download) | ||
(guix build-system cmake) | ||
(gnu packages algebra) | ||
(gnu packages autotools) | ||
(gnu packages base) | ||
(gnu packages bash) | ||
(gnu packages compression) | ||
(gnu packages build-tools) | ||
(gnu packages check) | ||
(gnu packages curl) | ||
(gnu packages gcc) | ||
(gnu packages gdb) | ||
(gnu packages llvm) | ||
(gnu packages parallel) | ||
(gnu packages pkg-config) | ||
(srfi srfi-1) | ||
(ice-9 popen) | ||
(ice-9 rdelim)) | ||
|
||
(define %source-dir (dirname (current-filename))) | ||
|
||
(define %git-commit | ||
(read-string (open-pipe "git show HEAD | head -1 | cut -d ' ' -f 2" OPEN_READ))) | ||
|
||
(define-public wfa2-lib-git | ||
(package | ||
(name "wfa2-lib-git") | ||
(version (git-version "1.3" "HEAD" %git-commit)) | ||
(source (local-file %source-dir #:recursive? #f)) | ||
(build-system cmake-build-system) | ||
(inputs | ||
`(("bash" ,bash) | ||
("gdb" ,gdb))) | ||
(native-inputs | ||
`(("pkg-config" ,pkg-config))) | ||
(home-page "https://github.com/smarco/WFA2-lib/") | ||
(synopsis "Library for wavefront aligner") | ||
(description "The wavefront alignment (WFA) algorithm is an **exact** gap-affine algorithm that takes advantage of homologous regions between the sequences to accelerate the alignment process. Unlike to traditional dynamic programming algorithms that run in quadratic time, the WFA runs in time `O(ns+s^2)`, proportional to the sequence length `n` and the alignment score `s`, using `O(s^2)` memory (or `O(s)` using the ultralow/BiWFA mode).") | ||
(license license:expat))) ;; MIT license | ||
|
||
wfa2-lib-git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,6 @@ | |
#ifndef PROFILER_COUNTER_H_ | ||
#define PROFILER_COUNTER_H_ | ||
|
||
#include "utils/commons.h" | ||
|
||
/* | ||
* Counters | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,6 @@ | |
#ifndef SWG_H_ | ||
#define SWG_H_ | ||
|
||
#include "utils/commons.h" | ||
#include "gap_affine/affine_matrix.h" | ||
|
||
/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,6 @@ | |
#ifndef DNA_TEXT_H_ | ||
#define DNA_TEXT_H_ | ||
|
||
#include "utils/commons.h" | ||
|
||
/* | ||
* Range of DNA Nucleotides | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
* AUTHOR(S): Santiago Marco-Sola <[email protected]> | ||
*/ | ||
|
||
#include "utils/commons.h" | ||
#include "heatmap.h" | ||
|
||
/* | ||
|
@@ -168,6 +169,3 @@ void heatmap_print( | |
fprintf(stream,"\n"); | ||
} | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,6 @@ | |
#ifndef HEATMAP_H_ | ||
#define HEATMAP_H_ | ||
|
||
#include "utils/commons.h" | ||
|
||
/* | ||
* Heatmap | ||
*/ | ||
|
Oops, something went wrong.