diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | README.md | 51 | ||||
-rw-r--r-- | VERSION | 1 | ||||
-rwxr-xr-x | scripts/gen_version_info.sh | 12 | ||||
-rw-r--r-- | src/gemma.cpp | 37 | ||||
-rw-r--r-- | src/lmm.cpp | 2 | ||||
-rw-r--r-- | src/param.cpp | 13 |
8 files changed, 82 insertions, 52 deletions
@@ -1,6 +1,7 @@ *.o *.tar.gz src/Eigen +src/version.h example/output test/output ./output @@ -38,10 +38,12 @@ # # https://github.com/genetics-statistics/GEMMA/blob/master/INSTALL.md +GEMMA_VERSION = $(shell cat ./VERSION) + # Set this variable to either LNX or MAC SYS = LNX # LNX|MAC (Linux is the default) # Leave blank after "=" to disable; put "= 1" to enable -DIST_NAME = gemma-0.97.3 +DIST_NAME = gemma-$(GEMMA_VERSION) DEBUG = 1 # DEBUG mode, set DEBUG=0 for a release SHOW_COMPILER_WARNINGS = WITH_LAPACK = 1 @@ -132,13 +134,16 @@ ifdef WITH_LAPACK endif endif -HDR = $(wildcard src/*.h) +HDR = $(wildcard src/*.h) ./src/version.h SOURCES = $(wildcard src/*.cpp) # all OBJS = $(SOURCES:.cpp=.o) -all: $(OUTPUT) +./src/version.h: + ./scripts/gen_version_info.sh > src/version.h + +all: ./src/version.h $(OUTPUT) $(OUTPUT): $(OBJS) $(CPP) $(CPPFLAGS) $(OBJS) $(LIBS) -o $(OUTPUT) @@ -173,16 +178,18 @@ check: fast-check slow-check check-all: check lengthy-check clean: + rm $(SRC_DIR)/version.h rm -vf $(SRC_DIR)/*.o rm -vf $(SRC_DIR)/*~ rm -vf $(TEST_SRC_DIR)/*.o rm -vf $(OUTPUT) rm -vf ./bin/unittests-gemma -DIST_COMMON = COPYING.txt README.txt Makefile +DIST_COMMON = *.md LICENSE VERSION Makefile DIST_SUBDIRS = src doc example bin -tar: +tar: version all + @echo "Creating $(DIST_NAME)" mkdir -p ./$(DIST_NAME) cp $(DIST_COMMON) ./$(DIST_NAME)/ cp -r $(DIST_SUBDIRS) ./$(DIST_NAME)/ @@ -17,7 +17,8 @@ encourage contributions, for example, by forking the repository, making your changes to the code, and issuing a pull request. Currently, GEMMA is supported for 64-bit Mac OS X and Linux -platforms. *Windows is not currently supported.* If you are interested +platforms. *Windows is not currently supported.* though you can +run GEMMA in a Linux VM or [container](https://docs.docker.com/docker-for-windows/). If you are interested in helping to make GEMMA available on Windows platforms (e.g., by providing installation instructions for Windows, or by contributing Windows binaries) please post a note in the @@ -174,27 +175,39 @@ found in [INSTALL.md](INSTALL.md). ## Reporting a GEMMA bug or issue -GEMMA has an +For bugs GEMMA has an [issue tracker](https://github.com/genetics-statistics/GEMMA/issues) -on github. Before posting an issue search the issue tracker first. It -is likely someone may have encountered something similiar. Also try -running the latest version of GEMMA to make sure it has not been fixed -already. When reporting an issue include the output of the program and -the contents of the .log.txt file in the output directory. We may ask -you for your data to resolve the issue (treated confidentially). Check -list: +on github. For general support GEMMA has a mailing list at +[gemma-discussion](https://groups.google.com/forum/#!forum/gemma-discussion) + +Before posting an issue search the issue tracker and mailing list +first. It is likely someone may have encountered something +similiar. Also try running the latest version of GEMMA to make sure it +has not been fixed already. Support/installation questions should be +aimed at the mailing list. The issue tracker is for development issues +around the software itself. When reporting an issue include the output +of the program and the contents of the .log.txt file in the output +directory. + +### Check list: 1. [X] I have found and issue with GEMMA -2. [ ] I have searched for it on the [issue tracker](https://github.com/genetics-statistics/GEMMA/issues) (incl. closed issues) -3. [ ] I have tried the latest release of GEMMA -4. [ ] I have posted a new issue on the issue tracker or added to an existing one -5. [ ] I have included the output of GEMMA -6. [ ] I have included the relevant .log.txt file in the output directory -7. [ ] I have made available the data to reproduce the problem (optional) - -Please always remember that GEMMA is written and maintained by -volunteers with good intentions. Our time is valuable too. By helping -us as much as possible we can provide this tool for everyone to use. +2. [ ] I have searched for it on the [issue tracker](https://github.com/genetics-statistics/GEMMA/issues?q=is%3Aissue) (incl. closed issues) +3. [ ] I have searched for it on the [mailing list](https://groups.google.com/forum/#!forum/gemma-discussion) +4. [ ] I have tried the latest [release](https://github.com/genetics-statistics/GEMMA/releases) of GEMMA +5. [ ] I have read and agreed to below code of conduct +6. [ ] If it is a support/install question I have posted it to the [mailing list](https://groups.google.com/forum/#!forum/gemma-discussion) +7. [ ] If it is software development related I have posted a new issue on the [issue tracker](https://github.com/genetics-statistics/GEMMA/issues) or added to an existing one +8. [ ] In the message I have included the output of my GEMMA run +9. [ ] In the message I have included the relevant .log.txt file in the output directory +10. [ ] I have made available the data to reproduce the problem (optional) + +To find bugs the GEMMA software developers may ask to install a +development version of the software. They may also ask you for your +data and will treat it confidentially. Please always remember that +GEMMA is written and maintained by volunteers with good +intentions. Our time is valuable too. By helping us as much as +possible we can provide this tool for everyone to use. ## Code of conduct @@ -0,0 +1 @@ +0.97-pre3 diff --git a/scripts/gen_version_info.sh b/scripts/gen_version_info.sh new file mode 100755 index 0000000..8a9e38d --- /dev/null +++ b/scripts/gen_version_info.sh @@ -0,0 +1,12 @@ +#! /bin/bash +# +# Script to generate the version info of GEMMA and its environment +# in ./src/version.h + +DATE=$(date "+%Y/%m/%d") +YEAR=$(date "+%Y") + +echo // version.h generated by GEMMA $0 +echo \#define GEMMA_VERSION \"$(cat ./VERSION)\" +echo \#define GEMMA_DATE \"$DATE\" +echo \#define GEMMA_YEAR \"$YEAR\" diff --git a/src/gemma.cpp b/src/gemma.cpp index f9a2fc9..2c54672 100644 --- a/src/gemma.cpp +++ b/src/gemma.cpp @@ -57,10 +57,11 @@ extern "C" { #include "varcov.h" #include "vc.h" #include "debug.h" +#include "version.h" using namespace std; -GEMMA::GEMMA(void) : version("0.97.3"), date("10/10/2017"), year("2017") {} +GEMMA::GEMMA(void) : version(GEMMA_VERSION), date(GEMMA_DATE), year(GEMMA_YEAR) {} void gemma_gsl_error_handler (const char * reason, const char * file, @@ -1989,8 +1990,8 @@ void GEMMA::BatchRun(PARAM &cPar) { vec_weight, vec_z2, cPar.ni_total, cPar.ns_total, cPar.ns_test); cout << "## number of total individuals = " << cPar.ni_total << endl; - cout << "## number of total SNPs = " << cPar.ns_total << endl; - cout << "## number of analyzed SNPs = " << cPar.ns_test << endl; + cout << "## number of total SNPs/var = " << cPar.ns_total << endl; + cout << "## number of analyzed SNPs/var = " << cPar.ns_test << endl; cout << "## number of variance components = " << cPar.n_vc << endl; cout << "Calculating the q vector ... " << endl; Calcq(cPar.n_block, vec_cat, vec_ni, vec_weight, vec_z2, Vq, q, @@ -2119,8 +2120,8 @@ void GEMMA::BatchRun(PARAM &cPar) { cout << "Study Panel: " << endl; cout << "## number of total individuals = " << cPar.ni_study << endl; - cout << "## number of total SNPs = " << cPar.ns_study << endl; - cout << "## number of analyzed SNPs = " << cPar.ns_test << endl; + cout << "## number of total SNPs/var = " << cPar.ns_study << endl; + cout << "## number of analyzed SNPs/var = " << cPar.ns_test << endl; cout << "## number of variance components = " << cPar.n_vc << endl; // compute q @@ -3053,7 +3054,7 @@ void GEMMA::BatchRun(PARAM &cPar) { } cout << "## number of blocks = " << BF.size() << endl; - cout << "## number of analyzed SNPs = " << vec_rs.size() << endl; + cout << "## number of analyzed SNPs/var = " << vec_rs.size() << endl; cout << "## grid size for hyperparameters = " << wab.size() << endl; cout << "## number of continuous annotations = " << kc << endl; cout << "## number of discrete annotations = " << kd << endl; @@ -3103,7 +3104,7 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) { } outfile << "##" << endl; - outfile << "## GEMMA Version = " << version << endl; + outfile << "## GEMMA Version = " << version << " (" << date << ")" << endl; outfile << "## GSL Version = " << GSL_VERSION << endl; outfile << "## Eigen Version = " << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION << endl; #ifdef OPENBLAS @@ -3132,7 +3133,6 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) { tm *ptm = localtime(&rawtime); outfile << "## Date = " << asctime(ptm); - // ptm->tm_year<<":"<<ptm->tm_month<<":"<<ptm->tm_day":"<<ptm->tm_hour<<":"<<ptm->tm_min<<endl; outfile << "##" << endl; outfile << "## Summary Statistics:" << endl; @@ -3142,11 +3142,6 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) { << cPar.ni_study << endl; outfile << "## number of total individuals in the reference = " << cPar.ni_ref << endl; - // outfile<<"## number of total SNPs in the sample = "<<cPar.ns_study<<endl; - // outfile<<"## number of total SNPs in the reference panel = - // "<<cPar.ns_ref<<endl; - // outfile<<"## number of analyzed SNPs = "<<cPar.ns_test<<endl; - // outfile<<"## number of analyzed SNP pairs = "<<cPar.ns_pair<<endl; outfile << "## number of variance components = " << cPar.n_vc << endl; outfile << "## pve estimates = "; @@ -3196,11 +3191,11 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) { << cPar.ni_study << endl; outfile << "## number of total individuals in the reference = " << cPar.ni_total << endl; - outfile << "## number of total SNPs in the sample = " << cPar.ns_study + outfile << "## number of total SNPs/var in the sample = " << cPar.ns_study << endl; - outfile << "## number of total SNPs in the reference panel = " + outfile << "## number of total SNPs/var in the reference panel = " << cPar.ns_total << endl; - outfile << "## number of analyzed SNPs = " << cPar.ns_test << endl; + outfile << "## number of analyzed SNPs/var = " << cPar.ns_test << endl; outfile << "## number of variance components = " << cPar.n_vc << endl; } else if (!cPar.file_beta.empty() && (cPar.a_mode == 66 || cPar.a_mode == 67)) { @@ -3208,9 +3203,9 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) { << cPar.ni_total << endl; outfile << "## number of total individuals in the reference = " << cPar.ni_ref << endl; - outfile << "## number of total SNPs in the sample = " << cPar.ns_total + outfile << "## number of total SNPs/var in the sample = " << cPar.ns_total << endl; - outfile << "## number of analyzed SNPs = " << cPar.ns_test << endl; + outfile << "## number of analyzed SNPs/var = " << cPar.ns_test << endl; outfile << "## number of variance components = " << cPar.n_vc << endl; outfile << "## pve estimates = "; @@ -3280,10 +3275,10 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) { outfile << "## number of total genes = " << cPar.ng_total << endl; outfile << "## number of analyzed genes = " << cPar.ng_test << endl; } else if (cPar.file_epm.empty()) { - outfile << "## number of total SNPs = " << cPar.ns_total << endl; - outfile << "## number of analyzed SNPs = " << cPar.ns_test << endl; + outfile << "## number of total SNPs/var = " << cPar.ns_total << endl; + outfile << "## number of analyzed SNPs/var = " << cPar.ns_test << endl; } else { - outfile << "## number of analyzed SNPs = " << cPar.ns_test << endl; + outfile << "## number of analyzed SNPs/var = " << cPar.ns_test << endl; } if (cPar.a_mode == 13) { diff --git a/src/lmm.cpp b/src/lmm.cpp index ae8b747..6b07b6c 100644 --- a/src/lmm.cpp +++ b/src/lmm.cpp @@ -1525,7 +1525,7 @@ void LMM::AnalyzePlink(const gsl_matrix *U, const gsl_vector *eval, auto ci_total = 0; auto ci_test = 0; // ---- for all genotypes - for (int i = 0; i < n_bit; ++i) { + for (uint i = 0; i < n_bit; ++i) { infile.read(ch, 1); bset8 = ch[0]; diff --git a/src/param.cpp b/src/param.cpp index 1a27a53..1f583e2 100644 --- a/src/param.cpp +++ b/src/param.cpp @@ -17,6 +17,7 @@ */ #include <iostream> +#include <iomanip> #include <string> #include <algorithm> #include <cmath> @@ -1136,15 +1137,15 @@ void PARAM::CheckData(void) { cout << "## number of total genes = " << ng_total << endl; } else if (file_epm.empty() && a_mode != 43 && a_mode != 5) { if (!loco.empty()) - cout << "## leave one chromosome out (LOCO) = " << loco << endl; - cout << "## number of total SNPs = " << ns_total << endl; + cout << "## leave one chromosome out (LOCO) = " << setw(8) << loco << endl; + cout << "## number of total SNPs/var = " << setw(8) << ns_total << endl; if (setSnps.size()) - cout << "## number of considered SNPS = " << setSnps.size() << endl; + cout << "## number of considered SNPS = " << setw(8) << setSnps.size() << endl; if (setKSnps.size()) - cout << "## number of SNPS for K = " << setKSnps.size() << endl; + cout << "## number of SNPS for K = " << setw(8) << setKSnps.size() << endl; if (setGWASnps.size()) - cout << "## number of SNPS for GWAS = " << setGWASnps.size() << endl; - cout << "## number of analyzed SNPs = " << ns_test << endl; + cout << "## number of SNPS for GWAS = " << setw(8) << setGWASnps.size() << endl; + cout << "## number of analyzed SNPs = " << setw(8) << ns_test << endl; } else { } } |