Skip to content

Commit

Permalink
try to cache image
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimens committed May 6, 2024
1 parent 87e8810 commit 74e085e
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ jobs:
python3 -m pip install --upgrade build && python3 -m build
pip install dist/*.whl
resources/buildforCI.sh
- name: Clear space
run: rm -rf /opt/hostedtoolcache
- name: pull image
shell: micromamba-shell {0}
run: snakemake -s resources/container/pullcontainerCI.smk --sdm conda apptainer -q
- name: upload singularity
uses: actions/upload-artifact@v4
with:
name: deps-image
path: .snakemake/singularity

dmux_gen1:
needs: [changes, pkgbuild]
Expand Down Expand Up @@ -99,6 +109,10 @@ jobs:
resources/buildforCI.sh
- name: Clear space
run: rm -rf /opt/hostedtoolcache
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: deps-image
- name: harpy demultiplex
shell: micromamba-shell {0}
run: harpy demultiplex gen1 --schema test/demux/samples.schema test/demux/Undetermined_S0_L004_R* test/demux/Undetermined_S0_L004_I*
Expand Down
63 changes: 63 additions & 0 deletions resources/container/pullcontainerCI.smk
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
containerized: "docker://pdimens/harpy:latest"

import os
import shutil

condachannels = ["bioconda","conda-forge","defaults"]
environ = {
"qc" : ["bioconda::falco", "bioconda::fastp", "bioconda::multiqc", "bioconda::pysam=0.22"],
"align": ["bioconda::bwa", "bioconda::ema","conda-forge::icu","conda-forge::libzlib", "bioconda::minimap2", "bioconda::samtools=1.20", "bioconda::seqtk", "bioconda::tabix", "conda-forge::xz"],
"snp": ["bioconda::bcftools=1.20", "bioconda::freebayes=1.3.6"],
"sv": ["bioconda::leviathan", "bioconda::naibr-plus"],
"phase" : ["bioconda::hapcut2", "bioconda::whatshap"],
"simulations" : ["conda-forge::perl", "bioconda::perl-math-random", "bioconda::perl-inline-c", "bioconda::perl-parse-recdescent", "conda-forge::numpy", "bioconda::dwgsim", "alienzj::msort"],
"r" : ["conda-forge::r-xml2", "bioconda::bioconductor-complexheatmap", "conda-forge::r-highcharter", "conda-forge::r-circlize", "r::r-biocircos", "conda-forge::r-dt", "conda-forge::r-flexdashboard", "conda-forge::r-ggplot2", "conda-forge::r-ggridges", "conda-forge::r-plotly", "conda-forge::r-tidyr", "bioconda::r-stitch"]
}
os.makedirs(os.getcwd() + ".harpy_envs", exist_ok = True)
for i in environ:
# overwrites existing
with open(os.getcwd() + f"/.harpy_envs/{i}.yaml", "w") as yml:
yml.write(f"name: {i}\n")
yml.write("channels:\n - ")
yml.write("\n - ".join(condachannels))
yml.write("\ndependencies:\n - ")
yml.write("\n - ".join(environ[i]) + "\n")

rule all:
input:
collect("{conda}.env", conda = ["qc","align","snp","sv","phase","r","simulations"])

rule qc:
output: "qc.env"
conda: os.getcwd() + "/.harpy_envs/qc.yaml"
shell: "touch {output}"

rule align:
output: "align.env"
conda: os.getcwd() + "/.harpy_envs/align.yaml"
shell: "touch {output}"

rule snp:
output: "snp.env"
conda: os.getcwd() + "/.harpy_envs/snp.yaml"
shell: "touch {output}"

rule sv:
output: "sv.env"
conda: os.getcwd() + "/.harpy_envs/sv.yaml"
shell: "touch {output}"

rule phase:
output: "phase.env"
conda: os.getcwd() + "/.harpy_envs/phase.yaml"
shell: "touch {output}"

rule r_env:
output: "r.env"
conda: os.getcwd() + "/.harpy_envs/r.yaml"
shell: "touch {output}"

rule simulations:
output: "simulations.env"
conda: os.getcwd() + "/.harpy_envs/simulations.yaml"
shell: "touch {output}"

0 comments on commit 74e085e

Please sign in to comment.