Skip to content

Commit

Permalink
Add tutorial to repo (with symlink to datasets folder),
Browse files Browse the repository at this point in the history
and use as basis for RMW and RM unit tests
  • Loading branch information
abought committed Feb 22, 2018
1 parent 48e9d3b commit 82e47df
Show file tree
Hide file tree
Showing 52 changed files with 7,778 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,9 @@ add_executable(raremetalworker
target_include_directories(raremetalworker PRIVATE otherLib/eigen-3.2.0)
target_link_libraries(raremetalworker libraremetal ${LIB_SAVVY} ${LIB_ZSTD})
target_compile_definitions(raremetalworker PRIVATE VERSION="${PROJECT_VERSION}")


if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ For more information, please see the [RAREMETAL wiki](http://genome.sph.umich.ed
## Installation
1. Clone this repository
2. Open a terminal and change to the directory containing this README file.
3. Enter the following sequence of commands to download dependencies and build the code:
3. Enter the following sequence of commands to download dependencies and build the code (with tests run automatically during build):

```bash
cget install -f requirements.txt
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cget/cget/cget.cmake ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cget/cget/cget.cmake -DBUILD_TESTS=1 ..
make
```

If you encounter problems while building, see the wiki for more information.
To run unit tests, ensure that you have run cmake with `-DBUILD_TESTS=1` and built at least once,
then run `make` or `ctest --verbose`.

If you encounter problems while building, see the [wiki FAQ](https://genome.sph.umich.edu/wiki/RAREMETAL_FAQ) for
more information.

## Changes
Newest version: v.4.14.1 released at 07/10/2017
Expand Down
51 changes: 51 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Test scenarios:
# Two tools, many parameters for each
# - Raremetalworker
# - Raremetal


set(RMW_BIN ${CMAKE_BINARY_DIR}/raremetalworker)
set(RM_BIN ${CMAKE_BINARY_DIR}/raremetal)


#### RAREMETAL TUTORIAL
# Make test assets (inputs) available in build folder
file(COPY datasets/raremetal_tutorial
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})


## Prepare the basic directory structure (in the build folder) for tests to run
# Each test has a base folder with `inputs`, `expected`, and `outputs`
# For a first-stage analysis, there may be no special inputs. Outputs will be wiped on every test run.
set(BASE_TEST_FOLDER ${CMAKE_CURRENT_BINARY_DIR}/test_tut_rmw)
file(MAKE_DIRECTORY ${BASE_TEST_FOLDER})
file(MAKE_DIRECTORY ${BASE_TEST_FOLDER}/inputs)
file(MAKE_DIRECTORY ${BASE_TEST_FOLDER}/expected)

file(COPY raremetalworker/tutorial/expected
DESTINATION ${BASE_TEST_FOLDER})

add_test(NAME test_tut_rmw
COMMAND ${CMAKE_COMMAND}
-DRMW_BIN=${RMW_BIN}
-DBASE_TEST_FOLDER=${BASE_TEST_FOLDER}
-P ${CMAKE_CURRENT_SOURCE_DIR}/raremetalworker/script.cmake)


set(BASE_TEST_FOLDER ${CMAKE_CURRENT_BINARY_DIR}/test_tut_rm)
file(MAKE_DIRECTORY ${BASE_TEST_FOLDER})
file(MAKE_DIRECTORY ${BASE_TEST_FOLDER}/inputs)
file(MAKE_DIRECTORY ${BASE_TEST_FOLDER}/expected)

file(COPY raremetal/tutorial/expected
DESTINATION ${BASE_TEST_FOLDER})
file(COPY raremetal/tutorial/expected
DESTINATION ${BASE_TEST_FOLDER})
file(COPY raremetal/tutorial/inputs
DESTINATION ${BASE_TEST_FOLDER})

add_test(NAME test_tut_rm
COMMAND ${CMAKE_COMMAND}
-DRM_BIN=${RM_BIN}
-DBASE_TEST_FOLDER=${BASE_TEST_FOLDER}
-P ${CMAKE_CURRENT_SOURCE_DIR}/raremetal/script.cmake)
5 changes: 5 additions & 0 deletions tests/datasets/raremetal_tutorial/command_to_use
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$yourpath/raremetalworker --ped example1.ped --dat example1.dat --vcf example1.vcf.gz --traitName QT1 --inverseNormal --makeResiduals --kinSave --kinGeno --prefix STUDY1

$youpath/raremetalworker --ped example2.ped --dat example2.dat --vcf example2.vcf.gz --traitName QT1 --inverseNormal --makeResiduals --kinSave --kinGeno --prefix STUDY2

$yourpath/raremetal --summaryFiles summaryfiles --covFiles covfiles --groupFile group.file --SKAT --burden --MB --VT --hwe 1.0e-05 --callRate 0.95 --longOutput --tabulateHits --hitsCutoff 1e-05 --prefix COMBINED.QT1 --labelHits
2 changes: 2 additions & 0 deletions tests/datasets/raremetal_tutorial/covfiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
STUDY1.QT1.singlevar.cov.txt.gz
STUDY2.QT1.singlevar.cov.txt.gz
7 changes: 7 additions & 0 deletions tests/datasets/raremetal_tutorial/example1.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
C AGE
C AGE2
C SEX
T QT4
T QT3
T QT2
T QT1
Loading

0 comments on commit 82e47df

Please sign in to comment.