Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove osx skip #52093

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
56 changes: 56 additions & 0 deletions recipes/clair3/0001-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
diff --git a/Makefile b/Makefile
index 75e68b1..5de3a71 100644
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,19 @@
OS := $(shell uname)
ARCH := $(shell arch)

-PYTHON ?= python3
+PYTHON ?= $(python)

-all : libhts.a longphase libclair3.so
+all : libhts.a libclair3.so longphase
clean : clean_htslib clean_longphase clean_libclair3

SAMVER = 1.15.1
LPVER = 1.7.3
-GCC ?= gcc
-GXX ?= g++
-PREFIX ?= ${CONDA_PREFIX}
-LDFLAGS = -L ${PREFIX}/lib
-CFLAGS = -fpic -std=c99 -O3 -I ${PREFIX}/include -L ${PREFIX}/lib
-CPPFLAGS = -std=c++11 -Wall -O3 -I ${PREFIX}/include -L ${PREFIX}/lib -Wl,-rpath=${PREFIX}/lib
+GCC ?= $(CC)
+GXX ?= $(CXX)
+PREFIX ?= $(PREFIX)
+LDFLAGS = -L${PREFIX}/lib
+CFLAGS = -fPIC -std=c11 -O3 -L${PREFIX}/lib
+CPPFLAGS = -std=c++14 -Wall -O3 -I${PREFIX}/include -Wl,-rpath=${PREFIX}/lib


samtools-$(SAMVER)/Makefile:
@@ -24,9 +24,11 @@ samtools-$(SAMVER)/Makefile:
libhts.a: samtools-$(SAMVER)/Makefile
# this is required only to add in -fpic so we can build python module
@echo "\x1b[1;33mMaking $(@F)\x1b[0m"
- cd samtools-${SAMVER}/htslib-${SAMVER}; CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ./configure; make CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+ cd samtools-${SAMVER}/htslib-${SAMVER}; autoreconf -if; CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ./configure; make CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
cp samtools-${SAMVER}/htslib-${SAMVER}/$@ $@

+libclair3.so: samtools-${SAMVER}/htslib-${SAMVER} libhts.a
+ ${PYTHON} build.py

longphase:
curl -L -o longphase-${LPVER}.tar.xz https://github.com/twolinin/longphase/releases/download/v${LPVER}/longphase_linux-x64.tar.xz
@@ -34,10 +36,6 @@ longphase:
mv longphase_linux-x64 $@
rm longphase-${LPVER}.tar.xz

-
-libclair3.so: samtools-${SAMVER}/htslib-${SAMVER} libhts.a
- ${PYTHON} build.py
-
src/%.o: src/%.c
$(GCC) -g -Isrc -Isamtools-${SAMVER}/htslib-${SAMVER} -c -pthread -fstack-protector-strong -D_FORTIFY_SOURCE=2 \
$(CFLAGS) $^ -o $@
13 changes: 13 additions & 0 deletions recipes/clair3/0002-fpic.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index 5de3a71..806ee28 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ GCC ?= $(CC)
GXX ?= $(CXX)
PREFIX ?= $(PREFIX)
LDFLAGS = -L${PREFIX}/lib
-CFLAGS = -fPIC -std=c11 -O3 -L${PREFIX}/lib
+CFLAGS = -std=c11 -O3 -L${PREFIX}/lib
CPPFLAGS = -std=c++14 -Wall -O3 -I${PREFIX}/include -Wl,-rpath=${PREFIX}/lib


17 changes: 12 additions & 5 deletions recipes/clair3/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/bash

export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export INCLUDE_PATH="${PREFIX}/include"
export LIBRARY_PATH="${PREFIX}/lib"
export CPATH="${PREFIX}/include"

mkdir -pv $PREFIX/bin
cp -rv clair3 models preprocess postprocess scripts shared $PREFIX/bin
cp clair3.py $PREFIX/bin/
cp run_clair3.sh $PREFIX/bin/
make CC=${GCC} CXX=${GXX} PREFIX=${PREFIX}
cp longphase libclair3* $PREFIX/bin
cp -rf clair3 models preprocess postprocess scripts shared $PREFIX/bin
install -v -m 0755 clair3.py $PREFIX/bin
install -v -m 0755 run_clair3.sh $PREFIX/bin
make all GCC="${CC}" GXX="${CXX}" PREFIX="${PREFIX}" python="${PYTHON}"

install -v -m 0755 longphase $PREFIX/bin
cp -rf libclair3* $PREFIX/bin
27 changes: 20 additions & 7 deletions recipes/clair3/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,29 @@ package:
source:
url: http://www.bio8.cs.hku.hk/clair3/bioconda/Clair3_v{{ version }}.zip
sha256: b2de8180d3825f9e1ed4ee1710ce0988dd85eba79ab8bdaf2ad8dae7ac70e228
patches:
- 0001-Makefile.patch
- 0002-fpic.patch # [osx]

build:
number: 0
skip: True # [osx]
number: 1
run_exports:
- {{ pin_subpackage(name, max_pin="x") }}

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- autoconf
- automake
- make
- libtool
host:
- cffi
- bzip2
- xz
- zlib
- python 3.9.0
- automake
- make
- libcurl 7.87.0
- openssl 1.1.1
run:
Expand All @@ -42,19 +46,28 @@ requirements:
- zstd
- openssl 1.1.1
- cffi 1.14.4

test:
imports:
- tensorflow
commands:
- longphase --version
- which clair3.py
- run_clair3.sh -v
extra:
container:
extended-base: true

about:
home: 'https://github.com/HKU-BAL/Clair3'
license: BSD-3-Clause
license_family: BSD
license_file: LICENSE.md
summary: "Clair3 is a small variant caller for long-reads. Compare to PEPPER (r0.4), Clair3 (v0.1) shows a better SNP F1-score with ≤30-fold of ONT data (precisionFDA Truth Challenge V2), and a better Indel F1-score, while runs generally four times faster. Clair3 makes the best of both worlds of using pileup or full-alignment as input for deep-learning based long-read small variant calling. Clair3 is simple and modular for easy deployment and integration."
dev_url: 'https://github.com/HKU-BAL/Clair3'
doc_url: "https://github.com/HKU-BAL/Clair3/blob/v{{ version }}/README.md"

extra:
container:
extended-base: True
identifiers:
- doi:10.1038/s43588-022-00387-x
- biotools:clair3
- usegalaxy-eu:clair3
Loading