Singularity container (via Docker image) build scripts for running statistical analysis using R and LDpred2.
Container files may get large and one should never add large binary files (.sif, .zip, .tar.gz, .mat, .dat, etc.) in git repositories directly, mainly files that can be parsed as raw text files (code files, etc.).
Git Large File Storage (LFS) should be used instead.
Before adding new files to this project after initialization (running python scripts/init.py
), go through step 1-3 on the Git LFS homepage.
Revise the <ldpred2>/.gitattributes
file as necessary. Some common file formats has been added already.
This git repository can be cloned like any other:
git clone https://github.com/comorment/ldpred2.git
Downloading only the latest version:
git clone --depth 1 https://github.com/comorment/ldpred2.git
ldpred2
- a container setup containing R dependencies for LDpred2 plus other tools for genetic analysis
Below is the list of tools included in the different Dockerfile(s) and installer bash scripts for each container.
Please keep up to date (and update the main <ldpred2>/README.md
when pushing new container builds):
container | OS/tool | version |
---|---|---|
ldpred2.sif | ubuntu | 20.04 |
ldpred2.sif | rocker/verse (R) | 4.2.1 |
ldpred2.sif | devtools (R) | 2.4.4 |
ldpred2.sif | bigreadr (R) | 0.2.4 |
ldpred2.sif | bigsnpr (R) | 1.11.4 |
ldpred2.sif | data.table (R) | 1.14.2 |
ldpred2.sif | DescTools (R) | 0.99.46 |
ldpred2.sif | dplyr (R) | 1.0.10 |
ldpred2.sif | ggplot2 (R) | 3.3.5 |
ldpred2.sif | fmsb (R) | 0.7.3 |
ldpred2.sif | magrittr (R) | 2.0.3 |
ldpred2.sif | reghelper (R) | 1.1.1 |
ldpred2.sif | tibble (R) | 3.1.8 |
ldpred2.sif | tidyr (R) | 1.2.1 |
ldpred2.sif | gctb | 2.02 |
ldpred2.sif | PRSice | 2.3.5 |
The directory <ldpred2>/example
provides an example running the LDPred2 analysis. See README within.
The container(s) provided here includes additional command line tools in addition to the R environment. It is possible to create short cuts (aliases) for interactive use in a terminal by issuing
export SIF=$PWD/containers/ldpred2.sif # point to container file
# R
alias R="singularity exec --home=$PWD:/home $SIF R"
R -e <script.R> # execute script
# plink
alias plink2="singularity exec --home=$PWD:/home $SIF plink2"
plink2 --arg1=<arg1> --arg2=<arg2> # etc.
# gctb
alias gctb="singularity exec --home=$PWD:/home $SIF gctb"
gctb --arg1=<arg1> --arg2=<arg2> # etc.
# PRSice
alias PRSice="singularity exec --home=$PWD:/home $SIF PRSice"
PRSice --arg1=<arg1> --arg2=<arg2> # etc.
And so forth.
The aliases will remain for the duration of the terminal session.
If you want them to stay for the next session, define them in your ~/.bashrc
or equivalent file.
Make sure that the the path to the container file ldpred2.sif
is correct.
Similar to the aliases defined above, one can define environment variables and use them as
export SIF=$PWD/containers/ldpred2.sif # point to container file
export <BINARY>="singularity exec --home=$PWD:/home $SIF <BINARY>"
$<BINARY> --arg1=<arg1> --arg2=<arg2> # etc.
Replace <BINARY>
by R
, plink2
, etc.
This method can be more reliable for instance in Slurm job scripts (see examples directory)
For instructions on how to build or rebuild containers using Docker and Singularity refer to <ldpred2>/src/README.md
.
Within this repository, the html-documentation can be built from source files put here using Sphinx. To do so, install Sphinx and some additional packages in python using Conda by issuing:
cd <ldpred2>/docs/source
conda env create -f environment.yml # creates environment "sphinx"
conda activate sphinx # activates environment "sphinx
make html # builds html documentation into _build/html/ subdirectory
The built documentation can be viewed locally in a web browser by opening the file
<ldpred2>/docs/source/_build/html/index.html
The documentation may also be hosted online on readthedocs.org.
If you face any issues, or if you need additional software, please let us know by creating a new issue.