From 4c9454291d509bb0edd51b321f60840ece9ff59b Mon Sep 17 00:00:00 2001 From: Keshav Date: Tue, 14 May 2024 15:02:12 -0500 Subject: [PATCH] Updated test config files and automated unit tests. --- .github/workflows/python-app.yml | 104 ++++++++++++++++-------------- config_template/config_test1.yml | 2 +- config_template/config_test10.yml | 2 +- config_template/config_test11.yml | 2 +- config_template/config_test2.yml | 2 +- config_template/config_test3.yml | 2 +- config_template/config_test4.yml | 4 +- config_template/config_test5.yml | 4 +- config_template/config_test6.yml | 2 +- config_template/config_test7.yml | 2 +- config_template/config_test8.yml | 2 +- config_template/config_test9.yml | 2 +- 12 files changed, 69 insertions(+), 61 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 8055fd42..c0982af8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,53 +1,61 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions +# This workflow configures the environment and executes NEAT read-simulator tests using relative paths for a series of configuration files individually +# For more information on using Python with GitHub Actions, refer to: +# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: NEAT unit tests +name: NEAT Unit Tests on: push: - branches: + branches: [develop, main] pull_request: - branches: - -#jobs: -# build: -# runs-on: ubuntu-latest -# -# steps: -# - uses: actions/checkout@v3 -# - uses: s-weigand/setup-conda@v1.1.1 -# with: -# conda-channels: bioconda, conda-forge -# activate-conda: true -# repository: NCSA/NEAT -# - name: basic test -# run: | -# conda env create -f environment.yml -n test_neat -# conda activate test_neat -# poetry install -# neat -# -# - name: run coverage tests -# run: | -# conda activate test_neat -# python tests/coverage_tests.py - -# - name: lint with flake8 -# run: | -# conda activate neat -# # stop the build if there are Python syntax errors or undefined names -# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide -# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics -# - name: Execute test_gen_reads -# run: | -# conda activate neat -# cd ${{ github.workspace }} -# poetry install -# neat --log-level ERROR --no-log read-simulator -c data/test_config.yml -o test -# - run: echo "This job's status is ${{ job.status }}." -# - name: Execute seq_err_model_test -# run: | -# cd ${{ github.workspace }} -# neat --log-level ERROR --no-log model-seq-err -i data/baby.fastq -# - run: echo "This job's status is ${{ job.status }}." + branches: [main] + +jobs: + detailed_test_execution: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: s-weigand/setup-conda@v1.1.1 + with: + conda-channels: [bioconda, conda-forge] + activate-conda: true + repository: NCSA/NEAT + - name: Environment Setup + run: | + conda env create -f environment.yml -n test_neat + conda activate test_neat + poetry install + cd config_template + + - name: Run NEAT Simulation for config_test1 + run: python -m neat --log-level DEBUG read-simulator -c config_test1.yml -o ../outputs/test1_read-simulator + + - name: Run NEAT Simulation for config_test2 + run: python -m neat --log-level DEBUG read-simulator -c config_test2.yml -o ../outputs/test2_read-simulator + + - name: Run NEAT Simulation for config_test3 + run: python -m neat --log-level DEBUG read-simulator -c config_test3.yml -o ../outputs/test3_read-simulator + + - name: Run NEAT Simulation for config_test4 + run: python -m neat --log-level DEBUG read-simulator -c config_test4.yml -o ../outputs/test4_read-simulator + + - name: Run NEAT Simulation for config_test5 + run: python -m neat --log-level DEBUG read-simulator -c config_test5.yml -o ../outputs/test5_read-simulator + + - name: Run NEAT Simulation for config_test6 + run: python -m neat --log-level DEBUG read-simulator -c config_test6.yml -o ../outputs/test6_read-simulator + + - name: Run NEAT Simulation for config_test7 + run: python -m neat --log-level DEBUG read-simulator -c config_test7.yml -o ../outputs/test7_read-simulator + + - name: Run NEAT Simulation for config_test8 + run: python -m neat --log-level DEBUG read-simulator -c config_test8.yml -o ../outputs/test8_read-simulator + + - name: Run NEAT Simulation for config_test9 + run: python -m neat --log-level DEBUG read-simulator -c config_test9.yml -o ../outputs/test9_read-simulator + + - name: Run NEAT Simulation for config_test10 + run: python -m neat --log-level DEBUG read-simulator -c config_test10.yml -o ../outputs/test10_read-simulator + + - name: Run NEAT Simulation for config_test11 + run: python -m neat --log-level DEBUG read-simulator -c config_test11.yml -o ../outputs/test11_read-simulator diff --git a/config_template/config_test1.yml b/config_template/config_test1.yml index f80f052b..2c339ff4 100644 --- a/config_template/config_test1.yml +++ b/config_template/config_test1.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very diff --git a/config_template/config_test10.yml b/config_template/config_test10.yml index 2293eb10..d90316ec 100644 --- a/config_template/config_test10.yml +++ b/config_template/config_test10.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very diff --git a/config_template/config_test11.yml b/config_template/config_test11.yml index 602989f0..e1dbd6c5 100644 --- a/config_template/config_test11.yml +++ b/config_template/config_test11.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very diff --git a/config_template/config_test2.yml b/config_template/config_test2.yml index 9dc81cc8..3405fffa 100644 --- a/config_template/config_test2.yml +++ b/config_template/config_test2.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very diff --git a/config_template/config_test3.yml b/config_template/config_test3.yml index 1e24236e..085bede9 100644 --- a/config_template/config_test3.yml +++ b/config_template/config_test3.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very diff --git a/config_template/config_test4.yml b/config_template/config_test4.yml index dab5f84b..dee7c582 100644 --- a/config_template/config_test4.yml +++ b/config_template/config_test4.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very @@ -103,7 +103,7 @@ mutation_rate: 0.01 # Rates must be in the fourth column and be of the form "mut_rate=x.xx" # Rates must be between 0.00 and 0.03 # type: string | required = no -mutation_bed: /user/path/NEAT/data/H1N1.bed +mutation_bed: ../data/H1N1.bed # Absolute path to GC content model generated by compute_gc.py # type: string | required = no | default: /neat/models/defaults/default_gc_bias_model.pickle.gz diff --git a/config_template/config_test5.yml b/config_template/config_test5.yml index 7f5705f1..7641b47f 100644 --- a/config_template/config_test5.yml +++ b/config_template/config_test5.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very @@ -69,7 +69,7 @@ input_variants: . # Absolute path to bed file containing reference regions that the simulation # should target. # type = string | required = no -target_bed: /user/path/NEAT/data/H1N1.bed +target_bed: ../data/H1N1.bed # Scalar value for coverage in regions outside the targeted bed. Example 0.5 # would get you roughly half the coverage as the on target areas. Default is diff --git a/config_template/config_test6.yml b/config_template/config_test6.yml index 308b2b31..eed712da 100644 --- a/config_template/config_test6.yml +++ b/config_template/config_test6.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very diff --git a/config_template/config_test7.yml b/config_template/config_test7.yml index e868c509..2dc05ada 100644 --- a/config_template/config_test7.yml +++ b/config_template/config_test7.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very diff --git a/config_template/config_test8.yml b/config_template/config_test8.yml index c086c40e..79f3832c 100644 --- a/config_template/config_test8.yml +++ b/config_template/config_test8.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very diff --git a/config_template/config_test9.yml b/config_template/config_test9.yml index 75bfa881..1c7a435c 100644 --- a/config_template/config_test9.yml +++ b/config_template/config_test9.yml @@ -11,7 +11,7 @@ # Absolute path to input reference fasta file # type = string | required: yes -reference: /user/path/NEAT/data/H1N1.fa +reference: ../data/H1N1.fa # How to partition the reference for analysis. By default, NEAT will # attempt to process one contig per thread. However, if you have very