diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4440d00..bfbd1bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,29 +22,8 @@ jobs: - name: Run setup script shell: pixi exec --spec sed -- bash -e {0} - run: | - sed -i "s?main?${{ github.event.pull_request.head.ref }}?g" pixi-setup.sh - sed -i "s?init.sh | bash?init.sh | sed 's,main,${{ github.event.pull_request.head.ref }},g' | bash?" pixi-setup.sh - printf "\n1\n" | ./pixi-setup.sh - - osx-64: - runs-on: macos-13 - strategy: - fail-fast: false - - steps: - - name: Checkout pull request branch - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup pixi - uses: prefix-dev/setup-pixi@v0.8.3 - with: - run-install: false - - - name: Run setup script - shell: pixi exec --spec sed -- zsh -e {0} + env: + INSTALL_TYPE: full run: | sed -i "s?main?${{ github.event.pull_request.head.ref }}?g" pixi-setup.sh sed -i "s?init.sh | bash?init.sh | sed 's,main,${{ github.event.pull_request.head.ref }},g' | bash?" pixi-setup.sh @@ -68,7 +47,9 @@ jobs: - name: Run setup script shell: pixi exec --spec sed -- zsh -e {0} + env: + INSTALL_TYPE: full run: | sed -i "s?main?${{ github.event.pull_request.head.ref }}?g" pixi-setup.sh sed -i "s?init.sh | bash?init.sh | sed 's,main,${{ github.event.pull_request.head.ref }},g' | bash?" pixi-setup.sh - printf "\n1\n" | ./pixi-setup.sh \ No newline at end of file + printf "\n1\n" | ./pixi-setup.sh diff --git a/.github/workflows/dispatch_ci.yml b/.github/workflows/dispatch_ci.yml index eeb3d6e..a7def8d 100644 --- a/.github/workflows/dispatch_ci.yml +++ b/.github/workflows/dispatch_ci.yml @@ -27,29 +27,6 @@ jobs: sed -i "s?init.sh | bash?init.sh | sed 's,StatFunGen/pixi-setup/main,${{ github.repository }}/${{ github.ref_name }},g' | bash?" pixi-setup.sh printf "\n1\n" | ./pixi-setup.sh - osx-64_pixi: - runs-on: macos-latest - strategy: - fail-fast: false - - steps: - - name: Checkout pull request branch - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup pixi - uses: prefix-dev/setup-pixi@v0.8.3 - with: - run-install: false - - - name: Run setup script - shell: pixi exec --spec sed -- bash -e {0} - run: | - sed -i "s?StatFunGen/pixi-setup/main?${{ github.repository }}/${{ github.ref_name }}?g" pixi-setup.sh - sed -i "s?init.sh | bash?init.sh | sed 's,StatFunGen/pixi-setup/main,${{ github.repository }}/${{ github.ref_name }},g' | bash?" pixi-setup.sh - printf "\n1\n" | ./pixi-setup.sh - osx-arm64_pixi: runs-on: macos-14 strategy: @@ -71,4 +48,4 @@ jobs: run: | sed -i "s?StatFunGen/pixi-setup/main?${{ github.repository }}/${{ github.ref_name }}?g" pixi-setup.sh sed -i "s?init.sh | bash?init.sh | sed 's,StatFunGen/pixi-setup/main,${{ github.repository }}/${{ github.ref_name }},g' | bash?" pixi-setup.sh - printf "\n1\n" | ./pixi-setup.sh \ No newline at end of file + printf "\n1\n" | ./pixi-setup.sh diff --git a/envs/full_packages.txt b/envs/full_packages.txt index c65d453..5f7ddff 100644 --- a/envs/full_packages.txt +++ b/envs/full_packages.txt @@ -128,11 +128,11 @@ sos-r bioconductor-annotationdbi bioconductor-clusterprofiler bioconductor-edger +bioconductor-genomeinfodb +bioconductor-genomeinfodbdata bioconductor-illuminahumanmethylation450kmanifest bioconductor-illuminahumanmethylationepicmanifest -bioconductor-impute bioconductor-limma -bioconductor-minfi bioconductor-mofa2 bioconductor-org.hs.eg.db bioconductor-pcatools @@ -142,6 +142,7 @@ bioconductor-qvalue bioconductor-sesame bioconductor-sesamedata r-abind +r-argparser r-arrow r-ape r-bedtoolsr diff --git a/init.sh b/init.sh index be91659..635977c 100755 --- a/init.sh +++ b/init.sh @@ -51,10 +51,3 @@ else code-server --install-extension ionutvmi.path-autocomplete code-server --install-extension usernamehw.errorlens fi - -# Temporary fix to run post-link scripts (only present in full install with bioconductor packages) -if [ -f "${PIXI_HOME}/envs/r-base/bin/.bioconductor-genomeinfodbdata-post-link.sh" ]; then - bash -c "PREFIX=${PIXI_HOME}/envs/r-base PATH=${PIXI_HOME}/envs/r-base/bin:${PATH} .bioconductor-genomeinfodbdata-post-link.sh" -fi -find ${PIXI_HOME}/envs/r-base/bin -name '*bioconductor-*-post-link.sh' | \ -xargs -I % bash -c "PREFIX=${PIXI_HOME}/envs/r-base PATH=${PIXI_HOME}/envs/r-base/bin:${PATH} %" diff --git a/pixi-setup.sh b/pixi-setup.sh index 68d7c9c..6d266de 100755 --- a/pixi-setup.sh +++ b/pixi-setup.sh @@ -30,7 +30,7 @@ install_global_packages() { missing_pkgs=$(comm -13 <(echo "$existing_pkgs" | sort -u) <(sort -u ${package_list})) if (($(echo ${missing_pkgs} | wc -w) > 0 )); then - pixi global install $(echo ${missing_pkgs} | tr '\n' ' ') + pixi global install --run-post-link-scripts $(echo ${missing_pkgs} | tr '\n' ' ') fi } @@ -48,7 +48,7 @@ inject_packages() { fi if (( $(echo ${missing_pkgs} | wc -w) > 0 )); then - pixi global install --environment ${environment} $(echo ${missing_pkgs} | tr '\n' ' ') + pixi global install --run-post-link-scripts --environment ${environment} $(echo ${missing_pkgs} | tr '\n' ' ') fi } @@ -74,21 +74,36 @@ export PIXI_HOME="${_user_pixi_home:-${_default_pixi_home}}" export RATTLER_CACHE_DIR="${PIXI_HOME}/cache" echo "Using PIXI_HOME=${PIXI_HOME}" -# --- Prompt: install type --- -echo "" -echo "Choose installation type:" -echo " 1) minimal - Essential CLI tools + Python data science + base R" -echo " ~5 GB, ~100k files" -echo " 2) full - Complete bioinformatics environment (samtools, GATK, plink," -echo " STAR, Seurat, bioconductor packages, etc.)" -echo " ~35 GB, ~350k files" -echo "" -read -r -p "Install type [1=minimal, 2=full, default=1]: " _install_type_input -case "${_install_type_input:-1}" in - 2|full) INSTALL_TYPE="full" ;; - *) INSTALL_TYPE="minimal" ;; -esac -echo "Installation type: ${INSTALL_TYPE}" +# --- Install type --- +# Allow a preset INSTALL_TYPE env var to override the prompt (e.g. for +# non-interactive runs). A set-but-invalid value is a hard error. +if [[ -n "${INSTALL_TYPE:-}" ]]; then + case "$(echo "${INSTALL_TYPE}" | tr '[:upper:]' '[:lower:]')" in + 2|full) INSTALL_TYPE="full" ;; + 1|minimal) INSTALL_TYPE="minimal" ;; + *) + echo "ERROR: invalid INSTALL_TYPE='${INSTALL_TYPE}' (expected 'minimal'/'1' or 'full'/'2')" >&2 + exit 1 + ;; + esac + echo "Installation type: ${INSTALL_TYPE} (from INSTALL_TYPE environment variable)" +else + # --- Prompt: install type --- + echo "" + echo "Choose installation type:" + echo " 1) minimal - Essential CLI tools + Python data science + base R" + echo " ~5 GB, ~100k files" + echo " 2) full - Complete bioinformatics environment (samtools, GATK, plink," + echo " STAR, Seurat, bioconductor packages, etc.)" + echo " ~35 GB, ~350k files" + echo "" + read -r -p "Install type [1=minimal, 2=full, default=1]: " _install_type_input + case "${_install_type_input:-1}" in + 2|full) INSTALL_TYPE="full" ;; + *) INSTALL_TYPE="minimal" ;; + esac + echo "Installation type: ${INSTALL_TYPE}" +fi # Ensure PIXI_HOME exists mkdir -p "${PIXI_HOME}"