From 357fc46766adc2750579166564573fc16a0a959f Mon Sep 17 00:00:00 2001 From: r1cheu <124009368+r1cheu@users.noreply.github.com> Date: Tue, 19 Mar 2024 12:09:10 +0800 Subject: [PATCH] Initial commit --- .github/workflows/conventional-prs.yml | 18 +++++++++ .github/workflows/main.yml | 54 ++++++++++++++++++++++++++ .github/workflows/release-please.yml | 17 ++++++++ .gitignore | 5 +++ .snakemake-workflow-catalog.yml | 11 ++++++ .template/config/config.yaml.tmpl.tmpl | 1 + .template/workflow/Snakefile.tmpl.tmpl | 10 +++++ LICENSE | 21 ++++++++++ README.md | 21 ++++++++++ config/README.md | 2 + workflow/Snakefile | 4 ++ 11 files changed, 164 insertions(+) create mode 100644 .github/workflows/conventional-prs.yml create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/release-please.yml create mode 100644 .gitignore create mode 100644 .snakemake-workflow-catalog.yml create mode 100644 .template/config/config.yaml.tmpl.tmpl create mode 100644 .template/workflow/Snakefile.tmpl.tmpl create mode 100644 LICENSE create mode 100644 README.md create mode 100644 config/README.md create mode 100644 workflow/Snakefile diff --git a/.github/workflows/conventional-prs.yml b/.github/workflows/conventional-prs.yml new file mode 100644 index 0000000..2a5b86f --- /dev/null +++ b/.github/workflows/conventional-prs.yml @@ -0,0 +1,18 @@ +name: PR +on: + pull_request_target: + types: + - opened + - reopened + - edited + - synchronize + +jobs: + title-format: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v3.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + validateSingleCommit: true \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5d28ca0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,54 @@ +name: Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + +jobs: + Formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Formatting + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_SNAKEMAKE_SNAKEFMT: true + + Linting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Lint workflow + uses: snakemake/snakemake-github-action@v1.24.0 + with: + directory: . + snakefile: workflow/Snakefile + args: "--lint" + + Testing: + runs-on: ubuntu-latest + needs: + - Linting + - Formatting + steps: + - uses: actions/checkout@v2 + + - name: Test workflow + uses: snakemake/snakemake-github-action@v1.24.0 + with: + directory: .test + snakefile: workflow/Snakefile + args: "--use-conda --show-failed-logs --cores 3 --conda-cleanup-pkgs cache --all-temp" + + - name: Test report + uses: snakemake/snakemake-github-action@v1.24.0 + with: + directory: .test + snakefile: workflow/Snakefile + args: "--report report.zip" \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..a3e26fb --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,17 @@ +on: + push: + branches: + - main + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + + - uses: GoogleCloudPlatform/release-please-action@v2 + id: release + with: + release-type: go # just keep a changelog, no version anywhere outside of git tags + package-name: \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..efca3e5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +results/** +resources/** +logs/** +.snakemake +.snakemake/** diff --git a/.snakemake-workflow-catalog.yml b/.snakemake-workflow-catalog.yml new file mode 100644 index 0000000..3436e32 --- /dev/null +++ b/.snakemake-workflow-catalog.yml @@ -0,0 +1,11 @@ +# configuration of display in snakemake workflow catalog: https://snakemake.github.io/snakemake-workflow-catalog + +usage: + mandatory-flags: # optional definition of additional flags + desc: # describe your flags here in a few sentences (they will be inserted below the example commands) + flags: # put your flags here + software-stack-deployment: # definition of software deployment method (at least one of conda, singularity, or singularity+conda) + conda: true # whether pipeline works with --use-conda + singularity: false # whether pipeline works with --use-singularity + singularity+conda: false # whether pipeline works with --use-singularity --use-conda + report: true # add this to confirm that the workflow allows to use 'snakemake --report report.zip' to generate a report containing all results and explanations \ No newline at end of file diff --git a/.template/config/config.yaml.tmpl.tmpl b/.template/config/config.yaml.tmpl.tmpl new file mode 100644 index 0000000..0850e6f --- /dev/null +++ b/.template/config/config.yaml.tmpl.tmpl @@ -0,0 +1 @@ +# add template configuration file (may use variables from copier.yml) \ No newline at end of file diff --git a/.template/workflow/Snakefile.tmpl.tmpl b/.template/workflow/Snakefile.tmpl.tmpl new file mode 100644 index 0000000..65613a9 --- /dev/null +++ b/.template/workflow/Snakefile.tmpl.tmpl @@ -0,0 +1,10 @@ +configfile: "config/config.yaml" + +module [[ module_name ]]: + snakefile: + # TODO replace with desired release + "https://github.com/[[ owner ]]/[[ repo ]]/raw//Snakefile" + config: + config + +use rule * from [[ module_name ]] \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e9b75a4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021, AUTHORS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..aab998b --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Snakemake workflow: `` + +[![Snakemake](https://img.shields.io/badge/snakemake-≥6.3.0-brightgreen.svg)](https://snakemake.github.io) +[![GitHub actions status](https://github.com///workflows/Tests/badge.svg?branch=main)](https://github.com///actions?query=branch%3Amain+workflow%3ATests) + + +A Snakemake workflow for `` + + +## Usage + +The usage of this workflow is described in the [Snakemake Workflow Catalog](https://snakemake.github.io/snakemake-workflow-catalog/?usage=%2F). + +If you use this workflow in a paper, don't forget to give credits to the authors by citing the URL of this (original) sitory and its DOI (see above). + +# TODO + +* Replace `` and `` everywhere in the template (also under .github/workflows) with the correct `` name and owning user or organization. +* Replace `` with the workflow name (can be the same as ``). +* Replace `` with a description of what the workflow does. +* The workflow will occur in the snakemake-workflow-catalog once it has been made public. Then the link under "Usage" will point to the usage instructions if `` and `` were correctly set. \ No newline at end of file diff --git a/config/README.md b/config/README.md new file mode 100644 index 0000000..44c6f7e --- /dev/null +++ b/config/README.md @@ -0,0 +1,2 @@ +Describe how to configure the workflow (using config.yaml and maybe additional files). +All of them need to be present with example entries inside of the config folder. diff --git a/workflow/Snakefile b/workflow/Snakefile new file mode 100644 index 0000000..3826ec5 --- /dev/null +++ b/workflow/Snakefile @@ -0,0 +1,4 @@ +# Main entrypoint of the workflow. +# Please follow the best practices: +# https://snakemake.readthedocs.io/en/stable/snakefiles/best_practices.html, +# in particular regarding the standardized folder structure mentioned there.