aboutsummaryrefslogtreecommitdiff
path: root/biology
diff options
context:
space:
mode:
authorJason W. Bacon <jwb@FreeBSD.org>2020-04-15 15:22:04 +0000
committerJason W. Bacon <jwb@FreeBSD.org>2020-04-15 15:22:04 +0000
commit64673b1e81f9071f6bb2c7bff7808313b795abed (patch)
tree6adf24b58a40ae56977e0dcafed37c33dafa3ae3 /biology
parent81a43c2ff38a473bef4df4ab71d8e698492a0a52 (diff)
downloadports-64673b1e81f9071f6bb2c7bff7808313b795abed.tar.gz
ports-64673b1e81f9071f6bb2c7bff7808313b795abed.zip
Notes
Diffstat (limited to 'biology')
-rw-r--r--biology/Makefile1
-rw-r--r--biology/gcta/Makefile35
-rw-r--r--biology/gcta/distinfo3
-rw-r--r--biology/gcta/files/patch-Makefile59
-rw-r--r--biology/gcta/files/patch-eigen__func.h15
-rw-r--r--biology/gcta/files/patch-gcta.h29
-rw-r--r--biology/gcta/files/patch-ld.cpp13
-rw-r--r--biology/gcta/files/patch-mkl.cpp56
-rw-r--r--biology/gcta/pkg-descr7
9 files changed, 218 insertions, 0 deletions
diff --git a/biology/Makefile b/biology/Makefile
index 068bec4e6b08..6044da1ad279 100644
--- a/biology/Makefile
+++ b/biology/Makefile
@@ -43,6 +43,7 @@
SUBDIR += freebayes
SUBDIR += garlic
SUBDIR += gatk
+ SUBDIR += gcta
SUBDIR += gemma
SUBDIR += gff2ps
SUBDIR += gmap
diff --git a/biology/gcta/Makefile b/biology/gcta/Makefile
new file mode 100644
index 000000000000..7b31d0e93298
--- /dev/null
+++ b/biology/gcta/Makefile
@@ -0,0 +1,35 @@
+# $FreeBSD$
+
+PORTNAME= gcta
+DISTVERSION= 1.26.0
+CATEGORIES= biology
+MASTER_SITES= https://cnsgenomics.com/software/gcta/pre_gcta/
+DISTNAME= ${PORTNAME}_${PORTVERSION}_src
+
+MAINTAINER= jwb@FreeBSD.org
+COMMENT= Genome-wide Complex Trait Analysis
+
+LICENSE= GPLv3
+LICENSE_FILE= ${WRKSRC}/GNU_General_Public_License_v3.txt
+
+BUILD_DEPENDS= eigen>=3:math/eigen3
+LIB_DEPENDS+= libopenblas.so:math/openblas
+
+USES= compiler:openmp dos2unix gmake localbase zip
+
+CXXFLAGS+= -I${LOCALBASE}/include/eigen3 -fopenmp
+LDFLAGS+= -lopenblas
+
+INSTALL_TARGET= install-strip
+PLIST_FILES= bin/gcta
+
+.include <bsd.port.pre.mk>
+
+.if ${CHOSEN_COMPILER_TYPE} == gcc && ${COMPILER_VERSION} <= 42
+USE_GCC= yes
+.endif
+
+do-extract:
+ ${UNZIP_NATIVE_CMD} -d ${WRKSRC} ${DISTDIR}/${DISTFILES}
+
+.include <bsd.port.post.mk>
diff --git a/biology/gcta/distinfo b/biology/gcta/distinfo
new file mode 100644
index 000000000000..9faabb4559b8
--- /dev/null
+++ b/biology/gcta/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1489125670
+SHA256 (gcta_1.26.0_src.zip) = 554c48f421c93cbaf64b1c300ca507d8e7a56086b5c7d857227fbd4048f42acf
+SIZE (gcta_1.26.0_src.zip) = 198045
diff --git a/biology/gcta/files/patch-Makefile b/biology/gcta/files/patch-Makefile
new file mode 100644
index 000000000000..b4844e0f9cee
--- /dev/null
+++ b/biology/gcta/files/patch-Makefile
@@ -0,0 +1,59 @@
+--- Makefile.orig 2020-04-15 01:43:44 UTC
++++ Makefile
+@@ -6,21 +6,27 @@
+ # ---------------------------------------------------------------------
+
+ # Directory of the target
+-OUTPUT = gcta64
++OUTPUT = gcta
+
+ # Compiler
+-CXX = g++
++CXX ?= g++
+
+ # EIGEN library
+-EIGEN_PATH = ../../../Lib/eigen
++EIGEN_PATH ?= ../../../Lib/eigen
+
+ # Intel MKL library
+-MKL_PATH = /opt/intel/mkl
++MKL_PATH ?= /opt/intel/mkl
+
+ # Compiler flags
+-CXXFLAGS = -w -O3 -m64 -static -fopenmp -I $(EIGEN_PATH) -DEIGEN_NO_DEBUG -I $(MKL_PATH)/include
+-LIB += -static -lz -Wl,--start-group $(MKL_PATH)/lib/intel64/libmkl_intel_lp64.a $(MKL_PATH)/lib/intel64/libmkl_gnu_thread.a $(MKL_PATH)/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl
++CXXFLAGS ?= -w -O3 -m64 -static -fopenmp -I $(EIGEN_PATH) -DEIGEN_NO_DEBUG -I $(MKL_PATH)/include
++LDFLAGS += -lz -Wl,--start-group -lpthread -lm -ldl
+
++MKDIR ?= mkdir
++DESTDIR ?= .
++PREFIX ?= /usr/local
++INSTALL ?= install
++STRIP ?= strip
++
+ HDR += CommFunc.h \
+ cdflib.h \
+ dcdflib.h \
+@@ -58,7 +64,7 @@ OBJ = $(SRC:.cpp=.o)
+ all : $(OUTPUT)
+
+ $(OUTPUT) :
+- $(CXX) $(CXXFLAGS) -o $(OUTPUT) $(OBJ) $(LIB)
++ $(CXX) $(CXXFLAGS) -o $(OUTPUT) $(OBJ) $(LDFLAGS)
+
+ $(OBJ) : $(HDR)
+
+@@ -69,6 +75,13 @@ $(OBJ) : $(HDR)
+ $(OUTPUT) : $(OBJ)
+
+ FORCE:
++
++install:
++ ${MKDIR} -p ${DESTDIR}${PREFIX}/bin
++ ${INSTALL} -c ${OUTPUT} ${DESTDIR}${PREFIX}/bin
++
++install-strip: install
++ ${STRIP} ${DESTDIR}${PREFIX}/bin/${OUTPUT}
+
+ clean:
+ rm -f *.o
diff --git a/biology/gcta/files/patch-eigen__func.h b/biology/gcta/files/patch-eigen__func.h
new file mode 100644
index 000000000000..5325c5975685
--- /dev/null
+++ b/biology/gcta/files/patch-eigen__func.h
@@ -0,0 +1,15 @@
+--- eigen_func.h.orig 2016-06-22 03:11:01 UTC
++++ eigen_func.h
+@@ -12,9 +12,9 @@
+ #ifndef _EIGENFUNC_H
+ #define _EIGENFUNC_H
+
+-#ifndef EIGEN_USE_MKL_ALL
+-#define EIGEN_USE_MKL_ALL
+-#endif
++//#ifndef EIGEN_USE_MKL_ALL
++//#define EIGEN_USE_MKL_ALL
++//#endif
+
+ #include "CommFunc.h"
+ #include "StatFunc.h"
diff --git a/biology/gcta/files/patch-gcta.h b/biology/gcta/files/patch-gcta.h
new file mode 100644
index 000000000000..07c889655082
--- /dev/null
+++ b/biology/gcta/files/patch-gcta.h
@@ -0,0 +1,29 @@
+--- gcta.h.orig 2016-06-22 03:11:01 UTC
++++ gcta.h
+@@ -17,9 +17,9 @@
+ #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
+ #endif
+
+-#ifndef EIGEN_USE_MKL_ALL
+-#define EIGEN_USE_MKL_ALL
+-#endif
++//#ifndef EIGEN_USE_MKL_ALL
++//#define EIGEN_USE_MKL_ALL
++//#endif
+
+ #include "CommFunc.h"
+ #include "StrFunc.h"
+@@ -36,8 +36,11 @@
+ #include <unsupported/Eigen/SparseExtra>
+ #include <unsupported/Eigen/IterativeSolvers>
+ #include <omp.h>
+-#include <mkl_cblas.h>
+-#include <mkl_lapack.h>
++#include <cblas.h>
++#include <lapacke.h>
++// Looks like openblas, cblas and lapacke are all that's needed
++//#include <blaspp.h>
++//#include <lapackpp.h>
+
+ using namespace Eigen;
+ using namespace std;
diff --git a/biology/gcta/files/patch-ld.cpp b/biology/gcta/files/patch-ld.cpp
new file mode 100644
index 000000000000..c806493c1c30
--- /dev/null
+++ b/biology/gcta/files/patch-ld.cpp
@@ -0,0 +1,13 @@
+--- ld.cpp.orig 2020-04-15 12:56:27 UTC
++++ ld.cpp
+@@ -1004,7 +1004,9 @@ void gcta::calcu_max_ld_rsq_blk(eigenVector &multi_rsq
+ }
+
+
+- SelfAdjointEigenSolver<MatrixXf> pca(rsq_sub.array());
++ // Fixed compile by removing .array(). Not sure about the validity
++ // of this change, but it seemed reasonable based on constructor docs.
++ SelfAdjointEigenSolver<MatrixXf> pca(rsq_sub);
+
+ // debug
+ // ofstream tmp("tmp_R.txt");
diff --git a/biology/gcta/files/patch-mkl.cpp b/biology/gcta/files/patch-mkl.cpp
new file mode 100644
index 000000000000..b27b6dabfbce
--- /dev/null
+++ b/biology/gcta/files/patch-mkl.cpp
@@ -0,0 +1,56 @@
+--- mkl.cpp.orig 2020-04-15 00:54:40 UTC
++++ mkl.cpp
+@@ -357,7 +357,7 @@ bool gcta::comput_inverse_logdet_LDLT_mkl(eigenMatrix
+ // MKL's Cholesky decomposition
+ int info = 0, int_n = (int) n;
+ char uplo = 'L';
+- dpotrf(&uplo, &int_n, Vi_mkl, &int_n, &info);
++ dpotrf_(&uplo, &int_n, Vi_mkl, &int_n, &info);
+ //spotrf( &uplo, &n, Vi_mkl, &n, &info );
+ if (info < 0) throw ("Error: Cholesky decomposition failed. Invalid values found in the matrix.\n");
+ else if (info > 0) return false;
+@@ -369,7 +369,7 @@ bool gcta::comput_inverse_logdet_LDLT_mkl(eigenMatrix
+ }
+
+ // Calcualte V inverse
+- dpotri(&uplo, &int_n, Vi_mkl, &int_n, &info);
++ dpotri_(&uplo, &int_n, Vi_mkl, &int_n, &info);
+ //spotri( &uplo, &n, Vi_mkl, &n, &info );
+ if (info < 0) throw ("Error: invalid values found in the varaince-covaraince (V) matrix.\n");
+ else if (info > 0) return false;
+@@ -405,7 +405,7 @@ bool gcta::comput_inverse_logdet_LU_mkl(eigenMatrix &V
+ int LWORK = N*N;
+ double *WORK = new double[n * n];
+ int INFO;
+- dgetrf(&N, &N, Vi_mkl, &N, IPIV, &INFO);
++ dgetrf_(&N, &N, Vi_mkl, &N, IPIV, &INFO);
+ if (INFO < 0) throw ("Error: LU decomposition failed. Invalid values found in the matrix.\n");
+ else if (INFO > 0) {
+ delete[] Vi_mkl;
+@@ -418,7 +418,7 @@ bool gcta::comput_inverse_logdet_LU_mkl(eigenMatrix &V
+ }
+
+ // Calcualte V inverse
+- dgetri(&N, Vi_mkl, &N, IPIV, WORK, &LWORK, &INFO);
++ dgetri_(&N, Vi_mkl, &N, IPIV, WORK, &LWORK, &INFO);
+ if (INFO < 0) throw ("Error: invalid values found in the varaince-covaraince (V) matrix.\n");
+ else if (INFO > 0) return false;
+ else {
+@@ -453,7 +453,7 @@ bool gcta::comput_inverse_logdet_LU_mkl_array(int n, f
+ int LWORK = N*N;
+ double *WORK = new double[n * n];
+ int INFO;
+- dgetrf(&N, &N, Vi_mkl, &N, IPIV, &INFO);
++ dgetrf_(&N, &N, Vi_mkl, &N, IPIV, &INFO);
+ if (INFO < 0) throw ("Error: LU decomposition failed. Invalid values found in the matrix.\n");
+ else if (INFO > 0) {
+ delete[] Vi_mkl;
+@@ -467,7 +467,7 @@ bool gcta::comput_inverse_logdet_LU_mkl_array(int n, f
+ }
+
+ // Calcualte V inverse
+- dgetri(&N, Vi_mkl, &N, IPIV, WORK, &LWORK, &INFO);
++ dgetri_(&N, Vi_mkl, &N, IPIV, WORK, &LWORK, &INFO);
+ if (INFO < 0) throw ("Error: invalid values found in the varaince-covaraince (V) matrix.\n");
+ else if (INFO > 0) return (false); // Vi.diagonal()=Vi.diagonal().array()+Vi.diagonal().mean()*1e-3;
+ else {
diff --git a/biology/gcta/pkg-descr b/biology/gcta/pkg-descr
new file mode 100644
index 000000000000..e4933710da7b
--- /dev/null
+++ b/biology/gcta/pkg-descr
@@ -0,0 +1,7 @@
+GCTA (Genome-wide Complex Trait Analysis) was originally designed to estimate
+the proportion of phenotypic variance explained by genome- or chromosome-wide
+SNPs for complex traits (the GREML method), and has subsequently extended for
+many other analyses to better understand the genetic architecture of complex
+traits.
+
+WWW: http://cnsgenomics.com/software/gcta/index.html