Skip to content

Merge pull request #9 from boasvdp/add_release_please #37

Merge pull request #9 from boasvdp/add_release_please

Merge pull request #9 from boasvdp/add_release_please #37

Workflow file for this run

# This is a basic workflow to test the software
name: main
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
with:
repository: boasvdp/extract_genes_ABRicate
path: extract_genes_ABRicate
# - name: conda
# run: |
# cd $GITHUB_WORKSPACE/extract_genes_ABRicate
# conda env create -f env.yaml
- name: enter repo folder
run : |
cd $GITHUB_WORKSPACE/extract_genes_ABRicate
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
environment-file: env.yaml
mamba-version: "*"
- name: test extract_genes_ABRicate
run: |
echo "CONDA_DEFAULT_ENV: $CONDA_DEFAULT_ENV"
python extract_genes_abricate.py --help
# Test with a path
python extract_genes_abricate.py -a test/input/test.tsv -g test/genomes -o test/out -s .fasta
cmp test/correct/correct_blaCTX-M-15.out test/out/input_blaCTX-M-15.out
cmp test/correct/correct_blaCTX-M-15_2.out test/out/input_blaCTX-M-15_2.out
# Testing without a path
python extract_genes_abricate.py -a test/input/test_nopath.tsv -g test/genomes -o test/out_nopath -s .fasta
cmp test/correct/correct_blaCTX-M-15.out test/out_nopath/input_blaCTX-M-15.out
cmp test/correct/correct_blaCTX-M-15_2.out test/out_nopath/input_blaCTX-M-15_2.out
# Testing on csv
python extract_genes_abricate.py -a test/input/test.csv -g test/genomes -o test/out_csv -s .fasta --csv
cmp test/correct/correct_blaCTX-M-15.out test/out_csv/input_blaCTX-M-15.out
cmp test/correct/correct_blaCTX-M-15_2.out test/out_csv/input_blaCTX-M-15_2.out
# Testing for gene cluster
python extract_genes_abricate.py -a test/input/test.tsv -g test/genomes -o test/out_genecluster -s .fasta --genecluster
cmp test/correct/correct_genecluster.fasta test/out_genecluster/input_ncbi.out
# Testing with flanking sequences
python extract_genes_abricate.py -a test/input/flanking.tsv -g test/genomes -o test/out_flanking_5bp --flanking --flanking-bp 5
cmp test/correct/correct_flanking_5bp.out test/out_flanking_5bp/flanking_blaCTX-M-15.out
# Testing with flanking sequences which run off the contig end
python extract_genes_abricate.py -a test/input/flanking.tsv -g test/genomes -o test/out_flanking_15bp --flanking --flanking-bp 15
cmp test/correct/correct_flanking_15bp.out test/out_flanking_15bp/flanking_blaCTX-M-15.out
# Test with empty file
python extract_genes_abricate.py -a test/input/test_empty.tsv -g test/genomes -o test/out_empty
- name: Tests with combined ABRicate files from multiple genomes
run: |
# Normal gene extraction should work for files with multiple genomes
python extract_genes_abricate.py -a test/input/test_multiple.tsv -g test/genomes -o test/out_multiple
cmp test/correct/correct_multiple_strainA_blaCTX-M-15.out test/out_multiple/strainA_blaCTX-M-15.out
cmp test/correct/correct_multiple_strainB_blaCTX-M-15.out test/out_multiple/strainB_blaCTX-M-15.out
# Gene cluster extraction should still fail for files with multiple genomes
! python extract_genes_abricate.py -a test/input/test_multiple.tsv -g test/genomes -o test/out_multiple_genecluster --genecluster