Code Monkey home page Code Monkey logo

ldpred2's Introduction

ldpred2 project

Singularity container (via Docker image) build scripts for running statistical analysis using R and LDpred2.

Set up Git LFS

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.

Build status

License Documentation Status Flake8 lint Dockerfile lint

Getting the files

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

Description of available containers

  • ldpred2 - a container setup containing R dependencies for LDpred2 plus other tools for genetic analysis

Software versions

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

Examples

The directory <ldpred2>/example provides an example running the LDPred2 analysis. See README within.

Software aliases

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.

Software environment variables

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)

Building/rebuilding containers

For instructions on how to build or rebuild containers using Docker and Singularity refer to <ldpred2>/src/README.md.

Build the documentation

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.

Feedback

If you face any issues, or if you need additional software, please let us know by creating a new issue.

ldpred2's People

Contributors

espenhgn avatar

Watchers

 avatar

ldpred2's Issues

Missing software and packages

Software to be added

  • library(tidyr) for R
  • library(DescTools) for R
  • library(fmsb) for R
  • library(reghelper) for R

Edit: Rstudio Desktop was a suggested addition (removed). I think using rstudio-server would be preferable as it is already included via the rocker/verse base image and should work with both Singularity and Slurm HPC jobs as documented here: https://rocker-project.org/use/singularity.html. Main reason is including GUI applications in built containers would inflate their size a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.