Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (3)
New upstream version 1.90~b6.6-181012
· 868d9efd
Dylan Aïssi
authored
Nov 01, 2018
868d9efd
Merge tag 'upstream/1.90_b6.6-181012'
· ccac1a94
Dylan Aïssi
authored
Nov 01, 2018
Upstream version 1.90~b6.6-181012
ccac1a94
Update changelogs
· cda5f058
Dylan Aïssi
authored
Nov 01, 2018
cda5f058
Show whitespace changes
Inline
Side-by-side
Makefile
View file @
cda5f058
...
...
@@ -31,7 +31,7 @@ CC ?= gcc
CXX
?=
g++
CFLAGS
?=
-Wall
-O2
CXXFLAGS
?=
-Wall
-O2
BLASFLAGS
?=
-L
/usr/lib64/atlas
-llapack
-lcblas
-latlas
BLASFLAGS
?=
-L
/usr/lib64/atlas
-llapack
-lblas
-lcblas
-latlas
LDFLAGS
?=
-lm
-lpthread
-ldl
ZLIB
?=
../zlib-1.2.11/libz.so.1.2.11
...
...
Makefile.std
View file @
cda5f058
...
...
@@ -31,7 +31,7 @@ CC ?= gcc
CXX
?=
g++
CFLAGS
?=
-Wall
-O2
CXXFLAGS
?=
-Wall
-O2
BLASFLAGS
?=
-L
/usr/lib64/atlas
-llapack
-lcblas
-latlas
BLASFLAGS
?=
-L
/usr/lib64/atlas
-llapack
-lblas
-lcblas
-latlas
LDFLAGS
?=
-lm
-lpthread
-ldl
ZLIB
?=
../zlib-1.2.11/libz.so.1.2.11
...
...
debian/changelog
View file @
cda5f058
plink1.9 (1.90~b6.6-181012-1) UNRELEASED; urgency=medium
* New upstream release.
* Update my email address.
-- Dylan Aïssi <daissi@debian.org> Thu, 01 Nov 2018 07:30:31 +0100
plink1.9 (1.90~b6.5-180913-1) unstable; urgency=medium
* New upstream release.
...
...
debian/control
View file @
cda5f058
Source: plink1.9
Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Uploaders: Dylan Aïssi <
bob.dybian@gmail.com
>
Uploaders: Dylan Aïssi <
daissi@debian.org
>
Section: science
Priority: optional
Build-Depends: debhelper (>= 11~),
...
...
debian/upstream.docs/upstream.changelog
View file @
cda5f058
# Copy/Paste from https://www.cog-genomics.org/plink/1.9/
13 Sep 2018: Improved logistic regression convergence-failure detection (affects case/control --epistasis as well as --logistic). Fixed --R memory leak.
10 Oct 2018: Fixed --tdt parent-of-origin-analysis handling of chrX.
13 Sep: Improved logistic regression convergence-failure detection (affects case/control --epistasis as well as --logistic). Fixed --R memory leak.
7 Aug: --assoc set-test bugfix.
...
...
plink.c
View file @
cda5f058
...
...
@@ -93,7 +93,7 @@
static const char ver_str[] =
#ifdef STABLE_BUILD
"PLINK v1.90b6.
5
"
"PLINK v1.90b6.
6
"
#else
"PLINK v1.90p"
#endif
...
...
@@ -105,7 +105,7 @@ static const char ver_str[] =
#else
" 32-bit"
#endif
" (1
3 Sep
2018)";
" (1
2 Oct
2018)";
static const char ver_str2[] =
// include leading space if day < 10, so character length stays the same
""
...
...
plink_common.h
View file @
cda5f058
...
...
@@ -27,6 +27,9 @@
#include
<string.h>
#include
<math.h>
#include
<stdint.h>
#ifndef __STDC_FORMAT_MACROS
# define __STDC_FORMAT_MACROS 1
#endif
#include
<inttypes.h>
// avoid compiler warning
...
...
@@ -59,7 +62,13 @@
// needed for MEMORYSTATUSEX
#ifndef _WIN64
#define WINVER 0x0500
#else
#define __LP64__
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include
<windows.h>
#else // Unix
#include
<sys/stat.h>
#endif
...
...
@@ -77,12 +86,13 @@
#endif
#ifdef _WIN32
#define PRId64 "I64d"
#define PRIu64 "I64u"
#define fseeko fseeko64
#define ftello ftello64
#include
<windows.h>
#include
<process.h>
# undef PRId64
# undef PRIu64
# define PRId64 "I64d"
# define PRIu64 "I64u"
#define pthread_t HANDLE
#define THREAD_RET_TYPE unsigned __stdcall
#define THREAD_RETURN return 0
...
...
@@ -96,8 +106,10 @@
#define getc_unlocked getc
#define putc_unlocked putc
#endif
#if __cplusplus < 201103L
#define uint64_t unsigned long long
#define int64_t long long
#endif
#else
#include
<pthread.h>
#define THREAD_RET_TYPE void*
...
...
@@ -144,6 +156,27 @@
#ifdef __cplusplus
#include
<algorithm>
# ifdef _WIN32
// Windows C++11 <algorithm> resets these values :(
# undef PRIu64
# undef PRId64
# define PRIu64 "I64u"
# define PRId64 "I64d"
# undef PRIuPTR
# undef PRIdPTR
# ifdef __LP64__
# define PRIuPTR PRIu64
# define PRIdPTR PRId64
# else
# if __cplusplus < 201103L
# define PRIuPTR "lu"
# define PRIdPTR "ld"
# else
# define PRIuPTR "u"
# define PRIdPTR "d"
# endif
# endif
# endif
#define HEADER_INLINE inline
#else
#define HEADER_INLINE static inline
...
...
@@ -206,10 +239,10 @@
#define ZEROLU 0LU
#define ONELU 1LU
#ifndef PRIuPTR
# if (__GNUC__ <= 4) && (__GNUC_MINOR__ < 8) && (__cplusplus < 201103L)
# undef PRIuPTR
# undef PRIdPTR
# define PRIuPTR "lu"
#endif
#ifndef PRIdPTR
# define PRIdPTR "ld"
# endif
#define PRIxPTR2 "08lx"
...
...
plink_family.c
View file @
cda5f058
...
...
@@ -1749,6 +1749,7 @@ int32_t tdt_poo(pthread_t* threads, FILE* bedfile, uintptr_t bed_offset, char* o
// entry bit 16 & 24: hhh?
// entry bit 17: paternal A1 transmitted?
// entry bit 25: maternal A1 transmitted?
// bugfix (10 Oct 2018): missed a few chrX possibilities
const
uint32_t
poo_table
[]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
...
...
@@ -1758,10 +1759,10 @@ int32_t tdt_poo(pthread_t* threads, FILE* bedfile, uintptr_t bed_offset, char* o
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0x2000200
,
0
,
0x200
,
0
,
0x2000200
,
0
,
0x200
,
0x20
0
,
0
,
0
,
0
,
0
,
0x2020202
,
0
,
0x1010202
,
0x202
,
0
,
0
,
0x2000200
,
0x200
,
0x200020
0
,
0
,
0x2000200
,
0x200
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0x20002
,
2
};
...
...
plink_matrix.c
View file @
cda5f058
...
...
@@ -286,7 +286,7 @@ int32_t invert_matrix(int32_t dim, double* matrix, MATRIX_INVERT_BUF1_TYPE* dbl_
}
return
0
;
}
#else
#else
// !NOLAPACK
int32_t
invert_matrix
(
__CLPK_integer
dim
,
double
*
matrix
,
MATRIX_INVERT_BUF1_TYPE
*
int_1d_buf
,
double
*
dbl_2d_buf
)
{
// dgetrf_/dgetri_ is more efficient than dpotrf_/dpotri_ on OS X.
__CLPK_integer
lwork
=
dim
*
dim
;
...
...
@@ -321,7 +321,7 @@ int32_t invert_matrix_checked(__CLPK_integer dim, double* matrix, MATRIX_INVERT_
dgetri_
(
&
dim
,
matrix
,
&
dim
,
int_1d_buf
,
dbl_2d_buf
,
&
lwork
,
&
info
);
return
0
;
}
#endif
#endif
// !NOLAPACK
void
col_major_matrix_multiply
(
__CLPK_integer
row1_ct
,
__CLPK_integer
col2_ct
,
__CLPK_integer
common_ct
,
double
*
inmatrix1
,
double
*
inmatrix2
,
double
*
outmatrix
)
{
#ifdef NOLAPACK
...
...
@@ -345,15 +345,15 @@ void col_major_matrix_multiply(__CLPK_integer row1_ct, __CLPK_integer col2_ct, _
}
}
#else
#ifdef
_WIN32
#
if
n
def
USE_CBLAS_XGEMM
char
blas_char
=
'N'
;
double
dyy
=
1
;
double
dzz
=
0
;
dgemm_
(
&
blas_char
,
&
blas_char
,
&
row1_ct
,
&
col2_ct
,
&
common_ct
,
&
dyy
,
inmatrix1
,
&
row1_ct
,
inmatrix2
,
&
common_ct
,
&
dzz
,
outmatrix
,
&
row1_ct
);
# else
cblas_dgemm
(
CblasColMajor
,
CblasNoTrans
,
CblasNoTrans
,
row1_ct
,
col2_ct
,
common_ct
,
1
.
0
,
inmatrix1
,
row1_ct
,
inmatrix2
,
common_ct
,
0
.
0
,
outmatrix
,
row1_ct
);
#endif //
_WIN32
#endif // NOLAPACK
#
endif
//
USE_CBLAS_XGEMM
#endif
//
!
NOLAPACK
}
void
col_major_fmatrix_multiply
(
__CLPK_integer
row1_ct
,
__CLPK_integer
col2_ct
,
__CLPK_integer
common_ct
,
float
*
inmatrix1
,
float
*
inmatrix2
,
float
*
outmatrix
)
{
...
...
@@ -378,15 +378,15 @@ void col_major_fmatrix_multiply(__CLPK_integer row1_ct, __CLPK_integer col2_ct,
}
}
#else
#ifdef
_WIN32
#
if
n
def
USE_CBLAS_XGEMM
char
blas_char
=
'N'
;
float
fyy
=
1
;
float
fzz
=
0
;
sgemm_
(
&
blas_char
,
&
blas_char
,
&
row1_ct
,
&
col2_ct
,
&
common_ct
,
&
fyy
,
inmatrix1
,
&
row1_ct
,
inmatrix2
,
&
common_ct
,
&
fzz
,
outmatrix
,
&
row1_ct
);
# else
cblas_sgemm
(
CblasColMajor
,
CblasNoTrans
,
CblasNoTrans
,
row1_ct
,
col2_ct
,
common_ct
,
1
.
0
,
inmatrix1
,
row1_ct
,
inmatrix2
,
common_ct
,
0
.
0
,
outmatrix
,
row1_ct
);
#endif //
_WIN32
#endif // NOLAPACK
#
endif
//
USE_CBLAS_XGEMM
#endif
//
!
NOLAPACK
}
// Todo: replace these with cache-oblivious, or at least -friendlier,
...
...
plink_matrix.h
View file @
cda5f058
...
...
@@ -19,17 +19,7 @@
// Wrappers for frequent LAPACK calls (sometimes with no-LAPACK fallbacks).
// May want to make this comprehensive to make linking with Intel MKL practical
// in the future.
// todo: allow this to take advantage of 64-bit integer LAPACK. As of this
// writing, it's available on Amazon EC2 64-bit Linux instances, but I can't
// find it for Windows. (And even if OS X vecLib adds it soon, we can't use it
// there anytime soon because static linking is not an option.)
#ifdef __APPLE__
#include
<Accelerate/Accelerate.h>
#endif
// (Update, 11 Oct 2018: Backported PLINK 2.0's MKL support.)
#ifdef NOLAPACK
...
...
@@ -38,47 +28,109 @@
# define MATRIX_INVERT_BUF1_CHECKED_ALLOC (2 * sizeof(double))
# define __CLPK_integer int
#else // not NOLAPACK
#else // !NOLAPACK
# ifdef __APPLE__
# include <Accelerate/Accelerate.h>
# define USE_CBLAS_XGEMM
# endif
# ifndef __APPLE__
# ifdef __cplusplus
extern
"C"
{
# endif
typedef
double
__CLPK_doublereal
;
# if defined(__LP64__) || defined(_WIN32)
typedef
int32_t
__CLPK_integer
;
# else
typedef
long
int
__CLPK_integer
;
# endif
# ifdef _WIN32
// openblas is easy enough to set up on Windows nowadays.
// not worth the trouble of ripping out vector extensions, etc. just so we
// can compile with Visual Studio and gain access to MKL.
// (todo: upgrade from 0.2.19 to a later version, build setup will probably
// need to change a bit)
# define HAVE_LAPACK_CONFIG_H
# define LAPACK_COMPLEX_STRUCTURE
#include
"lapack/lapacke/include/lapacke.h"
typedef
int32_t
__CLPK_integer
;
# include "lapacke.h"
__CLPK_doublereal
ddot_
(
__CLPK_integer
*
n
,
__CLPK_doublereal
*
dx
,
__CLPK_integer
*
incx
,
__CLPK_doublereal
*
dy
,
__CLPK_integer
*
incy
);
void
dger_
(
int
*
m
,
int
*
n
,
double
*
alpha
,
double
*
x
,
int
*
incx
,
double
*
y
,
int
*
incy
,
double
*
a
,
int
*
lda
);
void
dgemm_
(
char
*
transa
,
char
*
transb
,
int
*
m
,
int
*
n
,
int
*
k
,
double
*
alpha
,
double
*
a
,
int
*
lda
,
double
*
b
,
int
*
ldb
,
double
*
beta
,
double
*
c
,
int
*
ldc
);
void
dgemm_
(
char
*
transa
,
char
*
transb
,
__CLPK_integer
*
m
,
__CLPK_integer
*
n
,
__CLPK_integer
*
k
,
double
*
alpha
,
double
*
a
,
__CLPK_integer
*
lda
,
double
*
b
,
__CLPK_integer
*
ldb
,
double
*
beta
,
double
*
c
,
__CLPK_integer
*
ldc
);
void
dsymv_
(
char
*
uplo
,
int
*
n
,
double
*
alpha
,
double
*
a
,
int
*
lda
,
double
*
x
,
int
*
incx
,
double
*
beta
,
double
*
y
,
int
*
incy
);
double
ddot_
(
int
*
n
,
double
*
dx
,
int
*
incx
,
double
*
dy
,
int
*
incy
);
void
dgetrf_
(
__CLPK_integer
*
m
,
__CLPK_integer
*
n
,
__CLPK_doublereal
*
a
,
__CLPK_integer
*
lda
,
__CLPK_integer
*
ipiv
,
__CLPK_integer
*
info
);
void
sgemm_
(
char
*
transa
,
char
*
transb
,
int
*
m
,
int
*
n
,
int
*
k
,
float
*
alpha
,
float
*
a
,
int
*
lda
,
float
*
b
,
int
*
ldb
,
float
*
beta
,
float
*
c
,
int
*
ldc
);
void
sgemm_
(
char
*
transa
,
char
*
transb
,
__CLPK_integer
*
m
,
__CLPK_integer
*
n
,
__CLPK_integer
*
k
,
float
*
alpha
,
float
*
a
,
__CLPK_integer
*
lda
,
float
*
b
,
__CLPK_integer
*
ldb
,
float
*
beta
,
float
*
c
,
__CLPK_integer
*
ldc
);
#else // not _WIN32
# else // Linux
# ifdef USE_MKL
# ifndef __LP64__
# error "32-bit Linux build does not support Intel MKL."
# endif
# define USE_CBLAS_XGEMM
// sizeof(MKL_INT) should be 4.
# define MKL_LP64
# ifdef DYNAMIC_MKL
# include <mkl_service.h>
# include <mkl_cblas.h>
# include <mkl_lapack.h>
# else
# include "mkl_service.h"
# include "mkl_cblas.h"
# include "mkl_lapack.h"
# endif
# else
# ifdef USE_CBLAS_XGEMM
# include <cblas.h>
#ifdef __LP64__
typedef
int32_t
__CLPK_integer
;
# else
typedef
long
int
__CLPK_integer
;
// ARGH
// cmake on Ubuntu 14 seems to require use of cblas_f77.h instead of cblas.h.
// Conversely, cblas_f77.h does not seem to be available on the Scientific
// Linux ATLAS/LAPACK install, and right now that's my only option for
// producing 32-bit static builds...
// So. Default include is cblas.h. To play well with cmake + Ubuntu 14 and
// 16 simultaneously, there is a CBLAS_F77_ON_OLD_GCC mode which picks
// cblas_f77.h on Ubuntu 14 and cblas.h on 16.
# ifdef FORCE_CBLAS_F77
# include <cblas_f77.h>
# elif !defined(CBLAS_F77_ON_OLD_GCC)
# include <cblas.h>
# else
# if (__GNUC__ <= 4)
# include <cblas_f77.h>
# else
# if __has_include(<cblas.h>)
# include <cblas.h>
# else
# include <cblas_f77.h>
# endif
# endif
# endif
__CLPK_doublereal
ddot_
(
__CLPK_integer
*
n
,
__CLPK_doublereal
*
dx
,
__CLPK_integer
*
incx
,
__CLPK_doublereal
*
dy
,
__CLPK_integer
*
incy
);
# endif
int
dgetrf_
(
__CLPK_integer
*
m
,
__CLPK_integer
*
n
,
__CLPK_doublereal
*
a
,
__CLPK_integer
*
lda
,
__CLPK_integer
*
ipiv
,
__CLPK_integer
*
info
);
...
...
@@ -118,20 +170,39 @@ extern "C" {
__CLPK_doublereal
*
vt
,
__CLPK_integer
*
ldvt
,
__CLPK_doublereal
*
work
,
__CLPK_integer
*
lwork
,
__CLPK_integer
*
iwork
,
__CLPK_integer
*
info
);
# ifndef USE_CBLAS_XGEMM
void
dgemm_
(
char
*
transa
,
char
*
transb
,
__CLPK_integer
*
m
,
__CLPK_integer
*
n
,
__CLPK_integer
*
k
,
double
*
alpha
,
double
*
a
,
__CLPK_integer
*
lda
,
double
*
b
,
__CLPK_integer
*
ldb
,
double
*
beta
,
double
*
c
,
__CLPK_integer
*
ldc
);
void
dsymv_
(
char
*
uplo
,
int
*
n
,
double
*
alpha
,
double
*
a
,
int
*
lda
,
double
*
x
,
int
*
incx
,
double
*
beta
,
double
*
y
,
int
*
incy
);
void
sgemm_
(
char
*
transa
,
char
*
transb
,
__CLPK_integer
*
m
,
__CLPK_integer
*
n
,
__CLPK_integer
*
k
,
float
*
alpha
,
float
*
a
,
__CLPK_integer
*
lda
,
float
*
b
,
__CLPK_integer
*
ldb
,
float
*
beta
,
float
*
c
,
__CLPK_integer
*
ldc
);
# endif
# endif // !USE_MKL
# endif
void
xerbla_
(
void
);
# ifdef __cplusplus
}
#endif // __cplusplus
#endif // __APPLE__
}
// extern "C"
# endif
# endif // !__APPLE__
# define MATRIX_INVERT_BUF1_TYPE __CLPK_integer
# define MATRIX_INVERT_BUF1_ELEM_ALLOC sizeof(__CLPK_integer)
// invert_matrix_checked() usually requires a larger buffer
# define MATRIX_INVERT_BUF1_CHECKED_ALLOC (2 * sizeof(__CLPK_integer))
#endif // NOLAPACK
#endif
//
!
NOLAPACK
#define MATRIX_SINGULAR_RCOND 1e-14
...
...
plink_rserve.c
View file @
cda5f058
...
...
@@ -20,14 +20,14 @@
// gcc instead of g++.
#if defined __cplusplus && !defined _WIN32
#include
"plink_common.h"
#include
"plink_cluster.h"
#define MAIN
#define SOCK_ERRORS
#include
"sisocks.h"
#include
"Rconnection.h"
#include
"plink_common.h"
#include
"plink_cluster.h"
#define RPLUGIN_BLOCK_SIZE 100
int32_t
rserve_call
(
char
*
rplugin_fname
,
char
*
rplugin_host_or_socket
,
int32_t
rplugin_port
,
uint32_t
rplugin_debug
,
FILE
*
bedfile
,
uintptr_t
bed_offset
,
uintptr_t
marker_ct
,
uintptr_t
unfiltered_marker_ct
,
uintptr_t
*
marker_exclude
,
uintptr_t
*
marker_reverse
,
char
*
marker_ids
,
uintptr_t
max_marker_id_len
,
char
**
marker_allele_ptrs
,
uint32_t
*
marker_pos
,
uint32_t
plink_maxsnp
,
Chrom_info
*
chrom_info_ptr
,
uintptr_t
unfiltered_sample_ct
,
uintptr_t
*
pheno_nm
,
uint32_t
pheno_nm_ct
,
uintptr_t
*
pheno_c
,
double
*
pheno_d
,
uint32_t
cluster_ct
,
uint32_t
*
cluster_map
,
uint32_t
*
cluster_starts
,
uintptr_t
covar_ct
,
double
*
covar_d
,
char
*
outname
,
char
*
outname_end
)
{
...
...
toy.ped
View file @
cda5f058
1 1000000000 0 0 1 1 0 0
1 1
1 1000000001 0 0 1 2
1 1 1 2
1 1000000000 0 0 1 1 0 0
A A
1 1000000001 0 0 1 2
C C A G