-
Notifications
You must be signed in to change notification settings - Fork 7
Vcf sanity check #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Vcf sanity check #143
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
54de06e
issue #32 complete
Cristianetaniguti 8890234
vcf check never breaks + viewpoly output
Cristianetaniguti d4e41ca
update Dockerfile
Cristianetaniguti 52db70b
version 1.3.1
Cristianetaniguti 8a6cb41
docker fast build
Cristianetaniguti b721b9b
update version
Cristianetaniguti 04405f0
rm main branch requirement
Cristianetaniguti 060bf7e
up version to docker test
Cristianetaniguti 6859ff9
fix for arm64
Cristianetaniguti 1fa8481
add vcf_sanity_check to filter tab + export PCA tab
Cristianetaniguti 0737930
max markers as warning
Cristianetaniguti 71c5823
error if doesnt have .gz but is compressed
Cristianetaniguti 2ad082f
up version + BIGr from CRAN
Cristianetaniguti a925296
run arm64 #92
Cristianetaniguti f91617f
fix format #92
Cristianetaniguti a303e3d
sintax fix #92
Cristianetaniguti b3157e4
change schedule for test #92
Cristianetaniguti 3f04519
use a native ARM64 runner #92
Cristianetaniguti e546fa9
add BIG citation to help files
Cristianetaniguti 9f1a10d
add i
Cristianetaniguti bb6e208
deps manifest okay
Cristianetaniguti 5abfd30
adjust version on footer
Cristianetaniguti 21b00d9
update manifest decl.
Cristianetaniguti 901b813
up version
Cristianetaniguti ef0b54d
update images
Cristianetaniguti 0549b03
option to save removed sample list
alex-sandercock 30527fa
Merge branch 'development' into vcf_sanity_check
alex-sandercock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| name: Build & Push Docker image on package version change | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, vcf_sanity_check ] | ||
| paths: | ||
| - .github/workflows/dockerhub-on-version.yml | ||
| - Dockerfile | ||
| - DESCRIPTION | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: docker-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| IMAGE: docker.io/breedinginsight/bigapp | ||
| IMAGE_DEPS: docker.io/breedinginsight/bigapp-deps | ||
| DEPS_TAG: r4.5-bioc3.21-2025-08 | ||
|
|
||
| jobs: | ||
| check-version: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| changed: ${{ steps.ver.outputs.changed }} | ||
| version: ${{ steps.ver.outputs.version }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - id: ver | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| cur_ver=$(sed -n 's/^Version:[[:space:]]*//p' DESCRIPTION | tr -d '[:space:]') | ||
| prev_sha="${{ github.event.before }}" | ||
| if git show "${prev_sha}:DESCRIPTION" >/dev/null 2>&1; then | ||
| prev_ver=$(git show "${prev_sha}:DESCRIPTION" | sed -n 's/^Version:[[:space:]]*//p' | tr -d '[:space:]') | ||
| else | ||
| prev_ver="" | ||
| fi | ||
| changed=false | ||
| if [[ -z "${prev_ver}" || "${cur_ver}" != "${prev_ver}" ]]; then changed=true; fi | ||
| echo "version=${cur_ver}" >> "$GITHUB_OUTPUT" | ||
| echo "changed=${changed}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| build-amd64: | ||
| needs: check-version | ||
| if: needs['check-version'].outputs.changed == 'true' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 120 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: docker/setup-qemu-action@v3 | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
| - id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.IMAGE }} | ||
| tags: | | ||
| type=raw,value=v${{ needs['check-version'].outputs.version }}-amd64 | ||
| type=raw,value=sha-${{ github.sha }}-amd64 | ||
| - name: Build & push app (amd64) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: Dockerfile | ||
| platforms: linux/amd64 | ||
| push: true | ||
| build-args: | | ||
| BASE_IMAGE=${{ env.IMAGE_DEPS }}:${{ env.DEPS_TAG }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| cache-from: | | ||
| type=registry,ref=${{ env.IMAGE }}:buildcache-amd64 | ||
| cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache-amd64,mode=max,compression=zstd | ||
|
|
||
| build-arm64: | ||
| needs: check-version | ||
| if: needs['check-version'].outputs.changed == 'true' | ||
| continue-on-error: true | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 350 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: docker/setup-qemu-action@v3 | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
| - id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.IMAGE }} | ||
| tags: | | ||
| type=raw,value=v${{ needs['check-version'].outputs.version }}-arm64 | ||
| type=raw,value=sha-${{ github.sha }}-arm64 | ||
| - name: Build & push app (arm64) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: Dockerfile | ||
| platforms: linux/arm64 | ||
| push: true | ||
| build-args: | | ||
| BASE_IMAGE=${{ env.IMAGE_DEPS }}:${{ env.DEPS_TAG }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| cache-from: | | ||
| type=registry,ref=${{ env.IMAGE }}:buildcache-arm64 | ||
| cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache-arm64,mode=max,compression=zstd | ||
|
|
||
| manifest: | ||
| needs: [check-version, build-amd64, build-arm64] | ||
| if: > | ||
| needs['check-version'].outputs.changed == 'true' && | ||
| needs['build-amd64'].result == 'success' && | ||
| needs['build-arm64'].result == 'success' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
|
||
| - name: Create multi-arch manifest | ||
| env: | ||
| IMAGE: ${{ env.IMAGE }} | ||
| PKG_VERSION: ${{ needs['check-version'].outputs.version }} | ||
| run: | | ||
| set -euo pipefail | ||
| docker buildx imagetools create \ | ||
| -t "$IMAGE:v${PKG_VERSION}" \ | ||
| -t "$IMAGE:latest" \ | ||
| "$IMAGE:v${PKG_VERSION}-amd64" \ | ||
| "$IMAGE:v${PKG_VERSION}-arm64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,25 @@ | ||
| FROM rocker/r-ver:4.4.2 | ||
| RUN apt-get update && apt-get install -y cmake libz-dev libcurl4-openssl-dev libssl-dev | ||
| RUN R -e 'install.packages("remotes")' | ||
| RUN Rscript -e 'remotes::install_version("adegenet",upgrade="never", version = "2.1.10")' | ||
| RUN Rscript -e 'remotes::install_version("curl",upgrade="never", version = "6.0.1")' | ||
| RUN Rscript -e 'remotes::install_version("DT",upgrade="never", version = "0.33")' | ||
| RUN Rscript -e 'remotes::install_version("dplyr",upgrade="never", version = "1.1.4")' | ||
| RUN Rscript -e 'remotes::install_version("vcfR",upgrade="never", version = "1.15.0")' | ||
| RUN Rscript -e 'remotes::install_version("ggplot2",upgrade="never", version = "3.5.1")' | ||
| RUN Rscript -e 'remotes::install_version("tidyr",upgrade="never", version = "1.3.1")' | ||
| RUN Rscript -e 'remotes::install_version("curl",upgrade="never", version = "6.0.1")' | ||
| RUN Rscript -e 'remotes::install_version("shiny",upgrade="never", version = "1.9.1")' | ||
| RUN Rscript -e 'remotes::install_version("config",upgrade="never", version = "0.3.2")' | ||
| RUN Rscript -e 'remotes::install_version("bs4Dash",upgrade="never", version = "2.3.4")' | ||
| RUN Rscript -e 'remotes::install_version("golem",upgrade="never", version = "0.5.1")' | ||
| RUN Rscript -e 'remotes::install_version("purrr",upgrade="never", version = "1.0.2")' | ||
| RUN Rscript -e 'remotes::install_version("markdown",upgrade="never", version = "1.13")' | ||
| RUN Rscript -e 'remotes::install_version("scales",upgrade="never", version = "1.3.0")' | ||
| RUN Rscript -e 'remotes::install_version("plotly",upgrade="never", version = "4.10.4")' | ||
| RUN Rscript -e 'remotes::install_version("shinyWidgets",upgrade="never", version = "0.8.7")' | ||
| RUN Rscript -e 'remotes::install_version("shinyjs",upgrade="never", version = "2.1.0")' | ||
| RUN Rscript -e 'remotes::install_version("shinydisconnect",upgrade="never", version = "0.1.1")' | ||
| RUN Rscript -e 'remotes::install_version("shinyalert",upgrade="never", version = "3.1.0")' | ||
| RUN Rscript -e 'remotes::install_version("stringr",upgrade="never", version = "1.5.1")' | ||
| RUN Rscript -e 'remotes::install_version("updog",upgrade="never", version = "2.1.5")' | ||
| RUN Rscript -e 'remotes::install_version("AGHmatrix",upgrade="never", version = "2.1.4")' | ||
| RUN Rscript -e 'remotes::install_version("factoextra",upgrade="never", version = "1.0.7")' | ||
| RUN Rscript -e 'remotes::install_version("httr",upgrade="never", version = "1.4.7")' | ||
| RUN Rscript -e 'remotes::install_version("future",upgrade="never", version = "1.34.0")' | ||
| RUN Rscript -e 'remotes::install_version("shinycssloaders",upgrade="never", version = "1.1.0")' | ||
| RUN Rscript -e 'remotes::install_version("RColorBrewer",upgrade="never", version = "1.1.3")' | ||
| RUN Rscript -e 'remotes::install_version("tibble",upgrade="never", version = "3.2.1")' | ||
| RUN Rscript -e 'remotes::install_version("rrBLUP",upgrade="never", version = "4.6.3")' | ||
| RUN Rscript -e 'remotes::install_version("MASS",upgrade="never", version = "7.3.60.2")' | ||
| RUN Rscript -e 'remotes::install_version("Matrix",upgrade="never", version = "1.7.0")' | ||
| RUN Rscript -e 'remotes::install_version("matrixcalc",upgrade="never", version = "1.0.6")' | ||
| RUN Rscript -e 'remotes::install_github("Breeding-Insight/BIGr",upgrade="never")' | ||
| RUN Rscript -e 'remotes::install_github("jendelman/GWASpoly",upgrade="never")' | ||
| # syntax=docker/dockerfile:1.7 | ||
| # Buildx/Actions will pass BASE_IMAGE as a manifest tag that covers both arches | ||
| ARG BASE_IMAGE=docker.io/breedinginsight/bigapp-deps:r4.5-bioc3.21-2025-08 | ||
| FROM ${BASE_IMAGE} | ||
|
|
||
| RUN mkdir /build_zone | ||
| ADD . /build_zone | ||
| WORKDIR /build_zone | ||
| RUN R -e 'remotes::install_local(upgrade="never")' | ||
| RUN rm -rf /build_zone | ||
| EXPOSE 80 | ||
| CMD R -e "options('shiny.port'=80,shiny.host='0.0.0.0');BIGapp::run_app()" | ||
| SHELL ["/bin/bash","-eo","pipefail","-c"] | ||
| ENV DEBIAN_FRONTEND=noninteractive TZ=UTC | ||
| ENV MAKEFLAGS="-j2" R_PKG_INSTALL_ARGS="--no-build-vignettes --no-manual" | ||
|
|
||
| # App install (only your code changes should rebuild this layer) | ||
| WORKDIR /app | ||
| COPY DESCRIPTION /app/ | ||
| # COPY NAMESPACE /app/ # if present, include for better cache hits | ||
| COPY . /app | ||
| RUN R -q -e "remotes::install_local('.', upgrade='never', dependencies=TRUE, \ | ||
| INSTALL_opts=c('--no-build-vignettes','--no-manual'))" | ||
|
|
||
| # Runtime | ||
| RUN useradd -m appuser | ||
| USER appuser | ||
| WORKDIR /app | ||
| EXPOSE 80 | ||
| HEALTHCHECK --interval=30s --timeout=5s --retries=5 \ | ||
| CMD wget -qO- http://localhost:${PORT:-80}/ || exit 1 | ||
| CMD ["R","-q","-e","options(shiny.port=as.integer(Sys.getenv('PORT','80')), shiny.host='0.0.0.0'); BIGapp::run_app()"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # syntax=docker/dockerfile:1.7 | ||
| FROM rocker/r2u:noble | ||
|
|
||
| SHELL ["/bin/bash","-eo","pipefail","-c"] | ||
| ENV DEBIAN_FRONTEND=noninteractive TZ=UTC | ||
| # keep compiles gentle for CI/QEMU | ||
| ENV MAKEFLAGS="-j2" | ||
| ENV R_PKG_INSTALL_ARGS="--no-build-vignettes --no-manual" | ||
|
|
||
| # System libs (no Bioc via apt to avoid ABI/arch mismatches) | ||
| RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
| --mount=type=cache,target=/var/lib/apt/lists,sharing=locked \ | ||
| apt-get update && apt-get install -y --no-install-recommends \ | ||
| build-essential gfortran cmake git wget pkg-config \ | ||
| ccache \ | ||
| libhts-dev \ | ||
| libcurl4-gnutls-dev libssl-dev libxml2-dev \ | ||
| libpng-dev libjpeg-dev libfreetype6-dev libfontconfig1-dev \ | ||
| libbz2-dev liblzma-dev zlib1g-dev \ | ||
| r-cran-remotes r-cran-pak r-cran-biocmanager \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # ccache | ||
| ENV CCACHE_DIR=/root/.cache/ccache | ||
| RUN --mount=type=cache,target=/root/.cache/ccache ccache -M 2G && \ | ||
| { echo 'CC=ccache gcc'; echo 'CXX=ccache g++'; echo 'FC=ccache gfortran'; } >> /usr/lib/R/etc/Makevars.site | ||
|
|
||
| # ---- CRAN via r2u binaries first (fast) ---- | ||
| ENV CRAN_PKGS="adegenet curl DT dplyr vcfR \ | ||
| ggplot2 tidyr shiny config bs4Dash \ | ||
| golem purrr markdown scales plotly \ | ||
| shinyWidgets shinyjs shinydisconnect shinyalert \ | ||
| stringr updog AGHmatrix factoextra \ | ||
| httr future shinycssloaders RColorBrewer \ | ||
| tibble rrBLUP MASS Matrix matrixcalc BIGr" | ||
| RUN install2.r --skipinstalled --ncpus 1 $CRAN_PKGS || true | ||
|
|
||
| # ---- Bioconductor from source (R 4.5 -> Bioc 3.21) ---- | ||
| RUN --mount=type=cache,target=/root/.cache/R/src Rscript - <<'RS' | ||
| options(Ncpus = 2) | ||
| repos <- BiocManager::repositories(version = "3.21") | ||
| options(repos = repos) | ||
| bioc_pkgs <- c("Rsamtools","Biostrings","pwalign","VariantAnnotation") | ||
| for (p in bioc_pkgs) { | ||
| if (!requireNamespace(p, quietly = TRUE)) { | ||
| message("Installing Bioconductor (source): ", p) | ||
| install.packages(p, dependencies = TRUE, type = "source", | ||
| INSTALL_opts = c("--no-build-vignettes","--no-manual")) | ||
| } | ||
| } | ||
| RS | ||
|
|
||
| # ---- Fallback for any missing CRAN pkgs (source, sequential) ---- | ||
| RUN --mount=type=cache,target=/root/.cache/R/src Rscript - <<'RS' | ||
| pkgs <- strsplit(Sys.getenv("CRAN_PKGS"), " +")[[1]] | ||
| miss <- setdiff(pkgs, rownames(installed.packages())) | ||
| if (length(miss)) { | ||
| message("Installing remaining CRAN from source: ", paste(miss, collapse=", ")) | ||
| for (p in miss) { | ||
| install.packages(p, repos="https://cloud.r-project.org", type="source", | ||
| INSTALL_opts=c("--no-build-vignettes","--no-manual")) | ||
| } | ||
| } | ||
| RS | ||
|
|
||
| # ---- GitHub dep (pak-free to avoid QEMU helper issues) ---- | ||
| RUN R -q -e "remotes::install_github('jendelman/GWASpoly', upgrade='never', dependencies=TRUE, \ | ||
| INSTALL_opts=c('--no-build-vignettes','--no-manual'))" | ||
|
|
||
| # Version snapshot (handy for audits) | ||
| RUN R -q -e "pkgs <- c('adegenet','curl','DT','dplyr','vcfR','ggplot2','tidyr','shiny','config','bs4Dash', \ | ||
| 'golem','purrr','markdown','scales','plotly','shinyWidgets','shinyjs','shinydisconnect','shinyalert', \ | ||
| 'stringr','updog','AGHmatrix','factoextra','httr','future','shinycssloaders','RColorBrewer', \ | ||
| 'tibble','rrBLUP','MASS','Matrix','matrixcalc','BIGr', \ | ||
| 'Rsamtools','VariantAnnotation','Biostrings','pwalign'); \ | ||
| ip <- installed.packages(); dir.create('/opt/pins', recursive=TRUE, showWarnings=FALSE); \ | ||
| write.table(data.frame(Package=pkgs, Version=ip[pkgs,'Version']), \ | ||
| file='/opt/pins/deps_versions.tsv', sep='\t', row.names=FALSE, quote=FALSE)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this requiring that the VCF file be compressed for the analysis to run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be OK to use a compressed or uncompressed file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, both are allowed, but there was a bug with our example uncompressed VCF because it has less/equal 100 markers, the same/less amount than the subsetting for testing. Bug fixed.
The check will only break if the file has the .gz but it is not compressed or the opposite, or if it has non compatible compression (bz2 or .xz)