Skip to content

Commit

Permalink
Merge pull request #6 from CCBR/bwa-mem
Browse files Browse the repository at this point in the history
fix md5sums & document automated test yaml creation
  • Loading branch information
kelly-sovacool authored Oct 10, 2023
2 parents 73f3979 + 1b9b111 commit 52c86ac
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 93 deletions.
26 changes: 18 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# Contributing to nf-modules

TODO -- describe gitflow, require PRs...
## Unit tests

## Use pre-commit hooks
Once you've written or updated a module under `modules/CCBR/[module-name]` and
a test workflow under `tests/modules/CCBR/[module-name]`,
then use nf-core tools to automatically create a test YAML file with:

```sh
nf-core modules create-test-yml [module-name] --run-tests --force --no-prompts
```

Add the module to `tests/config/pytest_modules.yml`

Run the tests with:

```sh
PROFILE=docker nf-core modules test [module-name] --no-prompts
```

## Pre-commit hooks

Pre-commit can automatically format your code, check for spelling errors, etc. every time you commit.

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.

## Versions

Increment the version number following semantic versioning[^1] in the `VERSION` file.

[^1]: semantic versioning guidelines https://semver.org/

## Changelog

Keep the changelog up to date with all notable changes in `CHANGELOG.md`[^2].
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ when referring to the issue.
(~Strikethrough~ any points that are not applicable.)

- [ ] This comment contains a description of changes with justifications, with any relevant issues linked.
- ~[ ] Write unit tests for any new features, bug fixes, or other code changes.~ _testing framework not yet implemented_
- ~[ ] Update docs if there are any API changes.~ _on hold until before public release_
- [ ] Write unit tests for any new features, bug fixes, or other code changes.
- [ ] Update docs if there are any API changes.
- [ ] Update `CHANGELOG.md` with a short description of any user-facing changes and reference the PR number. Guidelines: https://keepachangelog.com/en/1.1.0/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Come across a **bug**? Open an [issue](https://github.com/CCBR/nf-modules/issues

Have a **question**? Ask it in [discussions](https://github.com/CCBR/nf-modules/discussions).

Want to **contribute** to this project? Check out the [contributing guidelines](docs/CONTRIBUTING.md).
Want to **contribute** to this project? Check out the [contributing guidelines](.github/CONTRIBUTING.md).

## References

Expand Down
1 change: 1 addition & 0 deletions modules/CCBR/bwa/mem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ process BWA_MEM {
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""

stub:
"""
touch ${meta.id}.bam versions.yml
Expand Down
40 changes: 0 additions & 40 deletions tests/modules/CCBR/bwa/mem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -43,43 +43,3 @@ workflow test_bwa_mem_paired_end {
BWA_INDEX ( fasta )
BWA_MEM ( input, BWA_INDEX.out.index )
}

//
// Test with stub pairedend
//
workflow test_bwa_mem_paired_end_stub {
input = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
fasta = [
[id: 'test'],
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]

BWA_INDEX ( fasta )
BWA_MEM ( input, BWA_INDEX.out.index )
}


//
// Test with single-end data stub
//
workflow test_bwa_mem_single_end_stub {
input = [
[ id:'test', single_end:true ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]
]
fasta = [
[id: 'test'],
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]

BWA_INDEX ( fasta )
BWA_MEM ( input, BWA_INDEX.out.index )
}
44 changes: 2 additions & 42 deletions tests/modules/CCBR/bwa/mem/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
- name: bwa mem test_bwa_mem_single_end
command: nextflow run ./tests/modules/CCBR/bwa/mem -entry test_bwa_mem_single_end -c ./tests/config/nextflow.config
tags:
- bwa
- bwa/mem
- bwa
files:
- path: output/bwa/bwa/genome.amb
md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e
Expand All @@ -15,34 +15,14 @@
- path: output/bwa/bwa/genome.sa
md5sum: ab3952cabf026b48cd3eb5bccbb636d1
- path: output/bwa/test.bam
md5sum: fe5a30103b245d81a8d37d6144794f5
md5sum: fe5a30103b245d81a8d37d6144794f56
- path: output/bwa/versions.yml

- name: bwa mem test_bwa_mem_paired_end
command: nextflow run ./tests/modules/CCBR/bwa/mem -entry test_bwa_mem_paired_end -c ./tests/config/nextflow.config
tags:
- bwa
- bwa/mem
files:
- path: output/bwa/bwa/genome.amb
md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e
- path: output/bwa/bwa/genome.ann
md5sum: c32e11f6c859f166c7525a9c1d583567
- path: output/bwa/bwa/genome.bwt
md5sum: 0469c30a1e239dd08f68afe66fde99da
- path: output/bwa/bwa/genome.pac
md5sum: 983e3d2cd6f36e2546e6d25a0da78d66
- path: output/bwa/bwa/genome.sa
md5sum: ab3952cabf026b48cd3eb5bccbb636d1
- path: output/bwa/test.bam
md5sum: 06b8e7424d97add946ddb07e55f12962
- path: output/bwa/versions.yml

- name: bwa mem test_bwa_mem_paired_end_stub
command: nextflow run ./tests/modules/CCBR/bwa/mem -entry test_bwa_mem_paired_end_stub -c ./tests/config/nextflow.config
tags:
- bwa
- bwa/mem
files:
- path: output/bwa/bwa/genome.amb
md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e
Expand All @@ -57,23 +37,3 @@
- path: output/bwa/test.bam
md5sum: 06b8e7424d97add946ddb07e55f12962
- path: output/bwa/versions.yml

- name: bwa mem test_bwa_mem_single_end_stub
command: nextflow run ./tests/modules/CCBR/bwa/mem -entry test_bwa_mem_single_end_stub -c ./tests/config/nextflow.config
tags:
- bwa
- bwa/mem
files:
- path: output/bwa/bwa/genome.amb
md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e
- path: output/bwa/bwa/genome.ann
md5sum: c32e11f6c859f166c7525a9c1d583567
- path: output/bwa/bwa/genome.bwt
md5sum: 0469c30a1e239dd08f68afe66fde99da
- path: output/bwa/bwa/genome.pac
md5sum: 983e3d2cd6f36e2546e6d25a0da78d66
- path: output/bwa/bwa/genome.sa
md5sum: ab3952cabf026b48cd3eb5bccbb636d1
- path: output/bwa/test.bam
md5sum: fe5a30103b245d81a8d37d6144794f56
- path: output/bwa/versions.yml

0 comments on commit 52c86ac

Please sign in to comment.