-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from boasvdp/add_actions
Add actions
- Loading branch information
Showing
6 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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,17 @@ | ||
name: Build and release | ||
on: | ||
push: | ||
branches: main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
bump-version: | ||
name: Release version | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v3 | ||
id: release | ||
with: | ||
release-type: python | ||
package-name: assembly_snptyper |
This file contains 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,27 @@ | ||
name: assembly_snptyper test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: ubuntu-latest} | ||
name: Testing assembly_snptyper ${{ matrix.config.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Conda environment with Micromamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
cache-environment: true | ||
environment-file: env.yaml | ||
- name: Conda list | ||
shell: bash -l {0} | ||
run: conda list | ||
- name: Test M1UK typing end-to-end | ||
shell: bash -l {0} | ||
run: bash tests/test_e2e.sh |
This file contains 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 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 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,34 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
TEST_DATA_DIR=tests/tmp | ||
|
||
# Download | ||
mkdir -p "$TEST_DATA_DIR" | ||
## M1UK strain from Lynskey et al. | ||
curl --output "$TEST_DATA_DIR"/GCA_034818825.1.zip "https://api.ncbi.nlm.nih.gov/datasets/v2alpha/genome/accession/GCA_034818825.1/download?include_annotation_type=GENOME_FASTA&hydrated=FULLY_HYDRATED" | ||
## M1global strain from Lynskey et al. | ||
curl --output "$TEST_DATA_DIR"/GCA_034822885.1.zip "https://api.ncbi.nlm.nih.gov/datasets/v2alpha/genome/accession/GCA_034822885.1/download?include_annotation_type=GENOME_FASTA&hydrated=FULLY_HYDRATED" | ||
|
||
# Unzip | ||
unzip -n "$TEST_DATA_DIR"/GCA_034818825.1.zip -d "$TEST_DATA_DIR" | ||
unzip -n "$TEST_DATA_DIR"/GCA_034822885.1.zip -d "$TEST_DATA_DIR" | ||
|
||
# List genomes | ||
find "$TEST_DATA_DIR" -iname "*.fna" -print > "$TEST_DATA_DIR"/test_genomes.txt | ||
|
||
# Install the script | ||
python -m pip install . | ||
|
||
# Run the script | ||
assembly_snptyper \ | ||
--list_input "$TEST_DATA_DIR"/test_genomes.txt \ | ||
--vcf data/M1UK.vcf \ | ||
--reference data/MGAS5005.fa \ | ||
-p 2 > "$TEST_DATA_DIR"/test_output.txt | ||
|
||
# Check the output | ||
cmp <(sort "$TEST_DATA_DIR"/test_output.txt) <(sort tests/test_expected_output.txt) | ||
|
||
rm -rf "$TEST_DATA_DIR" |
This file contains 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,3 @@ | ||
sample matching_variants wt_variants variants_in_scheme variants_missing variants_multiple_cov | ||
GCA_034818825.1_PDT001921168.1_genomic 27 0 27 0 0 | ||
GCA_034822885.1_PDT001920952.1_genomic 0 27 27 0 0 |