Skip to content

Commit

Permalink
Add new recipe for Alder (#13390)
Browse files Browse the repository at this point in the history
New recipe for Alder software
  • Loading branch information
ryanraaum authored Jan 28, 2019
1 parent 1719a22 commit 649b0b0
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
49 changes: 49 additions & 0 deletions recipes/alder/bioconda.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
diff --git a/Alder.cpp b/Alder.cpp
index 2b64c09..b621c22 100644
--- a/Alder.cpp
+++ b/Alder.cpp
@@ -40,7 +40,7 @@ namespace ALD {

double sq(double x) { return x*x; }

- Alder::AffineData::AffineData(int n=0, int _num_refs=0) {
+ Alder::AffineData::AffineData(int n, int _num_refs) {
count = 0;
ws = ss = s2 = 0.0;
wg = gg = gs = vector <double> (n);
diff --git a/Alder.hpp b/Alder.hpp
index 9e9b6f6..eb5457b 100644
--- a/Alder.hpp
+++ b/Alder.hpp
@@ -36,7 +36,7 @@ namespace ALD {
vector <double> wg, gg, gs;
vector < vector <double> > gigj;
int num_refs;
- AffineData(int n, int _num_refs);
+ AffineData(int n=0, int _num_refs=0);
};

// constants for determining LD correlation extent
diff --git a/AlderParams.cpp b/AlderParams.cpp
index d4e44db..47bd92a 100644
--- a/AlderParams.cpp
+++ b/AlderParams.cpp
@@ -172,7 +172,7 @@ namespace ALD {
phandle *ph ;

int i;
- while ((i = getopt (argc, argv, "p:vV")) != -1) {
+ while ((i = getopt (argc, argv, "hp:vV")) != -1) {
switch (i)
{
case 'p':
@@ -184,6 +184,9 @@ namespace ALD {
case 'V':
verbose = YES ;
break;
+ case 'h':
+ printf ("Usage: alder -p <parameter file> \n") ;
+ exit(0);
case '?':
printf ("Usage: bad params.... \n") ;
fatalx("bad params\n") ;
15 changes: 15 additions & 0 deletions recipes/alder/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

if [[ $(uname -s) == Darwin ]]; then
make CXX=clang++ \
CXXFLAGS="-Wall -Wno-return-type -Wno-write-strings -I$PREFIX/include -Iadmixtools_src -Iadmixtools_src/nicksrc" \
CFLAGS="-c -O2 -Wimplicit -Wno-return-type -Wno-write-strings -I$PREFIX/include -I. -I./nicksrc" \
L="-L$PREFIX/lib -lfftw3 -llapack -fopenmp"
else
make CXXFLAGS="-Wall -Wno-return-type -Wno-write-strings -I$PREFIX/include -Iadmixtools_src -Iadmixtools_src/nicksrc" \
CFLAGS="-c -O2 -Wimplicit -Wno-return-type -Wno-write-strings -I$PREFIX/include -I. -I./nicksrc" \
L="-L$PREFIX/lib -lfftw3 -llapack -fopenmp"
fi

mkdir -p $PREFIX/bin
cp alder $PREFIX/bin/
5 changes: 5 additions & 0 deletions recipes/alder/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This software is licensed for academic and non-profit use only. The
source code included in the admixtools_src/ subdirectory is derived
from Nick Patterson's ADMIXTOOLS software suite:

http://genetics.med.harvard.edu/reich/Reich_Lab/Software.html
44 changes: 44 additions & 0 deletions recipes/alder/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package:
name: alder
version: "1.03"

build:
number: 0

source:
url: http://cb.csail.mit.edu/cb/alder/alder_v1.03.tar.gz
sha256: aae68848dc444946aefe171322e0d98b1a0cc0c82f3669007ad9608d331b7241
patches:
- bioconda.patch

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- patch
host:
- fftw
- lapack
- clangdev # [osx]
- libcxx 4.0.* # [osx]
- openmp 4.0.* # [osx]
run:
- fftw
- lapack
- libcxx 4.0.* # [osx]
- openmp 4.0.* # [osx]

test:
commands:
- alder -h > /dev/null 2>&1

about:
home: http://cb.csail.mit.edu/cb/alder/
license: Custom OSS
license_file: license.txt
summary: The ALDER software computes the weighted linkage disequilibrium (LD) statistic for making inference about population admixture

extra:
identifiers:
- biotools:alder
- doi:10.1534/genetics.112.147330

0 comments on commit 649b0b0

Please sign in to comment.