aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Randall2014-10-30 22:44:45 +0000
committerJoshua Randall2014-10-30 22:44:45 +0000
commit770a817bcf954f9550fef4d6871db4c81564da7a (patch)
tree1d233498e1ca2fc64cd74898bfb9b9f04dcd18ae
parent9a5eeda5bd2017ac5cc03893b4955cc993307f05 (diff)
parent587e0a464328110766c2e26ad2093f44c9dffa80 (diff)
downloadpangemma-770a817bcf954f9550fef4d6871db4c81564da7a.tar.gz
Merge branch 'master' into fix-make-clean-bins
Conflicts: Makefile
-rw-r--r--.gitignore4
-rw-r--r--Makefile15
-rwxr-xr-xbin/gemmabin4823751 -> 0 bytes
-rw-r--r--src/io.cpp10
4 files changed, 24 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..7ee1240 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,4 @@
+.gitignore
+*.o
+*.tar.gz
+bin/
diff --git a/Makefile b/Makefile
index 5ae13ed..e3e4a8e 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,7 @@ WITH_LAPACK = 1
FORCE_32BIT =
FORCE_DYNAMIC =
FORCE_FLOAT =
+DIST_NAME = gemma-0.95alpha
# --------------------------------------------------------------------
# Edit below this line with caution
@@ -32,7 +33,11 @@ CPP = g++
CPPFLAGS = -Wall -O3
+ifdef FORCE_DYNAMIC
+LIBS = -lgsl -lgslcblas -lblas -pthread -lz
+else
LIBS = -lgsl -lgslcblas -pthread -lz
+endif
OUTPUT = $(BIN_DIR)/gemma
@@ -106,6 +111,14 @@ $(OBJS) : $(HDR)
clean:
rm -rf ${SRC_DIR}/*.o ${SRC_DIR}/*~ *~ ${SRC_DIR}/*_float.* $(OUTPUT)
+
+DIST_COMMON = COPYING.txt README.txt Makefile
+DIST_SUBDIRS = src doc example bin
+
tar:
- tar cvzf gemma-0.93.tar.gz COPYING.txt README.txt Makefile src doc example bin
+ mkdir -p ./$(DIST_NAME)
+ cp $(DIST_COMMON) ./$(DIST_NAME)/
+ cp -r $(DIST_SUBDIRS) ./$(DIST_NAME)/
+ tar cvzf $(DIST_NAME).tar.gz ./$(DIST_NAME)/
+ rm -r ./$(DIST_NAME)
diff --git a/bin/gemma b/bin/gemma
deleted file mode 100755
index 6734240..0000000
--- a/bin/gemma
+++ /dev/null
Binary files differ
diff --git a/src/io.cpp b/src/io.cpp
index c22f668..7ed95c4 100644
--- a/src/io.cpp
+++ b/src/io.cpp
@@ -563,11 +563,12 @@ bool ReadFile_geno (const string &file_geno, const set<string> &setSnps, const g
if (flag_poly!=1) {indicator_snp.push_back(0); continue;}
- if (hwe_level!=0) {
+ if (hwe_level!=0 && maf_level!=-1) {
if (CalcHWE(n_0, n_2, n_1)<hwe_level) {indicator_snp.push_back(0); continue;}
}
//filter SNP if it is correlated with W
+ //unless W has only one column, of 1s
for (size_t i=0; i<genotype->size; ++i) {
if (gsl_vector_get (genotype_miss, i)==1) {geno=maf*2.0; gsl_vector_set (genotype, i, geno);}
}
@@ -577,7 +578,7 @@ bool ReadFile_geno (const string &file_geno, const set<string> &setSnps, const g
gsl_blas_ddot (genotype, genotype, &v_x);
gsl_blas_ddot (Wtx, WtWiWtx, &v_w);
- if (v_w/v_x >= r2_level) {indicator_snp.push_back(0); continue;}
+ if (W->size2!=1 && v_w/v_x >= r2_level) {indicator_snp.push_back(0); continue;}
indicator_snp.push_back(1);
ns_test++;
@@ -698,12 +699,13 @@ bool ReadFile_bed (const string &file_bed, const set<string> &setSnps, const gsl
if ( (n_0+n_1)==0 || (n_1+n_2)==0 || (n_2+n_0)==0) {indicator_snp.push_back(0); continue;}
- if (hwe_level!=1) {
+ if (hwe_level!=1 && maf_level!=-1) {
if (CalcHWE(n_0, n_2, n_1)<hwe_level) {indicator_snp.push_back(0); continue;}
}
//filter SNP if it is correlated with W
+ //unless W has only one column, of 1s
for (size_t i=0; i<genotype->size; ++i) {
if (gsl_vector_get (genotype_miss, i)==1) {geno=maf*2.0; gsl_vector_set (genotype, i, geno);}
}
@@ -713,7 +715,7 @@ bool ReadFile_bed (const string &file_bed, const set<string> &setSnps, const gsl
gsl_blas_ddot (genotype, genotype, &v_x);
gsl_blas_ddot (Wtx, WtWiWtx, &v_w);
- if (v_w/v_x > r2_level) {indicator_snp.push_back(0); continue;}
+ if (W->size2!=1 && v_w/v_x > r2_level) {indicator_snp.push_back(0); continue;}
indicator_snp.push_back(1);
ns_test++;