-
Notifications
You must be signed in to change notification settings - Fork 297
Port old test-data guide to new layout #4283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,111 @@ | ||||||
| --- | ||||||
| title: Test data | ||||||
| subtitle: Finding and adding test data for CI testing | ||||||
| shortTitle: Test data | ||||||
| weight: 2 | ||||||
| --- | ||||||
|
|
||||||
| nf-core has a central repository on [nf-core/test-datasets](https://github.com/nf-core/test-datasets) containing small data files for testing of nf-core components and pipelines. | ||||||
| This guide explains how to find and upload new test data. | ||||||
|
|
||||||
| ## Modules and subworkflows | ||||||
|
|
||||||
| ### Reusing existing test data | ||||||
|
|
||||||
| When setting up tests for a nf-core component, test data files should be reused as far as possible. | ||||||
|
|
||||||
| :::tip | ||||||
| If a small test data file for your module can be quickly generated by an upstream module, do not add the input file to the test data. | ||||||
| Run the upstream module in the test for your module using the [nf-test `setup` method](https://www.nf-test.com/docs/testcases/setup/?h=setup). | ||||||
| ::: | ||||||
|
|
||||||
| Test data for modules and subworkflows are stored on the [`modules`](https://github.com/nf-core/test-datasets/tree/modules) branch of nf-core/test-datasets. | ||||||
| The branch is approximately structured as follows: | ||||||
|
|
||||||
| ```tree | ||||||
| data/ | ||||||
| ├── delete_me/ | ||||||
| │ └── <tool name>/ | ||||||
| │ └── <test data file> | ||||||
| ├── generic/ | ||||||
| │ └── <format>/ | ||||||
| │ └── <test data file> | ||||||
| └── <research domain>/ | ||||||
| └── <technology or analysis>/ | ||||||
| │ └── <format>/ | ||||||
| │ └── <test data file>/ | ||||||
| └── <species>/ ## Bioinformatics only | ||||||
| └── <technology or analysis>/ | ||||||
| └── <format>/ | ||||||
| └── <test data file>/ | ||||||
| ``` | ||||||
|
|
||||||
| Existing nf-core test data can be explored using nf-core/tools. | ||||||
|
|
||||||
| ```bash | ||||||
| nf-core test-datasets search --branch modules | ||||||
| ``` | ||||||
|
|
||||||
| Type in the search bar keywords such as for file formats or extensions to find potentially relevant files. | ||||||
| To get more information about the context of the data, see the [nf-core/test-datasets README](https://github.com/nf-core/test-datasets/tree/modules#data-description) file. | ||||||
|
|
||||||
| Selecting a file to print different variants of URLs to the test data file for use in tests. | ||||||
|
|
||||||
| ### Uploading new data | ||||||
|
|
||||||
| If you cannot generate [test data on the fly quickly](https://www.nf-test.com/docs/testcases/setup/?h=setup), or reuse existing data, you can upload new compliant test data to the `modules` branch. | ||||||
|
|
||||||
| If you need to create a derivative file, use existing test data as a source. | ||||||
| For example, if you need to test a new bioinformatic short-read aligner that requires a genome file index, use an existing `genome.fasta` file on nf-core/test-datasets to generate the index, rather than using your own reference genome. | ||||||
|
|
||||||
| :::danger | ||||||
| Do not clone the nf-core/test-datasets repository: it is extremely large and will take a long time to download. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| If a local copy is required, we highly recommend using [single-branch clones](https://github.com/nf-core/test-datasets#downloading-test-data). | ||||||
| ::: | ||||||
|
|
||||||
| 1. Verify your new test-data file complies with the [nf-core test-datasets specifications](../../specifications/test-data/overview.md). | ||||||
| 2. Fork the nf-core/test-datasets repository including all branches. | ||||||
| 3. Upload to the `modules` branch on your fork in a suitable location. | ||||||
| - (Recommended) Use the GitHub website upload function. | ||||||
| - If you are unsure of the suitable location, ask on the nf-core [#test-data](https://nfcore.slack.com/archives/C02L5UB4Y9G) Slack channel. | ||||||
| 4. Edit the README of the `modules` branch to add a short entry describing the new test data file. | ||||||
| - Include as much information as possible to support reconstruction of the file (for example, original source accession numbers or URLs, tool name and version used to generate). | ||||||
| - (Optional) If a description requires more than one or two sentences Additionally add a dedicated README markdown file alongside the test-data file itself. | ||||||
| 5. Open a pull request and request a review on the nf-core [#request-review](https://nfcore.slack.com/archives/CQY2U5QU9) Slack channel. | ||||||
|
|
||||||
| ### Research domain specific guidance | ||||||
|
|
||||||
| #### Biology | ||||||
|
|
||||||
| Avoid adding test data of new organisms as far as possible, and reuse existing files. | ||||||
|
|
||||||
| SARS-CoV-2 and _Homo sapiens_ (Chr 21) are the best supported organisms and should be used where possible. | ||||||
| If a new organism is absolutely required for a tool, first propose the addition on the [#test-data](https://nfcore.slack.com/archives/C02L5UB4Y9G) Slack channel. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ## Pipelines | ||||||
|
|
||||||
| Each official nf-core pipeline has a dedicated branch on the test-datasets repository, for example, [nf-core/rnaseq](https://github.com/nf-core/test-datasets/tree/rnaseq). | ||||||
|
|
||||||
| Reusability principles are less strict for pipeline test data. | ||||||
| Test data should not be reused across pipelines for stability purposes. | ||||||
| Reusing test data from modules for pipeline tests is possible due to the greater stability of these files. | ||||||
|
|
||||||
| A pipeline-specific nf-core/test-datasets branch will generally consist of: | ||||||
|
|
||||||
| - Small raw input files (for example, FASTQ, FASTA etc. for bioinformatics) | ||||||
| - Samplesheets | ||||||
|
|
||||||
| ### Adding new test data | ||||||
|
|
||||||
| 1. Verify your new test-data file complies with the [nf-core test-datasets specifications](../../specifications/test-data/overview.md). | ||||||
| 2. Fork the nf-core/test-datasets repository. | ||||||
| 3. Upload to the dedicated pipeline branch in a suitable location. | ||||||
| - (Recommended) Use the GitHub website upload function. | ||||||
|
Comment on lines
+102
to
+103
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the recommendation for using the web GUI?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So you don't have to clone the repo 😅 |
||||||
| 4. Edit the README of the dedicated pipeline branch describing how the file was generated. | ||||||
| - Include as much information as possible that could allow reconstruction of the file (for example, original source accession numbers or URLs, tool name and versions used to generate). | ||||||
| 5. Open a pull request and request a review on the nf-core [#request-review](https://nfcore.slack.com/archives/CQY2U5QU9) Slack channel. | ||||||
|
|
||||||
| ## Related documentation | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| - [nf-core/test-datasets](https://github.com/nf-core/test-datasets/) | ||||||
| - [Test data specifications](../../specifications/test-data/overview) | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.