Skip to content

Commit 862d13f

Browse files
committed
version for 3.2
1 parent 9fbe724 commit 862d13f

27 files changed

+159
-141
lines changed

.github/workflows/createrelease.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@ jobs:
5757
steps:
5858
- name: Checkout code
5959
uses: actions/checkout@v4
60-
- name: Version the Container
61-
# this removes the :*_latest tag and replaces with versioned container
62-
run: |
63-
for i in harpy/snakefiles/*.smk; do
64-
sed -i "s/_latest/_${{ github.ref_name }}/g" $i
65-
done
66-
- name: Bump Harpy Version
67-
# this removes the :latest tag and replaces with versioned container
68-
run: |
69-
sed -i "s/0\.0\.0/${{ github.ref_name }}/g" harpy/__main__.py
70-
sed -i "s/0\.0\.0/${{ github.ref_name }}/g" pyproject.toml
7160
- name: Build project
7261
# This builds the release tarball, stripped of unneccessary things
7362
run: |

harpy/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from harpy.commands import snp, sv
1717
from harpy.commands import template
1818
from harpy.commands import validate
19+
from harpy.common.version import VERSION
1920

2021
config = click.RichHelpConfiguration(
2122
max_width=80,
@@ -34,7 +35,7 @@
3435

3536
@click.group(options_metavar='', context_settings={"help_option_names" : []} )
3637
@click.rich_config(config)
37-
@click.version_option("0.0.0", prog_name="harpy", hidden = True)
38+
@click.version_option(f"{VERSION}", prog_name="harpy", hidden = True)
3839
@click.command_panel(
3940
"Data Processing",
4041
panel_styles={"border_style": "blue"},

harpy/commands/environments.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
from harpy.common.workflow import Workflow
99

1010
@click.command(hidden = True)
11-
def containerize():
11+
@click.argument('env', required = True, type= click.Choice(["all", "align", "assembly", "metassembly", "phase", "qc", "report", "simulations", "stitch", "variants"]))
12+
def containerize(env):
1213
"""
1314
Configure the harpy container
1415
1516
**INTERNAL USE ONLY**. Used to recreate all the conda environments required
1617
by the workflows and build a dockerfile from that.
1718
"""
18-
create_pixi_dockerfiles()
19+
create_pixi_dockerfiles(env)
1920

2021
@click.group(options_metavar='')
2122
def deps():

harpy/common/create_pixi.py

Lines changed: 86 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,77 +3,10 @@
33
import shutil
44
import subprocess
55
import os
6-
7-
environ = {
8-
"align" : [
9-
"bwa-mem2",
10-
"bwa",
11-
"samtools==1.22",
12-
"seqtk",
13-
"strobealign",
14-
"tabix"
15-
],
16-
"assembly" : [
17-
"arcs",
18-
"bwa",
19-
"cloudspades",
20-
"links",
21-
"quast",
22-
"busco",
23-
"samtools",
24-
"tigmint"
25-
],
26-
"deconvolution" : [
27-
"quickdeconvolution"
28-
],
29-
30-
"demultiplex": [
31-
"dmox>=0.2"
32-
],
33-
"metassembly": [
34-
"athena_meta==1.2"
35-
],
36-
"phase" : [
37-
"hapcut2",
38-
"whatshap"
39-
],
40-
"qc" : [
41-
"click==8.2.1",
42-
"falco==1.2.5",
43-
"fastp",
44-
"multiqc==1.30",
45-
"pysam==0.23"
46-
],
47-
"report" : [
48-
"quarto",
49-
"r-dt",
50-
"r-dplyr",
51-
"r-highcharter",
52-
"r-magrittr",
53-
"r-plotly",
54-
"r-scales",
55-
"r-tidyr",
56-
"r-viridislite",
57-
"r-xml2",
58-
"r-biocircos"
59-
],
60-
"simulations" : [
61-
"simug>=1.0.1"
62-
],
63-
"stitch" : [
64-
"r-stitch>=1.8.4"
65-
],
66-
"variants" : [
67-
"bcftools==1.22",
68-
"freebayes==1.3.9",
69-
"leviathan",
70-
"naibr-plus",
71-
"setuptools"
72-
]
73-
}
6+
from harpy.common.version import VERSION
747

758
dockerfile_text = """
76-
FROM ghcr.io/prefix-dev/pixi:0.56.0 AS build
9+
FROM ghcr.io/prefix-dev/pixi:0.62.0 AS build
7710
7811
# copy source code, pixi.toml and pixi.lock to the container
7912
WORKDIR /app
@@ -96,12 +29,84 @@
9629
ENTRYPOINT ["/app/entrypoint.sh"]
9730
"""
9831

99-
def create_pixi_dockerfiles():
32+
def create_pixi_dockerfiles(env):
10033
'''
10134
Using the defined environments, create a series of folders where each has a dockerfile
10235
and pixi.toml file to create one of the environments.
10336
'''
10437
shutil.rmtree("container", ignore_errors=True)
38+
39+
environ = {
40+
"align" : [
41+
"bwa-mem2",
42+
"bwa",
43+
"samtools==1.22",
44+
"seqtk",
45+
"strobealign",
46+
"tabix"
47+
],
48+
"assembly" : [
49+
"arcs",
50+
"bwa",
51+
"cloudspades",
52+
"links",
53+
"quast",
54+
"busco",
55+
"samtools",
56+
"tigmint"
57+
],
58+
"deconvolution" : [
59+
"quickdeconvolution"
60+
],
61+
62+
"demultiplex": [
63+
"dmox>=0.2"
64+
],
65+
"metassembly": [
66+
"athena_meta==1.2"
67+
],
68+
"phase" : [
69+
"hapcut2",
70+
"whatshap"
71+
],
72+
"qc" : [
73+
"click==8.2.1",
74+
"falco==1.2.5",
75+
"fastp",
76+
"multiqc==1.30",
77+
"pysam==0.23"
78+
],
79+
"report" : [
80+
"quarto",
81+
"r-dt",
82+
"r-dplyr",
83+
"r-highcharter",
84+
"r-magrittr",
85+
"r-plotly",
86+
"r-scales",
87+
"r-tidyr",
88+
"r-viridislite",
89+
"r-xml2",
90+
"r-biocircos"
91+
],
92+
"simulations" : [
93+
"simug>=1.0.1"
94+
],
95+
"stitch" : [
96+
"r-stitch>=1.8.4"
97+
],
98+
"variants" : [
99+
"bcftools==1.22",
100+
"freebayes==1.3.9",
101+
"leviathan",
102+
"naibr-plus",
103+
"setuptools"
104+
]
105+
}
106+
107+
if env != "all":
108+
environ = {env: environ.get(env)}
109+
105110
for env,deps in environ.items():
106111
os.makedirs(f"container/{env}", exist_ok=True)
107112
with open(f"container/{env}/Dockerfile", "w") as dockerfile:
@@ -117,8 +122,19 @@ def create_pixi_dockerfiles():
117122
check = True
118123
)
119124

125+
with open(f"container/{env}/pixi.toml", "r") as toml:
126+
with open(f"container/{env}/pixi.fix.toml", "w") as out:
127+
for line in toml:
128+
if line.startswith("version"):
129+
line = f"version = \"{VERSION}\"\n"
130+
out.write(line)
131+
132+
os.remove(f"container/{env}/pixi.toml")
133+
shutil.copy2(f"container/{env}/pixi.fix.toml", f"container/{env}/pixi.toml")
134+
120135
subprocess.run(
121136
["pixi", "add", "--no-progress", "--manifest-path", f"container/{env}/pixi.toml", *deps],
122137
check = True
123138
)
139+
124140
shutil.rmtree("container/.pixi", ignore_errors=True)

harpy/common/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VERSION=3.2

harpy/scripts/version_harpy.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /usr/bin/env bash
2+
3+
# this removes the :*_latest tag and replaces with versioned container
4+
for i in harpy/snakefiles/*.smk; do
5+
sed -i "s/_latest/_${1}/g" $i
6+
done
7+
8+
# this removes the :latest tag and replaces with versioned container
9+
sed -i "s/-dev//g" harpy/common/version.py
10+
sed -i "s/-dev//g" pyproject.toml

harpy/snakefiles/align_bwa.smk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ rule preprocess_reference:
4242
conda:
4343
"envs/align.yaml"
4444
container:
45-
"docker://pdimens/harpy:align_latest"
45+
"docker://pdimens/harpy:align_3.2"
4646
shell:
4747
"""
4848
{{
@@ -100,7 +100,7 @@ rule align:
100100
conda:
101101
"envs/align.yaml"
102102
container:
103-
"docker://pdimens/harpy:align_latest"
103+
"docker://pdimens/harpy:align_3.2"
104104
shell:
105105
"""
106106
{{
@@ -239,7 +239,7 @@ rule sample_reports:
239239
conda:
240240
"envs/report.yaml"
241241
container:
242-
"docker://pdimens/harpy:report_latest"
242+
"docker://pdimens/harpy:report_3.2"
243243
retries:
244244
3
245245
shell:
@@ -296,7 +296,7 @@ rule samtools_report:
296296
conda:
297297
"envs/qc.yaml"
298298
container:
299-
"docker://pdimens/harpy:qc_latest"
299+
"docker://pdimens/harpy:qc_3.2"
300300
shell:
301301
"multiqc {params} > {output} 2> {log}"
302302

@@ -316,7 +316,7 @@ rule barcode_report:
316316
conda:
317317
"envs/report.yaml"
318318
container:
319-
"docker://pdimens/harpy:report_latest"
319+
"docker://pdimens/harpy:report_3.2"
320320
retries:
321321
3
322322
shell:

harpy/snakefiles/align_strobe.smk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ rule align:
7979
conda:
8080
"envs/align.yaml"
8181
container:
82-
"docker://pdimens/harpy:align_latest"
82+
"docker://pdimens/harpy:align_3.2"
8383
shell:
8484
"""
8585
{{
@@ -218,7 +218,7 @@ rule sample_reports:
218218
conda:
219219
"envs/report.yaml"
220220
container:
221-
"docker://pdimens/harpy:report_latest"
221+
"docker://pdimens/harpy:report_3.2"
222222
retries:
223223
3
224224
shell:
@@ -275,7 +275,7 @@ rule samtools_report:
275275
conda:
276276
"envs/qc.yaml"
277277
container:
278-
"docker://pdimens/harpy:qc_latest"
278+
"docker://pdimens/harpy:qc_3.2"
279279
shell:
280280
"multiqc {params} > {output} 2> {log}"
281281

@@ -295,7 +295,7 @@ rule barcode_report:
295295
conda:
296296
"envs/report.yaml"
297297
container:
298-
"docker://pdimens/harpy:report_latest"
298+
"docker://pdimens/harpy:report_3.2"
299299
retries:
300300
3
301301
shell:

harpy/snakefiles/assembly.smk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ rule cloudspades:
4545
conda:
4646
"envs/assembly.yaml"
4747
container:
48-
"docker://pdimens/harpy:assembly_latest"
48+
"docker://pdimens/harpy:assembly_3.2"
4949
threads:
5050
workflow.cores
5151
resources:
@@ -100,7 +100,7 @@ rule scaffolding:
100100
conda:
101101
"envs/assembly.yaml"
102102
container:
103-
"docker://pdimens/harpy:assembly_latest"
103+
"docker://pdimens/harpy:assembly_3.2"
104104
shell:
105105
"""
106106
arcs-make arcs-tigmint -C {params} 2> {log}
@@ -126,7 +126,7 @@ rule QUAST_assessment:
126126
conda:
127127
"envs/assembly.yaml"
128128
container:
129-
"docker://pdimens/harpy:assembly_latest"
129+
"docker://pdimens/harpy:assembly_3.2"
130130
shell:
131131
"quast.py --threads {threads} --pe12 {input.fastq} {params} {input.contigs} {input.scaffolds} 2> {log}"
132132

@@ -148,7 +148,7 @@ rule BUSCO_analysis:
148148
conda:
149149
"envs/assembly.yaml"
150150
container:
151-
"docker://pdimens/harpy:assembly_latest"
151+
"docker://pdimens/harpy:assembly_3.2"
152152
shell:
153153
"( busco -f -i {input} -c {threads} -m genome {params} > {log} 2>&1 ) || touch {output}"
154154

@@ -166,7 +166,7 @@ rule build_report:
166166
conda:
167167
"envs/qc.yaml"
168168
container:
169-
"docker://pdimens/harpy:qc_latest"
169+
"docker://pdimens/harpy:qc_3.2"
170170
shell:
171171
"multiqc {params} {input} > {output} 2> {log}"
172172

harpy/snakefiles/deconvolve.smk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ rule deconvolve:
5050
conda:
5151
"envs/deconvolution.yaml"
5252
container:
53-
"docker://pdimens/harpy:deconvolution_latest"
53+
"docker://pdimens/harpy:deconvolution_3.2"
5454
shell:
5555
"QuickDeconvolution -t {threads} -i {input} -o {output} {params} > {log} 2>&1"
5656

0 commit comments

Comments
 (0)