You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+154-4Lines changed: 154 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,9 @@ If you'd like to write some code for nf-core/eager, the standard workflow is as
18
18
1. Check that there isn't already an issue about your idea in the [nf-core/eager issues](https://github.com/nf-core/eager/issues) to avoid duplicating work
19
19
* If there isn't one already, please create one so that others know you're working on this
20
20
2.[Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [nf-core/eager repository](https://github.com/nf-core/eager) to your GitHub account
21
-
3. Make the necessary changes / additions within your forked repository
22
-
4. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged
21
+
3. Make the necessary changes / additions within your forked repository (following [code contribution guidelines](https://github.com/nf-core/eager/blob/dev/.github/CONTRIBUTING.md))
22
+
4. Use `nf-core schema build .` and add any new parameters to the pipeline JSON schema (requires nf-core tools >= 1.10).
23
+
5. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged
23
24
24
25
If you're not used to this workflow with git, you can start with some [docs from GitHub](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests) or even their [excellent `git` resources](https://try.github.io/).
25
26
@@ -46,12 +47,161 @@ These tests are run both with the latest available version of `Nextflow` and als
46
47
47
48
## Patch
48
49
49
-
:warning: Only in the unlikely and regretful event of a release happening with a bug.
50
+
:warning: Only in the unlikely and regretful event of a release happening with a bug.
50
51
51
52
* On your own fork, make a new branch `patch` based on `upstream/master`.
52
53
* Fix the bug, and bump version (X.Y.Z+1).
53
54
* A PR should be made on `master` from patch to directly this particular bug.
54
55
55
56
## Getting help
56
57
57
-
For further information/help, please consult the [nf-core/eager documentation](https://nf-co.re/nf-core/eager/docs) and don't hesitate to get in touch on the nf-core Slack [#eager](https://nfcore.slack.com/channels/eager) channel ([join our Slack here](https://nf-co.re/join/slack)).
58
+
For further information/help, please consult the [nf-core/eager documentation](https://nf-co.re/eager/latest/usage) and don't hesitate to get in touch on the nf-core Slack [#eager](https://nfcore.slack.com/channels/eager) channel ([join our Slack here](https://nf-co.re/join/slack)).
59
+
60
+
# Code Contribution Guidelines
61
+
62
+
To make the EAGER2 code and processing logic more understandable for new contributors, and to ensure quality. We are making an attempt to somewhat-standardise the way the code is written.
63
+
64
+
If you wish to contribute a new module, please use the following coding standards.
65
+
66
+
The typical workflow for adding a new module is as follows:
67
+
68
+
1. Define the corresponding input channel into your new process from the expected previous process channel (or re-routing block, see below).
69
+
2. Write the process block (see below).
70
+
3. Define the output channel if needed (see below).
71
+
4. Add any new flags/options to `nextflow.config` with a default (see below).
72
+
5. Add any new flags/options to `nextflow_schema.json` with help text (with `nf-core schema build .`)
73
+
6. Add any new flags/options to the help message (for integer/text parameters, print to help the corresponding `nextflow.config` parameter).
74
+
7. Add sanity checks for all relevant parameters.
75
+
8. Add any new software to the `scrape_software_versions.py` script in `bin/` and the version command to the `scrape_software_versions` process in `main.nf`.
76
+
9. Do local tests that the new code works properly and as expected.
77
+
10. Add a new test command in `.github/workflow/ci.yaml`.
78
+
11. If applicable add a [MultiQC](https://https://multiqc.info/) module.
79
+
12. Update MultiQC config `assets/multiqc_config.yaml` so relevant suffixes, name clean up, General Statistics Table column order, and module figures are in the right order.
80
+
13. Add new flags/options to 'usage' documentation under `docs/usage.md`.
81
+
14. Add any descriptions of MultiQC report sections and output files to `docs/output.md`.
82
+
83
+
## Default Values
84
+
85
+
Default values should go in `nextflow.config` under the `params` scope, and `nextflow_schema.json` (latter with `nf-core schema build .`)
86
+
87
+
## Default resource processes
88
+
89
+
Defining recommended 'minimum' resource requirements (CPUs/Memory) for a process should be defined in `conf/base.config`. This can be utilised within the process using `${task.cpu}` or `${task.memory}` variables in the `script:` block.
90
+
91
+
## Process Concept
92
+
93
+
We are providing a highly configurable pipeline, with many options to turn on and off different processes in different combinations. This can make a very complex graph structure that can cause a large amount of duplicated channels coming out of every process to account for each possible combination.
94
+
95
+
The EAGER pipeline can currently be broken down into the following 'stages', where a stage is a collection of non-terminal mutually exclusive processes, which is the output of which is used for another file reporting module (but not reporting!) .
96
+
97
+
* Input
98
+
* Convert BAM
99
+
* PolyG Clipping
100
+
* AdapterRemoval
101
+
* Mapping (either `bwa`, `bwamem`, or `circularmapper`)
102
+
* BAM Filtering
103
+
* Deduplication (either `dedup` or `markduplicates`)
104
+
* BAM Trimming
105
+
* PMDtools
106
+
* Genotyping
107
+
108
+
Every step can potentially be skipped, therefore the output of a previous stage must be able to be passed to the next stage, if the given stage is not run.
109
+
110
+
To somewhat simplify this logic, we have implemented the following structure.
111
+
112
+
The concept is as follows:
113
+
114
+
* Every 'stage' of the pipeline (i.e. collection of mutually exclusive processes) must always have a if else statement following it.
115
+
* This if else 'bypass' statement collects and standardises all possible input files into single channel(s) for the next stage.
116
+
* Importantly - within the bypass statement, a channel from the previous stage's bypass mixes into these output channels. This additional channel is named `ch_previousstage_for_skipcurrentstage`. This contains the output from the previous stage, i.e. not the modified version from the current stage.
117
+
* The bypass statement works as follows:
118
+
* If the current stage is turned on: will mix the previous stage and current stage output and filter for file suffixes unique to the current stage output
119
+
* If the current stage is turned off or skipped: will mix the previous stage and current stage output. However as there there is no files in the output channel from the current stage, no filtering is required and the files in the 'ch_XXX_for_skipXXX' stage will be used.
120
+
121
+
This ensures the same channel inputs to the next stage is 'homogeneous' - i.e. all comes from the same source (the bypass statement)
<YOUR_TOOL> --help | head -n 1 &> v_<YOUR_TOOL>.txt 2>&1||true
194
+
```
195
+
196
+
You then need to edit the script `bin/scrape_software_versions.py` to
197
+
198
+
1. add a (python) regex for your tools --version output (as in stored in the `v_<YOUR_TOOL>.txt` file), to ensure the version is reported as a `v` and the version number e.g. `v2.1.1`
199
+
2. add a HTML block entry to the `OrderedDict` for formatting in MultiQC.
200
+
201
+
> If a tool does not unfortunately offer any printing of version data, you may add this 'manually' e.g. with `echo "v1.1" > v_<YOUR_TOOL>.txt`
202
+
203
+
## Images and Figures
204
+
205
+
For all internal nf-core/eager documentation images we are using the 'Kalam' font by the Indian Type Foundry and licensed under the Open Font License. It can be found for download here [here](https://fonts.google.com/specimen/Kalam).
206
+
207
+
For the overview image we follow the nf-core [style guidelines](https://nf-co.re/developers/design_guidelines).
0 commit comments