From 66992169e8a793c8146fad1ab90735d471d1b3ed Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 21 Jan 2025 11:21:11 -0500 Subject: [PATCH 1/3] docs: add latest release badge --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fe3b0c8..d900288 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,17 @@ -# LOGAN 🔬 [![Docker Pulls](https://img.shields.io/docker/pulls/nciccbr/ccbr_wes_base)](https://hub.docker.com/r/nciccbr/ccbr_wes_base) [![GitHub issues](https://img.shields.io/github/issues/ccbr/LOGAN?color=brightgreen)](https://github.com/ccbr/LOGAN/issues) [![GitHub license](https://img.shields.io/github/license/ccbr/LOGAN)](https://github.com/ccbr/LOGAN/blob/master/LICENSE) +# LOGAN 🔬 -> **_LOGAN-whoLe genOme-sequencinG Analysis pipeliNe_**. Call germline and somatic variants, CNVs, and SVs and annotate variants! +**_whoLe genOme-sequencinG Analysis pipeliNe_** + +[![build](https://github.com/abcsFrederick/LOGAN/actions/workflows/build.yml/badge.svg)](https://github.com/abcsFrederick/LOGAN/actions/workflows/build.yml) +[![Docker Pulls](https://img.shields.io/docker/pulls/nciccbr/ccbr_wes_base)](https://hub.docker.com/r/nciccbr/ccbr_wes_base) +[![issues](https://img.shields.io/github/issues/ccbr/LOGAN?color=brightgreen)](https://github.com/ccbr/LOGAN/issues) +[![license](https://img.shields.io/github/license/ccbr/LOGAN)](https://github.com/ccbr/LOGAN/blob/master/LICENSE) +[![release](https://img.shields.io/github/v/release/CCBR/LOGAN?color=blue&label=latest%20release)](https://github.com/ccbr/LOGAN/releases/latest) + +Call germline and somatic variants, CNVs, and SVs and annotate variants! ## Overview + Welcome to LOGAN! Before getting started, we highly recommend reading through [LOGAN's documentation](https://ccbr.github.io/LOGAN). LOGAN is a comprehensive whole genome-sequencing pipeline following the Broad's set of best practices. It relies on technologies like [Singularity1](https://singularity.lbl.gov/) to maintain the highest-level of reproducibility. The pipeline consists of a series of data processing and quality-control steps orchestrated by [Nextflow2](https://nextflow.io/), a flexible and scalable workflow management system, to submit jobs to a cluster or cloud provider. From 257cf509bc7b6e4fa572d09d06b5986aef65a72d Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 21 Jan 2025 11:22:47 -0500 Subject: [PATCH 2/3] docs: update contrib guide from champagne --- .github/CONTRIBUTING.md | 264 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 248 insertions(+), 16 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 781b9cf..77b7fd0 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,30 +1,262 @@ # Contributing to LOGAN -TODO -- describe gitflow, require PRs... +## Proposing changes with issues -## Use pre-commit hooks +If you want to make a change, it's a good idea to first +[open an issue](https://code-review.tidyverse.org/issues/) +and make sure someone from the team agrees that it’s needed. -Pre-commit can automatically format your code, check for spelling errors, etc. every time you commit. +If you've decided to work on an issue, +[assign yourself to the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/assigning-issues-and-pull-requests-to-other-github-users#assigning-an-individual-issue-or-pull-request) +so others will know you're working on it. -Install [pre-commit](https://pre-commit.com/#installation) if you haven't already, -then run `pre-commit install` to install the hooks specified in `.pre-commit-config.yaml`. -Pre-commit will run the hooks every time you commit. +## Pull request process -If you re-clone the repo, you will likely need to re-run `pre-commit install` -as the hooks are installed to the local repo's `.git/hooks` directory. +We use [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow) +as our collaboration process. +Follow the steps below for detailed instructions on contributing changes to +LOGAN. -## Versions +![GitHub Flow diagram](https://raw.githubusercontent.com/CCBR/CCBR_NextflowTemplate/main/.github/img/GitHub-Flow_bg-white.png) -Increment the version number following semantic versioning[^1] in the `VERSION` file. +### Clone the repo -[^1]: semantic versioning guidelines https://semver.org/ +If you are a member of [CCBR](https://github.com/CCBR), +you can clone this repository to your computer or development environment. +Otherwise, you will first need to +[fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) +the repo and clone your fork. You only need to do this step once. -## Changelog +```sh +git clone https://github.com/CCBR/LOGAN +``` -Keep the changelog up to date with all notable changes in `CHANGELOG.md`[^2]. +> Cloning into 'LOGAN'...
+> remote: Enumerating objects: 1136, done.
+> remote: Counting objects: 100% (463/463), done.
+> remote: Compressing objects: 100% (357/357), done.
+> remote: Total 1136 (delta 149), reused 332 (delta 103), pack-reused 673
+> Receiving objects: 100% (1136/1136), 11.01 MiB | 9.76 MiB/s, done.
+> Resolving deltas: 100% (530/530), done.
-[^2]: changelog guidelines: https://keepachangelog.com/en/1.1.0/ +```sh +cd LOGAN +``` -## VS code extensions +### If this is your first time cloning the repo, you may need to install dependencies -If you use VS code, installing [nf-core extension pack](https://marketplace.visualstudio.com/items?itemName=nf-core.nf-core-extensionpack) is recommended. +- Install nextflow and singularity or docker if needed (biowulf already has these available as modules). + +- Install the python dependencies with pip + + ```sh + pip install . + ``` + + If you're developing on biowulf, you can use our shared conda environment which already has these dependencies installed + + ```sh + . "/data/CCBR_Pipeliner/db/PipeDB/Conda/etc/profile.d/conda.sh" + conda activate py311 + ``` + +- Install [`pre-commit`](https://pre-commit.com/#install) if you don't already + have it. Then from the repo's root directory, run + + ```sh + pre-commit install + ``` + + This will install the repo's pre-commit hooks. + You'll only need to do this step the first time you clone the repo. + +### Create a branch + +Create a Git branch for your pull request (PR). Give the branch a descriptive +name for the changes you will make, such as `iss-10` if it is for a specific +issue. + +```sh +# create a new branch and switch to it +git branch iss-10 +git switch iss-10 +``` + +> Switched to a new branch 'iss-10' + +### Make your changes + +Edit the code, write and run tests, and update the documentation as needed. + +#### test + +Changes to the **python package** code will also need unit tests to demonstrate +that the changes work as intended. +We write unit tests with pytest and store them in the `tests/` subdirectory. +Run the tests with `python -m pytest`. + +If you change the **workflow**, please run the workflow with the test profile +and make sure your new feature or bug fix works as intended. + +#### document + +If you have added a new feature or changed the API of an existing feature, +you will likely need to update the documentation in `docs/`. + +### Commit and push your changes + +If you're not sure how often you should commit or what your commits should +consist of, we recommend following the "atomic commits" principle where each +commit contains one new feature, fix, or task. +Learn more about atomic commits here: + + +First, add the files that you changed to the staging area: + +```sh +git add path/to/changed/files/ +``` + +Then make the commit. +Your commit message should follow the +[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) +specification. +Briefly, each commit should start with one of the approved types such as +`feat`, `fix`, `docs`, etc. followed by a description of the commit. +Take a look at the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#summary) +for more detailed information about how to write commit messages. + +```sh +git commit -m 'feat: create function for awesome feature' +``` + +pre-commit will enforce that your commit message and the code changes are +styled correctly and will attempt to make corrections if needed. + +> Check for added large files..............................................Passed
+> Fix End of Files.........................................................Passed
+> Trim Trailing Whitespace.................................................Failed
+> +> - hook id: trailing-whitespace
+> - exit code: 1
+> - files were modified by this hook
>
+> Fixing path/to/changed/files/file.txt
>
+> codespell................................................................Passed
+> style-files..........................................(no files to check)Skipped
+> readme-rmd-rendered..................................(no files to check)Skipped
+> use-tidy-description.................................(no files to check)Skipped
+ +In the example above, one of the hooks modified a file in the proposed commit, +so the pre-commit check failed. You can run `git diff` to see the changes that +pre-commit made and `git status` to see which files were modified. To proceed +with the commit, re-add the modified file(s) and re-run the commit command: + +```sh +git add path/to/changed/files/file.txt +git commit -m 'feat: create function for awesome feature' +``` + +This time, all the hooks either passed or were skipped +(e.g. hooks that only run on R code will not run if no R files were +committed). +When the pre-commit check is successful, the usual commit success message +will appear after the pre-commit messages showing that the commit was created. + +> Check for added large files..............................................Passed
+> Fix End of Files.........................................................Passed
+> Trim Trailing Whitespace.................................................Passed
+> codespell................................................................Passed
+> style-files..........................................(no files to check)Skipped
+> readme-rmd-rendered..................................(no files to check)Skipped
+> use-tidy-description.................................(no files to check)Skipped
+> Conventional Commit......................................................Passed
> [iss-10 9ff256e] feat: create function for awesome feature
+> 1 file changed, 22 insertions(+), 3 deletions(-)
+ +Finally, push your changes to GitHub: + +```sh +git push +``` + +If this is the first time you are pushing this branch, you may have to +explicitly set the upstream branch: + +```sh +git push --set-upstream origin iss-10 +``` + +> Enumerating objects: 7, done.
+> Counting objects: 100% (7/7), done.
+> Delta compression using up to 10 threads
+> Compressing objects: 100% (4/4), done.
+> Writing objects: 100% (4/4), 648 bytes | 648.00 KiB/s, done.
+> Total 4 (delta 3), reused 0 (delta 0), pack-reused 0
+> remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
+> remote:
+> remote: Create a pull request for 'iss-10' on GitHub by visiting:
+> remote: https://github.com/CCBR/LOGAN/pull/new/iss-10
+> remote:
+> To https://github.com/CCBR/LOGAN
>
> [new branch] iss-10 -> iss-10
+> branch 'iss-10' set up to track 'origin/iss-10'.
+ +We recommend pushing your commits often so they will be backed up on GitHub. +You can view the files in your branch on GitHub at +`https://github.com/CCBR/LOGAN/tree/` +(replace `` with the actual name of your branch). + +### Create the PR + +Once your branch is ready, create a PR on GitHub: + + +Select the branch you just pushed: + +![Create a new PR from your branch](https://raw.githubusercontent.com/CCBR/CCBR_NextflowTemplate/main/.github/img/new-PR.png) + +Edit the PR title and description. +The title should briefly describe the change. +Follow the comments in the template to fill out the body of the PR, and +you can delete the comments (everything between ``) as you go. +Be sure to fill out the checklist, checking off items as you complete them or +striking through any irrelevant items. +When you're ready, click 'Create pull request' to open it. + +![Open the PR after editing the title and description](https://raw.githubusercontent.com/CCBR/CCBR_NextflowTemplate/main/.github/img/create-PR.png) + +Optionally, you can mark the PR as a draft if you're not yet ready for it to +be reviewed, then change it later when you're ready. + +### Wait for a maintainer to review your PR + +We will do our best to follow the tidyverse code review principles: +. +The reviewer may suggest that you make changes before accepting your PR in +order to improve the code quality or style. +If that's the case, continue to make changes in your branch and push them to +GitHub, and they will appear in the PR. + +Once the PR is approved, the maintainer will merge it and the issue(s) the PR +links will close automatically. +Congratulations and thank you for your contribution! + +### After your PR has been merged + +After your PR has been merged, update your local clone of the repo by +switching to the main branch and pulling the latest changes: + +```sh +git checkout main +git pull +``` + +It's a good idea to run `git pull` before creating a new branch so it will +start from the most recent commits in main. + +## Helpful links for more information + +- [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow) +- [semantic versioning guidelines](https://semver.org/) +- [changelog guidelines](https://keepachangelog.com/en/1.1.0/) +- [tidyverse code review principles](https://code-review.tidyverse.org) +- [reproducible examples](https://www.tidyverse.org/help/#reprex) +- [nf-core extensions for VS Code](https://marketplace.visualstudio.com/items?itemName=nf-core.nf-core-extensionpack) From 64fea8cb60079121aee1d9215e7424485fafd1b2 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 21 Jan 2025 11:23:12 -0500 Subject: [PATCH 3/3] ci: update docs workflow from ccbr/actions copied workflow with: `ccbr_actions use-example docs-mkdocs` --- .github/workflows/docs-mkdocs.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/docs.yml | 27 --------------------------- 2 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/docs-mkdocs.yml delete mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs-mkdocs.yml b/.github/workflows/docs-mkdocs.yml new file mode 100644 index 0000000..814e2a4 --- /dev/null +++ b/.github/workflows/docs-mkdocs.yml @@ -0,0 +1,28 @@ +name: docs +# this workflow requires: +# - an mkdocs config file (`mkdocs.yml`) +# - website dependencies in `docs/requirements.txt` +on: + workflow_dispatch: + release: + types: + - published + push: + branches: + - main + paths: + - "docs/**" + - "**.md" + - .github/workflows/docs-mkdocs.yml + - mkdocs.yml + +jobs: + mkdocs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: CCBR/actions/mkdocs-mike@v0.1 + with: + github-token: ${{ github.token }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 18228e9..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: mkdocs_build -on: - workflow_dispatch: - push: - branches: - - main - paths: - - "docs/**" - -env: - actor: "41898282+github-actions[bot]" - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: git config - run: | - git config --local user.email "${actor}@users.noreply.github.com" - git config --local user.name "$actor" - - run: pip install --upgrade pip - - run: pip install -r docs/requirements.txt - - run: mkdocs gh-deploy --force