diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 60c9c21e..4bc5d188 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,33 +2,33 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - repo: https://github.com/codespell-project/codespell - rev: v2.0.0 + rev: v2.2.5 hooks: - id: codespell - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 23.7.0 hooks: - id: black -- repo: https://gitlab.com/PyCQA/flake8.git - rev: 3.9.2 +- repo: https://github.com/PyCQA/flake8.git + rev: 6.0.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.812 + rev: v1.4.1 hooks: - id: mypy -- repo: https://github.com/timothycrosley/isort - rev: 5.8.0 +- repo: https://github.com/pycqa/isort + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/snakemake/snakefmt - rev: 0.4.0 + rev: v0.8.4 hooks: - id: snakefmt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2d22ff46 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +FROM continuumio/miniconda3:4.11.0 +RUN apt-get update + +#NOTE: I don't know whether the --fix-broken is actually needed +RUN apt-get -y install gcc zip libdeflate-dev libcurl4-openssl-dev --fix-broken + +WORKDIR /home + +RUN mkdir GwasQcPipeline +RUN mkdir data + +WORKDIR /home/GwasQcPipeline + +ENV PYTHONPATH=${PYTHONPATH}:${PWD} + +COPY . . + +#NOTE: I don't think we need a special env inside the container +#RUN conda create -n cgr-dev python=3.8 poetry make -y +#RUN echo "conda activate cgr-dev" >> ~/.bashrc +#RUN conda init bash && conda activate cgr-dev + +RUN conda install poetry make -y +RUN conda install -c conda-forge mamba +RUN poetry config virtualenvs.create false +RUN poetry install --without dev + +#NOTE: Aren't these also not needed? Unless somehow the docs adds the help for the CLI... +#RUN make -C docs html +#RUN pytest -v +#RUN pre-commit install +#RUN pre-commit run + + +WORKDIR /home/data + +ENTRYPOINT [ "cgr" ] diff --git a/README.md b/README.md index d7d389f1..8062d3f2 100755 --- a/README.md +++ b/README.md @@ -27,6 +27,25 @@ If you use this workflow in a paper, please cite the URL of this repository (htt The documentation of this pipeline is at https://nci-cgr.github.io/GwasQcPipeline/ +### Deploying with Docker +Build docker image from within GwasQcPipeline directory +``` +docker build -t gwas_qc_pipe . +``` + +Test docker image if you have test data +``` +docker run -v $(pwd):/home/data -i -t gwas_qc_pipe snakemake -k --use-conda -npr +``` + +Pull docker image into a singularity image file (assumes singlurity is installed) +``` +docker run -d -p 5000:5000 --restart=always --name registry registry:2 +docker tag gwas_qc_pipe localhost:5000/gwas_qc_pipe +docker push localhost:5000/gwas_qc_pipe +SINGULARITY_NOHTTPS=1 singularity pull cgr_gwas_qc_pipe.sif docker://localhost:5000/gwas_qc_pipe:latest +``` + ### LOG - add Plink GWAS for case-controls - add `sex_chr_included` parameter to config.yml. If `false` sex concordance check step is skipped. diff --git a/pyproject.toml b/pyproject.toml index ca38da03..e4f5ac75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ python = "^3.8" typer = "^0.3.2" pandas = "^1.2.4" snakemake = "~6.15.5" -pysam = "^0.16.0" +pysam = "^0.21.0" ryd = "^0.4.1" pydantic = "^1.8.2" networkx = "^2.5"