From 7df4a168c59787ec465e6a9d074aa13ed510784e Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Mon, 11 Sep 2023 14:16:23 +0200 Subject: [PATCH 01/10] Create tests.yml workflow on GH actions --- .github/workflows/tests.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..3288602 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,41 @@ +name: tests + +on: + push: + branches: [ "main", "ci" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + + - name: Setup Miniconda + + # You may pin to the exact commit or the version. + # uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 + uses: conda-incubator/setup-miniconda@v2.2.0 + + with: + # Specific version of Conda to install after miniconda is located or installed. See https://anaconda.org/anaconda/conda for available "conda" versions. + conda-version: 23.5.0 + # Environment.yml to create an environment. See https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file for more information. + environment-file: env/conda_snakemake7.yaml + # Environment name (or path) to activate on all shells. Default is `test` which will be created in `$CONDA/envs/test`. If an empty string is used, no environment is activated by default (For `base` activation see the `auto-activate-base` option). If the environment does not exist, it will be created and activated. If `environment-file` is used and you want that to be the environment used, you need to explicitely provide the name of that environment on `activate-environment`. If using sh/bash/cmd.exe shells please read the IMPORTANT! section on the README.md! to properly activate conda environments on these shells. + activate-environment: snakemake7 + # Conda configuration. If you’d prefer that conda’s base environment not be activated on startup, set the to "false". Default is "true". This setting always overrides if set to "true" or "false". If you want to use the "condarc-file" setting pass and empty string. See https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/ for more information. + auto-activate-base: false + # Conda configuration. Accepts values of "strict", "flexible", and "disabled". The default value is "flexible". With strict channel priority, packages in lower priority channels are not considered if a package with the same name appears in a higher priority channel. With flexible channel priority, the solver may reach into lower priority channels to fulfill dependencies, rather than raising an unsatisfiable error. With channel priority disabled, package version takes precedence, and the configured priority of channels is used only to break ties. In previous versions of conda, this parameter was configured as either "true" or "false". "true" is now an alias to "flexible". See https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html#strict-channel-priority for more information. + channel-priority: "strict" + # Conda configuration. Comma separated list of channels to use in order of priority. See https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/ for more information. + channels: conda-forge,bioconda,defaults + # Set this option to "false" to disable running the post cleanup step of the action. Default is "true" + run-post: true + + - name : Check setup + run: | + conda --version + snakemake --version From a22744f6c3f0388d94d806aa987db972fe5d4d38 Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Mon, 11 Sep 2023 14:42:16 +0200 Subject: [PATCH 02/10] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3288602..6329911 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: # Specific version of Conda to install after miniconda is located or installed. See https://anaconda.org/anaconda/conda for available "conda" versions. conda-version: 23.5.0 # Environment.yml to create an environment. See https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file for more information. - environment-file: env/conda_snakemake7.yaml + environment-file: /home/runner/work/imsmp-variant-calling-benchmark/env/conda_snakemake7.yaml # Environment name (or path) to activate on all shells. Default is `test` which will be created in `$CONDA/envs/test`. If an empty string is used, no environment is activated by default (For `base` activation see the `auto-activate-base` option). If the environment does not exist, it will be created and activated. If `environment-file` is used and you want that to be the environment used, you need to explicitely provide the name of that environment on `activate-environment`. If using sh/bash/cmd.exe shells please read the IMPORTANT! section on the README.md! to properly activate conda environments on these shells. activate-environment: snakemake7 # Conda configuration. If you’d prefer that conda’s base environment not be activated on startup, set the to "false". Default is "true". This setting always overrides if set to "true" or "false". If you want to use the "condarc-file" setting pass and empty string. See https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/ for more information. From bc746ca556aa2db54191930cfc3c62c96b23016f Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Mon, 11 Sep 2023 14:47:18 +0200 Subject: [PATCH 03/10] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6329911..07e920a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: # Specific version of Conda to install after miniconda is located or installed. See https://anaconda.org/anaconda/conda for available "conda" versions. conda-version: 23.5.0 # Environment.yml to create an environment. See https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file for more information. - environment-file: /home/runner/work/imsmp-variant-calling-benchmark/env/conda_snakemake7.yaml + environment-file: ../env/conda_snakemake7.yaml # Environment name (or path) to activate on all shells. Default is `test` which will be created in `$CONDA/envs/test`. If an empty string is used, no environment is activated by default (For `base` activation see the `auto-activate-base` option). If the environment does not exist, it will be created and activated. If `environment-file` is used and you want that to be the environment used, you need to explicitely provide the name of that environment on `activate-environment`. If using sh/bash/cmd.exe shells please read the IMPORTANT! section on the README.md! to properly activate conda environments on these shells. activate-environment: snakemake7 # Conda configuration. If you’d prefer that conda’s base environment not be activated on startup, set the to "false". Default is "true". This setting always overrides if set to "true" or "false". If you want to use the "condarc-file" setting pass and empty string. See https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/ for more information. From 1d2d34e224ba4c486bf67c18d21a022e18400273 Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Thu, 28 Sep 2023 13:56:17 +0200 Subject: [PATCH 04/10] Update tests.yml --- .github/workflows/tests.yml | 56 +++++++++++++++---------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 07e920a..a46d789 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,41 +1,31 @@ -name: tests +name: CI on: push: - branches: [ "main", "ci" ] + branches: [ "main", "dev", "ci" ] pull_request: branches: [ "main" ] +# designed as in: https://github.com/marketplace/actions/setup-miniconda jobs: - build: - - runs-on: ubuntu-latest - + CI: + name: CI tests using linux + runs-on: "ubuntu-latest" + defaults: + run: + shell: bash -el {0} steps: - - - name: Setup Miniconda - - # You may pin to the exact commit or the version. - # uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 - uses: conda-incubator/setup-miniconda@v2.2.0 - - with: - # Specific version of Conda to install after miniconda is located or installed. See https://anaconda.org/anaconda/conda for available "conda" versions. - conda-version: 23.5.0 - # Environment.yml to create an environment. See https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file for more information. - environment-file: ../env/conda_snakemake7.yaml - # Environment name (or path) to activate on all shells. Default is `test` which will be created in `$CONDA/envs/test`. If an empty string is used, no environment is activated by default (For `base` activation see the `auto-activate-base` option). If the environment does not exist, it will be created and activated. If `environment-file` is used and you want that to be the environment used, you need to explicitely provide the name of that environment on `activate-environment`. If using sh/bash/cmd.exe shells please read the IMPORTANT! section on the README.md! to properly activate conda environments on these shells. - activate-environment: snakemake7 - # Conda configuration. If you’d prefer that conda’s base environment not be activated on startup, set the to "false". Default is "true". This setting always overrides if set to "true" or "false". If you want to use the "condarc-file" setting pass and empty string. See https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/ for more information. - auto-activate-base: false - # Conda configuration. Accepts values of "strict", "flexible", and "disabled". The default value is "flexible". With strict channel priority, packages in lower priority channels are not considered if a package with the same name appears in a higher priority channel. With flexible channel priority, the solver may reach into lower priority channels to fulfill dependencies, rather than raising an unsatisfiable error. With channel priority disabled, package version takes precedence, and the configured priority of channels is used only to break ties. In previous versions of conda, this parameter was configured as either "true" or "false". "true" is now an alias to "flexible". See https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html#strict-channel-priority for more information. - channel-priority: "strict" - # Conda configuration. Comma separated list of channels to use in order of priority. See https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/ for more information. - channels: conda-forge,bioconda,defaults - # Set this option to "false" to disable running the post cleanup step of the action. Default is "true" - run-post: true - - - name : Check setup - run: | - conda --version - snakemake --version + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "23.5.0" + activate-environment: snakemake7 + environment-file: env/conda_snakemake7.yaml + channels: conda-forge,bioconda,defaults + channel-priority: strict + auto-activate-base: false + - run: | + conda info + conda list + conda config --show-sources + conda config --show From 4db8c474a14ea1895146319a11733af44a42a454 Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Thu, 28 Sep 2023 14:00:10 +0200 Subject: [PATCH 05/10] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a46d789..da39997 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v2 - uses: conda-incubator/setup-miniconda@v2 with: - miniconda-version: "23.5.0" + miniconda-version: "latest" activate-environment: snakemake7 environment-file: env/conda_snakemake7.yaml channels: conda-forge,bioconda,defaults From 7c40ded7fe0eee0a2e9cb78b007130e74ea84946 Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Thu, 28 Sep 2023 16:06:09 +0200 Subject: [PATCH 06/10] Update tests.yml --- .github/workflows/tests.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index da39997..e2ca7cc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,3 +29,11 @@ jobs: conda list conda config --show-sources conda config --show + - run: | + snakemake --version + - run: | + wget https://www.ebi.ac.uk/ena/browser/api/fasta/MN908947.3 + sed 's/>ENA|MN908947|MN908947.3 Severe acute respiratory syndrome coronavirus 2 isolate Wuhan-Hu-1, complete genome./>MN908947.3/g' MN908947.3 > MN908947.3.fasta + - run: | + python cievad.py --help + python cievad.py -n 3 -r MN908947.3.fasta From bbede65a643b34a5de7856071e2d1fdf8b509d0e Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Thu, 28 Sep 2023 16:16:34 +0200 Subject: [PATCH 07/10] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e2ca7cc..0edeb2f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,4 +36,4 @@ jobs: sed 's/>ENA|MN908947|MN908947.3 Severe acute respiratory syndrome coronavirus 2 isolate Wuhan-Hu-1, complete genome./>MN908947.3/g' MN908947.3 > MN908947.3.fasta - run: | python cievad.py --help - python cievad.py -n 3 -r MN908947.3.fasta + python cievad.py hap -n 3 -r MN908947.3.fasta From ca45df19c0a408d706db2611a907bc227f6cdce1 Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Thu, 28 Sep 2023 16:46:27 +0200 Subject: [PATCH 08/10] Update tests.yml --- .github/workflows/tests.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0edeb2f..ad76368 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,16 +24,37 @@ jobs: channels: conda-forge,bioconda,defaults channel-priority: strict auto-activate-base: false + + - name: Test conda installation - run: | conda info conda list conda config --show-sources conda config --show + + - name: Test snakemake installation - run: | snakemake --version + + - name : Download reference - run: | wget https://www.ebi.ac.uk/ena/browser/api/fasta/MN908947.3 sed 's/>ENA|MN908947|MN908947.3 Severe acute respiratory syndrome coronavirus 2 isolate Wuhan-Hu-1, complete genome./>MN908947.3/g' MN908947.3 > MN908947.3.fasta + + - name: Test CIEVaD principal functionality - run: | python cievad.py --help + + - name: Test haplotype simulation + - run: | python cievad.py hap -n 3 -r MN908947.3.fasta + + - name: Test NGS simulation + - run: | + python cievad.py ngs -n 3 -f 1000 + + - name: Test Nanopore simulation + - run: | + python cievad.py nano -n 3 -r 100 + + From ee9f929812b84e8e02312a1bde50fa982c920ee9 Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Thu, 28 Sep 2023 16:51:28 +0200 Subject: [PATCH 09/10] Update tests.yml --- .github/workflows/tests.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ad76368..f447fb9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,35 +26,35 @@ jobs: auto-activate-base: false - name: Test conda installation - - run: | + run: | conda info conda list conda config --show-sources conda config --show - name: Test snakemake installation - - run: | + run: | snakemake --version - name : Download reference - - run: | + run: | wget https://www.ebi.ac.uk/ena/browser/api/fasta/MN908947.3 sed 's/>ENA|MN908947|MN908947.3 Severe acute respiratory syndrome coronavirus 2 isolate Wuhan-Hu-1, complete genome./>MN908947.3/g' MN908947.3 > MN908947.3.fasta - name: Test CIEVaD principal functionality - - run: | + run: | python cievad.py --help - name: Test haplotype simulation - - run: | + run: | python cievad.py hap -n 3 -r MN908947.3.fasta - name: Test NGS simulation - - run: | + run: | python cievad.py ngs -n 3 -f 1000 - name: Test Nanopore simulation - - run: | + run: | python cievad.py nano -n 3 -r 100 From 50572eeca14de45099ef4a38f59555376cb78712 Mon Sep 17 00:00:00 2001 From: Thomas Krannich Date: Thu, 28 Sep 2023 17:37:06 +0200 Subject: [PATCH 10/10] Update tests.yml --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f447fb9..0d3be98 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,6 +19,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: miniconda-version: "latest" + python-version: "3.11.3" activate-environment: snakemake7 environment-file: env/conda_snakemake7.yaml channels: conda-forge,bioconda,defaults