Skip to content
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

18 hotfixes for new containerization and versioning #19

Merged
merged 4 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ jobs:
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ctbushman/sbx_mapping
images: sunbeam-labs/sbx_mapping

- name: Build and push Docker image
uses: docker/build-push-action@v5
Expand All @@ -75,6 +75,7 @@ jobs:
test-apptainer:
name: Apptainer Test
runs-on: ubuntu-latest
needs: build-and-push-to-dockerhub

steps:
- name: Checkout Code
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.0
0.0.1
30 changes: 22 additions & 8 deletions sbx_mapping.smk
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# -*- mode: Snakemake -*-

import sys
import os
from pathlib import Path


def get_mapping_path() -> Path:
for fp in sys.path:
if fp.split("/")[-1] == "sbx_mapping":
return Path(fp)
raise Error(
"Filepath for sbx_mapping not found, are you sure it's installed under extensions/sbx_mapping?"
)


SBX_MAPPING_VERSION = open(get_mapping_path() / "VERSION").read().strip()

try:
GenomeFiles
Expand Down Expand Up @@ -79,7 +93,7 @@ rule build_genome_index:
conda:
"envs/sbx_mapping_env.yml"
container:
"docker://ctbushman/sbx_mapping:0.0.0"
f"docker://sunbeam-labs/sbx_mapping:{SBX_MAPPING_VERSION}"
shell:
"cd {Cfg[sbx_mapping][genomes_fp]} && bwa index {input} 2>&1 | tee {log}"

Expand All @@ -100,7 +114,7 @@ rule align_to_genome:
conda:
"envs/sbx_mapping_env.yml"
container:
"docker://ctbushman/sbx_mapping:0.0.0"
f"docker://sunbeam-labs/sbx_mapping:{SBX_MAPPING_VERSION}"
shell:
"""
bwa mem -M -t {threads} \
Expand All @@ -124,7 +138,7 @@ rule samtools_convert:
conda:
"envs/sbx_mapping_env.yml"
container:
"docker://ctbushman/sbx_mapping:0.0.0"
f"docker://sunbeam-labs/sbx_mapping:{SBX_MAPPING_VERSION}"
shell:
"""
samtools view -@ {threads} -b {Cfg[sbx_mapping][samtools_opts]} {input} 2>&1 | tee {log.view_log} | \
Expand All @@ -143,7 +157,7 @@ rule filter_aln_quality:
conda:
"envs/sbx_mapping_env.yml"
container:
"docker://ctbushman/sbx_mapping:0.0.0"
f"docker://sunbeam-labs/sbx_mapping:{SBX_MAPPING_VERSION}"
script:
"scripts/filter_aln_quality.py"

Expand All @@ -160,7 +174,7 @@ rule samtools_index:
conda:
"envs/sbx_mapping_env.yml"
container:
"docker://ctbushman/sbx_mapping:0.0.0"
f"docker://sunbeam-labs/sbx_mapping:{SBX_MAPPING_VERSION}"
shell:
"samtools index {input} {output} 2>&1 | tee {log}"

Expand All @@ -183,7 +197,7 @@ rule get_sliding_coverage:
conda:
"envs/sbx_mapping_env.yml"
container:
"docker://ctbushman/sbx_mapping:0.0.0"
f"docker://sunbeam-labs/sbx_mapping:{SBX_MAPPING_VERSION}"
script:
"scripts/get_sliding_coverage.py"

Expand Down Expand Up @@ -222,7 +236,7 @@ rule get_coverage_filtered:
conda:
"envs/sbx_mapping_env.yml"
container:
"docker://ctbushman/sbx_mapping:0.0.0"
f"docker://sunbeam-labs/sbx_mapping:{SBX_MAPPING_VERSION}"
script:
"scripts/samtools_get_coverage.py"

Expand Down Expand Up @@ -252,7 +266,7 @@ rule summarize_num_mapped_reads:
conda:
"envs/sbx_mapping_env.yml"
container:
"docker://ctbushman/sbx_mapping:0.0.0"
f"docker://sunbeam-labs/sbx_mapping:{SBX_MAPPING_VERSION}"
shell:
"""
samtools idxstats {input} | (sed 's/^/{wildcards.sample}\t/') > {output}
Expand Down
1 change: 1 addition & 0 deletions scripts/filter_aln_quality.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# from scripts.filter_aln_quality_f import filter_bam_alignments
import pysam
import re

Expand Down
Loading