From e6e8db340ad9b6f401e91769d6db719982a48ce8 Mon Sep 17 00:00:00 2001 From: "Jason W. Bacon" Date: Sun, 26 May 2019 03:36:49 +0000 Subject: biology/bolt-lmm: Mixed model association testing and variance component analysis The BOLT-LMM software package currently consists of two main algorithms, the BOLT-LMM algorithm for mixed model association testing, and the BOLT-REML algorithm for variance components analysis (i.e., partitioning of SNP-heritability and estimation of genetic correlations). --- biology/Makefile | 1 + biology/bolt-lmm/Makefile | 44 +++++++ biology/bolt-lmm/distinfo | 3 + .../bolt-lmm/files/patch-example_run__example.sh | 10 ++ .../files/patch-example_run__example__reml2.sh | 10 ++ biology/bolt-lmm/files/patch-src_Makefile | 138 +++++++++++++++++++++ biology/bolt-lmm/files/patch-src_StringUtils.cpp | 10 ++ biology/bolt-lmm/pkg-descr | 6 + biology/bolt-lmm/pkg-plist | 6 + 9 files changed, 228 insertions(+) create mode 100644 biology/bolt-lmm/Makefile create mode 100644 biology/bolt-lmm/distinfo create mode 100644 biology/bolt-lmm/files/patch-example_run__example.sh create mode 100644 biology/bolt-lmm/files/patch-example_run__example__reml2.sh create mode 100644 biology/bolt-lmm/files/patch-src_Makefile create mode 100644 biology/bolt-lmm/files/patch-src_StringUtils.cpp create mode 100644 biology/bolt-lmm/pkg-descr create mode 100644 biology/bolt-lmm/pkg-plist (limited to 'biology') diff --git a/biology/Makefile b/biology/Makefile index 97fc09f97faf..70f82e9c2742 100644 --- a/biology/Makefile +++ b/biology/Makefile @@ -11,6 +11,7 @@ SUBDIR += bcftools SUBDIR += bedtools SUBDIR += biococoa + SUBDIR += bolt-lmm SUBDIR += bowtie SUBDIR += bowtie2 SUBDIR += bwa diff --git a/biology/bolt-lmm/Makefile b/biology/bolt-lmm/Makefile new file mode 100644 index 000000000000..f1d8abc328fd --- /dev/null +++ b/biology/bolt-lmm/Makefile @@ -0,0 +1,44 @@ +# $FreeBSD$ + +PORTNAME= bolt-lmm +DISTVERSION= 2.3.2 +CATEGORIES= biology +MASTER_SITES= https://data.broadinstitute.org/alkesgroup/BOLT-LMM/downloads/ +DISTNAME= BOLT-LMM_v${PORTVERSION} + +MAINTAINER= jwb@FreeBSD.org +COMMENT= Mixed model association testing and variance component analysis + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/license.txt + +LIB_DEPENDS= libnlopt.so:math/nlopt \ + libopenblas.so:math/openblas \ + libboost_program_options.so:devel/boost-libs + +# gcc-c++11-lib needed to link with boost. Also requires compiler:openmp, but +# both merely add a GCC requirement. +USES= compiler:gcc-c++11-lib gmake + +BUILD_WRKSRC= ${WRKDIR}/${DISTNAME}/src +INSTALL_WRKSRC= ${WRKDIR}/${DISTNAME}/src +CXXFLAGS_i386= -DUSE_SSE -msse -msse2 +CXXFLAGS_amd64= -DUSE_SSE + +PORTEXAMPLES= * + +OPTIONS_DEFINE= EXAMPLES + +pre-configure: + @${RM} ${WRKSRC}/example/*.orig ${WRKSRC}/bolt + @${REINPLACE_CMD} -e 's|tables/|${DATADIR}/tables/|g' \ + ${BUILD_WRKSRC}/BoltParams.cpp + @${REINPLACE_CMD} -e 's|../tables/|${DATADIR}/tables/|g' \ + ${WRKSRC}/example/run_example.sh + +do-install: + ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/bolt ${STAGEDIR}${PREFIX}/bin + (cd ${WRKSRC}/example && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) + (cd ${WRKSRC} && ${COPYTREE_SHARE} tables ${STAGEDIR}${DATADIR}) + +.include diff --git a/biology/bolt-lmm/distinfo b/biology/bolt-lmm/distinfo new file mode 100644 index 000000000000..18551a76e51a --- /dev/null +++ b/biology/bolt-lmm/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1558717810 +SHA256 (BOLT-LMM_v2.3.2.tar.gz) = ee505a04138f6c80bfefad4df4b81a2d07e72114dd8329d187c97543f5a0521f +SIZE (BOLT-LMM_v2.3.2.tar.gz) = 335057533 diff --git a/biology/bolt-lmm/files/patch-example_run__example.sh b/biology/bolt-lmm/files/patch-example_run__example.sh new file mode 100644 index 000000000000..235a77400e8d --- /dev/null +++ b/biology/bolt-lmm/files/patch-example_run__example.sh @@ -0,0 +1,10 @@ +--- example/run_example.sh.orig 2017-11-11 16:45:05 UTC ++++ example/run_example.sh +@@ -1,4 +1,6 @@ +-../bolt \ ++#!/bin/sh -e ++ ++bolt \ + --bfile=EUR_subset \ + --remove=EUR_subset.remove \ + --exclude=EUR_subset.exclude \ diff --git a/biology/bolt-lmm/files/patch-example_run__example__reml2.sh b/biology/bolt-lmm/files/patch-example_run__example__reml2.sh new file mode 100644 index 000000000000..ad8b5d5334a0 --- /dev/null +++ b/biology/bolt-lmm/files/patch-example_run__example__reml2.sh @@ -0,0 +1,10 @@ +--- example/run_example_reml2.sh.orig 2018-03-10 19:39:24 UTC ++++ example/run_example_reml2.sh +@@ -1,4 +1,6 @@ +-../bolt \ ++#!/bin/sh -e ++ ++bolt \ + --bfile=EUR_subset \ + --phenoFile=EUR_subset.pheno2.covars \ + --exclude=EUR_subset.exclude2 \ diff --git a/biology/bolt-lmm/files/patch-src_Makefile b/biology/bolt-lmm/files/patch-src_Makefile new file mode 100644 index 000000000000..7cd1f25f5420 --- /dev/null +++ b/biology/bolt-lmm/files/patch-src_Makefile @@ -0,0 +1,138 @@ +--- src/Makefile.orig 2018-03-13 02:44:52 UTC ++++ src/Makefile +@@ -1,29 +1,28 @@ + ### modify these paths to local Boost and NLopt install directories +-BOOST_INSTALL_DIR = /home/pl88/boost_1_58_0/install +-NLOPT_INSTALL_DIR = /n/groups/price/poru/HSPH_SVN/src/BOLT-LMM/nlopt-2.4.2 ++BOOST_INSTALL_DIR ?= ${LOCALBASE} ++# Redundant on FreeBSD NLOPT_INSTALL_DIR = /n/groups/price/poru/HSPH_SVN/src/BOLT-LMM/nlopt-2.4.2 + + INTELROOT = /n/groups/price/poru/external_software/intel_mkl_2018 + MKLROOT = ${INTELROOT}/mkl +-ZLIB_STATIC_DIR = /n/groups/price/poru/external_software/zlib/zlib-1.2.11 # probably unnecessary on most systems +-LIBSTDCXX_STATIC_DIR = /n/groups/price/poru/external_software/libstdc++/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ +-GLIBC_STATIC_DIR = /home/pl88/glibc-static/usr/lib64 ++ZLIB_STATIC_DIR ?= /usr/lib ++LIBSTDCXX_STATIC_DIR ?= /usr/lib ++GLIBC_STATIC_DIR ?= /usr/lib + + ifeq ($(strip ${linking}),) + linking = dynamic + endif + +-# CC = g++ +-CC = icpc ++# CXX = g++ ++CXX ?= icpc + + ifeq (${debug},true) +- CFLAGS += -g ++ CXXFLAGS += -g + else +- CFLAGS += -O2 ++ CXXFLAGS += -O2 + endif + +-CFLAGS += -msse -msse2 +-CFLAGS += -DUSE_SSE -DMEASURE_DGEMM -DVERBOSE +-CFLAGS += -Wall ++CXXFLAGS += -DMEASURE_DGEMM -DVERBOSE ++CXXFLAGS += -Wall + + + # add Boost include and lib paths +@@ -38,9 +37,9 @@ endif + # add NLopt include and lib paths + ifneq ($(strip ${NLOPT_INSTALL_DIR}),) + CPATHS += -I${NLOPT_INSTALL_DIR}/api +- LPATHS += -L${NLOPT_INSTALL_DIR}/.libs ++ LPATHS += -L${NLOPT_INSTALL_DIR}/libs + ifeq (${linking},dynamic) +- LPATHS += -Wl,-rpath,${NLOPT_INSTALL_DIR}/.libs ++ LPATHS += -Wl,-rpath,${NLOPT_INSTALL_DIR}/libs + endif + endif + +@@ -52,7 +51,7 @@ ifneq ($(strip ${ZLIB_STATIC_DIR}),) + endif + + # add MKL paths (if not compiling with g++, i.e., compiling with icpc) +-ifneq (${CC},g++) ++ifneq (${CXX},${CXX}) + CPATHS += -I${MKLROOT}/include + ifeq (${linking},dynamic) + LPATHS += -L${MKLROOT}/lib/intel64 -Wl,-rpath,${MKLROOT}/lib/intel64 # for libmkl* +@@ -61,28 +60,28 @@ ifneq (${CC},g++) + endif + + # add flags for static linking; build LAPACK/MKL component of link line +-ifeq (${CC},g++) +- CFLAGS += -fopenmp +- LFLAGS += -fopenmp +- LLAPACK = -llapack -lgfortran ++ifeq (${CXX},${CXX}) ++ CXXFLAGS += -fopenmp ++ LDFLAGS += -fopenmp ++ LLAPACK = -lopenblas -lgfortran + ifeq (${linking},static) +- LFLAGS += -static ++ LDFLAGS += -static + LPATHS += -L${GLIBC_STATIC_DIR} -L${ZLIB_STATIC_DIR} + else ifeq (${linking},static-except-glibc) +- LFLAGS += -static-libgcc -static-libstdc++ ++ LDFLAGS += -static-libgcc -static-libstdc++ + LPATHS += -L${ZLIB_STATIC_DIR} + endif + else +- CFLAGS += -DUSE_MKL #-DUSE_MKL_MALLOC +- CFLAGS += -qopenmp +- LFLAGS += -qopenmp +- CFLAGS += -Wunused-variable -Wpointer-arith -Wuninitialized -Wreturn-type -Wcheck -Wshadow ++ CXXFLAGS += -DUSE_MKL #-DUSE_MKL_MALLOC ++ CXXFLAGS += -qopenmp ++ LDFLAGS += -qopenmp ++ CXXFLAGS += -Wunused-variable -Wpointer-arith -Wuninitialized -Wreturn-type -Wcheck -Wshadow + ifeq (${linking},static) +- LFLAGS += -static ++ LDFLAGS += -static + LPATHS += -L${GLIBC_STATIC_DIR} -L${ZLIB_STATIC_DIR} + LLAPACK = -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a -Wl,--end-group + else ifeq (${linking},static-except-glibc) +- LFLAGS += -static-intel -static-libstdc++ -static-libgcc ++ LDFLAGS += -static-intel -static-libstdc++ -static-libgcc + LPATHS += -L${ZLIB_STATIC_DIR} + LLAPACK = -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a -Wl,--end-group + else +@@ -95,7 +94,8 @@ else + endif + + # build link line (minus flags) +-LLIBS = -lboost_program_options -lboost_iostreams -lz -lnlopt ++LLIBS = -lnlopt -lboost_program_options -lboost_iostreams -lz ++# LLIBS = /usr/local/lib/libboost_program_options.a -lnlopt -lboost_iostreams -lz + ifeq (${linking},static-except-glibc) + L = -L${LIBSTDCXX_STATIC_DIR} ${LPATHS} -Wl,--wrap=memcpy -Wl,-Bstatic ${LLIBS} ${LLAPACK} -Wl,-Bdynamic -lpthread -lm + else +@@ -105,16 +105,18 @@ endif + + + T = bolt +-O = Bolt.o BoltParams.o BoltParEstCV.o BoltReml.o CovariateBasis.o DataMatrix.o FileUtils.o Jackknife.o LDscoreCalibration.o MapInterpolater.o MatrixUtils.o MemoryUtils.o NonlinearOptMulti.o NumericUtils.o PhenoBuilder.o RestrictSnpSet.o SnpData.o SnpInfo.o SpectrumTools.o StatsUtils.o StringUtils.o Timer.o memcpy.o ++O = Bolt.o BoltParams.o BoltParEstCV.o BoltReml.o CovariateBasis.o DataMatrix.o FileUtils.o Jackknife.o LDscoreCalibration.o MapInterpolater.o MatrixUtils.o MemoryUtils.o NonlinearOptMulti.o NumericUtils.o PhenoBuilder.o RestrictSnpSet.o SnpData.o SnpInfo.o SpectrumTools.o StatsUtils.o StringUtils.o Timer.o + OMAIN = BoltMain.o $O + +-.PHONY: clean ++.PHONY: clean all + ++all: $T ++ + %.o: %.cpp +- ${CC} ${CFLAGS} ${CPATHS} -o $@ -c $< ++ ${CXX} ${CXXFLAGS} ${CPATHS} -o $@ -c $< + + $T: ${OMAIN} +- ${CC} ${LFLAGS} -o $T ${OMAIN} $L ++ ${CXX} ${LDFLAGS} -o $T ${OMAIN} $L + + clean: + rm -f *.o diff --git a/biology/bolt-lmm/files/patch-src_StringUtils.cpp b/biology/bolt-lmm/files/patch-src_StringUtils.cpp new file mode 100644 index 000000000000..e031239f83a8 --- /dev/null +++ b/biology/bolt-lmm/files/patch-src_StringUtils.cpp @@ -0,0 +1,10 @@ +--- src/StringUtils.cpp.orig 2018-03-13 02:38:23 UTC ++++ src/StringUtils.cpp +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include // uint + + #include "StringUtils.hpp" + diff --git a/biology/bolt-lmm/pkg-descr b/biology/bolt-lmm/pkg-descr new file mode 100644 index 000000000000..883572a29a08 --- /dev/null +++ b/biology/bolt-lmm/pkg-descr @@ -0,0 +1,6 @@ +The BOLT-LMM software package currently consists of two main algorithms, the +BOLT-LMM algorithm for mixed model association testing, and the BOLT-REML +algorithm for variance components analysis (i.e., partitioning of +SNP-heritability and estimation of genetic correlations). + +WWW: https://data.broadinstitute.org/alkesgroup/BOLT-LMM/ diff --git a/biology/bolt-lmm/pkg-plist b/biology/bolt-lmm/pkg-plist new file mode 100644 index 000000000000..775d8677706f --- /dev/null +++ b/biology/bolt-lmm/pkg-plist @@ -0,0 +1,6 @@ +bin/bolt +%%DATADIR%%/tables/LDSCORE.1000G_EUR.tab.gz +%%DATADIR%%/tables/genetic_map_hg17_withX.txt.gz +%%DATADIR%%/tables/genetic_map_hg18_withX.txt.gz +%%DATADIR%%/tables/genetic_map_hg19_withX.txt.gz +%%DATADIR%%/tables/genetic_map_hg38_withX.txt.gz -- cgit v1.2.3