Skip to content

Commit 42f6a0f

Browse files
1st attempt to create module :(
1 parent ab9ddf8 commit 42f6a0f

96 files changed

Lines changed: 31654 additions & 33 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
{
22
"name": "nfcore",
3-
"image": "nfcore/gitpod:dev",
3+
"image": "nfcore/gitpod:latest",
44
"remoteUser": "gitpod",
55
"runArgs": ["--privileged"],
6+
67
// Configure tool-specific properties.
78
"customizations": {
89
// Configure properties specific to VS Code.
910
"vscode": {
1011
// Set *default* container specific settings.json values on container create.
1112
"settings": {
12-
"python.defaultInterpreterPath": "/opt/conda/bin/python",
13-
"python.linting.enabled": true
13+
"python.defaultInterpreterPath": "/opt/conda/bin/python"
1414
},
1515

1616
// Add the IDs of extensions you want installed when the container is created.
17-
"extensions": ["nf-core.nf-core-extensionpack"]
18-
}
19-
},
20-
"features": {
21-
"ghcr.io/devcontainers/features/github-cli:1.0.11": {
22-
"digest": "sha256:464564228ccdd6028f01f8a62a3cfbaf76e9ba7953b29ac0e53ba2c262604312"
23-
},
24-
"ghcr.io/devcontainers/features/docker-in-docker:2.9.2": {
25-
"digest": "sha256:9074d8eaf4585ab1498c81a8762078992725614fc7a9cfafe799aa22717a6bbf"
17+
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"]
2618
}
2719
}
2820
}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
*.config linguist-language=nextflow
2+
*.nf.test linguist-language=nextflow
3+
modules/nf-core/** linguist-generated
4+
subworkflows/nf-core/** linguist-generated

.github/.dockstore.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Dockstore config version, not pipeline version
2+
version: 1.2
3+
workflows:
4+
- subclass: nfl
5+
primaryDescriptorPath: /nextflow.config
6+
publish: True

.github/CONTRIBUTING.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# `nf-core/transcriptclean`: Contributing Guidelines
2+
3+
Hi there!
4+
Many thanks for taking an interest in improving nf-core/transcriptclean.
5+
6+
We try to manage the required tasks for nf-core/transcriptclean using GitHub issues, you probably came to this page when creating one.
7+
Please use the pre-filled template to save time.
8+
9+
However, don't be put off by this template - other more general issues and suggestions are welcome!
10+
Contributions to the code are even more welcome ;)
11+
12+
> [!NOTE]
13+
> If you need help using or modifying nf-core/transcriptclean then the best place to ask is on the nf-core Slack [#transcriptclean](https://nfcore.slack.com/channels/transcriptclean) channel ([join our Slack here](https://nf-co.re/join/slack)).
14+
15+
## Contribution workflow
16+
17+
If you'd like to write some code for nf-core/transcriptclean, the standard workflow is as follows:
18+
19+
1. Check that there isn't already an issue about your idea in the [nf-core/transcriptclean issues](https://github.com/nf-core/transcriptclean/issues) to avoid duplicating work. If there isn't one already, please create one so that others know you're working on this
20+
2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [nf-core/transcriptclean repository](https://github.com/nf-core/transcriptclean) to your GitHub account
21+
3. Make the necessary changes / additions within your forked repository following [Pipeline conventions](#pipeline-contribution-conventions)
22+
4. Use `nf-core pipelines schema build` and add any new parameters to the pipeline JSON schema (requires [nf-core tools](https://github.com/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
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/).
26+
27+
## Tests
28+
29+
You have the option to test your changes locally by running the pipeline. For receiving warnings about process selectors and other `debug` information, it is recommended to use the debug profile. Execute all the tests with the following command:
30+
31+
```bash
32+
nf-test test --profile debug,test,docker --verbose
33+
```
34+
35+
When you create a pull request with changes, [GitHub Actions](https://github.com/features/actions) will run automatic tests.
36+
Typically, pull-requests are only fully reviewed when these tests are passing, though of course we can help out before then.
37+
38+
There are typically two types of tests that run:
39+
40+
### Lint tests
41+
42+
`nf-core` has a [set of guidelines](https://nf-co.re/developers/guidelines) which all pipelines must adhere to.
43+
To enforce these and ensure that all pipelines stay in sync, we have developed a helper tool which runs checks on the pipeline code. This is in the [nf-core/tools repository](https://github.com/nf-core/tools) and once installed can be run locally with the `nf-core pipelines lint <pipeline-directory>` command.
44+
45+
If any failures or warnings are encountered, please follow the listed URL for more documentation.
46+
47+
### Pipeline tests
48+
49+
Each `nf-core` pipeline should be set up with a minimal set of test-data.
50+
`GitHub Actions` then runs the pipeline on this data to ensure that it exits successfully.
51+
If there are any failures then the automated tests fail.
52+
These tests are run both with the latest available version of `Nextflow` and also the minimum required version that is stated in the pipeline code.
53+
54+
## Patch
55+
56+
:warning: Only in the unlikely and regretful event of a release happening with a bug.
57+
58+
- On your own fork, make a new branch `patch` based on `upstream/main` or `upstream/master`.
59+
- Fix the bug, and bump version (X.Y.Z+1).
60+
- Open a pull-request from `patch` to `main`/`master` with the changes.
61+
62+
## Getting help
63+
64+
For further information/help, please consult the [nf-core/transcriptclean documentation](https://nf-co.re/transcriptclean/usage) and don't hesitate to get in touch on the nf-core Slack [#transcriptclean](https://nfcore.slack.com/channels/transcriptclean) channel ([join our Slack here](https://nf-co.re/join/slack)).
65+
66+
## Pipeline contribution conventions
67+
68+
To make the `nf-core/transcriptclean` code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written.
69+
70+
### Adding a new step
71+
72+
If you wish to contribute a new step, please use the following coding standards:
73+
74+
1. Define the corresponding input channel into your new process from the expected previous process channel.
75+
2. Write the process block (see below).
76+
3. Define the output channel if needed (see below).
77+
4. Add any new parameters to `nextflow.config` with a default (see below).
78+
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core pipelines schema build` tool).
79+
6. Add sanity checks and validation for all relevant parameters.
80+
7. Perform local tests to validate that the new code works as expected.
81+
8. If applicable, add a new test in the `tests` directory.
82+
83+
### Default values
84+
85+
Parameters should be initialised / defined with default values within the `params` scope in `nextflow.config`.
86+
87+
Once there, use `nf-core pipelines schema build` to add to `nextflow_schema.json`.
88+
89+
### Default processes resource requirements
90+
91+
Sensible defaults for process resource requirements (CPUs / memory / time) for a process should be defined in `conf/base.config`. These should generally be specified generic with `withLabel:` selectors so they can be shared across multiple processes/steps of the pipeline. A nf-core standard set of labels that should be followed where possible can be seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/main/nf_core/pipeline-template/conf/base.config), which has the default process as a single core-process, and then different levels of multi-core configurations for increasingly large memory requirements defined with standardised labels.
92+
93+
The process resources can be passed on to the tool dynamically within the process with the `${task.cpus}` and `${task.memory}` variables in the `script:` block.
94+
95+
### Naming schemes
96+
97+
Please use the following naming schemes, to make it easy to understand what is going where.
98+
99+
- initial process channel: `ch_output_from_<process>`
100+
- intermediate and terminal channels: `ch_<previousprocess>_for_<nextprocess>`
101+
102+
### Nextflow version bumping
103+
104+
If you are using a new feature from core Nextflow, you may bump the minimum required version of nextflow in the pipeline with: `nf-core pipelines bump-version --nextflow . [min-nf-version]`
105+
106+
### Images and figures
107+
108+
For overview images and other documents we follow the nf-core [style guidelines and examples](https://nf-co.re/developers/design_guidelines).
109+
110+
## GitHub Codespaces
111+
112+
This repo includes a devcontainer configuration which will create a GitHub Codespaces for Nextflow development! This is an online developer environment that runs in your browser, complete with VSCode and a terminal.
113+
114+
To get started:
115+
116+
- Open the repo in [Codespaces](https://github.com/nf-core/transcriptclean/codespaces)
117+
- Tools installed
118+
- nf-core
119+
- Nextflow
120+
121+
Devcontainer specs:
122+
123+
- [DevContainer config](.devcontainer/devcontainer.json)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Bug report
2+
description: Report something that is broken or incorrect
3+
labels: bug
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Before you post this issue, please check the documentation:
9+
10+
- [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting)
11+
- [nf-core/transcriptclean pipeline documentation](https://nf-co.re/transcriptclean/usage)
12+
- type: textarea
13+
id: description
14+
attributes:
15+
label: Description of the bug
16+
description: A clear and concise description of what the bug is.
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: command_used
22+
attributes:
23+
label: Command used and terminal output
24+
description: Steps to reproduce the behaviour. Please paste the command you used to launch the pipeline and the output from your terminal.
25+
render: console
26+
placeholder: |
27+
$ nextflow run ...
28+
29+
Some output where something broke
30+
31+
- type: textarea
32+
id: files
33+
attributes:
34+
label: Relevant files
35+
description: |
36+
Please drag and drop the relevant files here. Create a `.zip` archive if the extension is not allowed.
37+
Your verbose log file `.nextflow.log` is often useful _(this is a hidden file in the directory where you launched the pipeline)_ as well as custom Nextflow configuration files.
38+
39+
- type: textarea
40+
id: system
41+
attributes:
42+
label: System information
43+
description: |
44+
* Nextflow version _(eg. 23.04.0)_
45+
* Hardware _(eg. HPC, Desktop, Cloud)_
46+
* Executor _(eg. slurm, local, awsbatch)_
47+
* Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter, Charliecloud, or Apptainer)_
48+
* OS _(eg. CentOS Linux, macOS, Linux Mint)_
49+
* Version of nf-core/transcriptclean _(eg. 1.1, 1.5, 1.8.2)_

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
contact_links:
2+
- name: Join nf-core
3+
url: https://nf-co.re/join
4+
about: Please join the nf-core community here
5+
- name: "Slack #transcriptclean channel"
6+
url: https://nfcore.slack.com/channels/transcriptclean
7+
about: Discussion about the nf-core/transcriptclean pipeline
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Feature request
2+
description: Suggest an idea for the nf-core/transcriptclean pipeline
3+
labels: enhancement
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description of feature
9+
description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered.
10+
validations:
11+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
# nf-core/transcriptclean pull request
3+
4+
Many thanks for contributing to nf-core/transcriptclean!
5+
6+
Please fill in the appropriate checklist below (delete whatever is not relevant).
7+
These are the most common things requested on pull requests (PRs).
8+
9+
Remember that PRs should be made against the dev branch, unless you're preparing a pipeline release.
10+
11+
Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/transcriptclean/tree/main/.github/CONTRIBUTING.md)
12+
-->
13+
14+
## PR checklist
15+
16+
- [ ] This comment contains a description of changes (with reason).
17+
- [ ] If you've fixed a bug or added code that should be tested, add tests!
18+
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/transcriptclean/tree/main/.github/CONTRIBUTING.md)
19+
- [ ] If necessary, also make a PR on the nf-core/transcriptclean _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
20+
- [ ] Make sure your code lints (`nf-core pipelines lint`).
21+
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
22+
- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir <OUTDIR>`).
23+
- [ ] Usage Documentation in `docs/usage.md` is updated.
24+
- [ ] Output Documentation in `docs/output.md` is updated.
25+
- [ ] `CHANGELOG.md` is updated.
26+
- [ ] `README.md` is updated (including new tool citations and authors/contributors).
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Get number of shards"
2+
description: "Get the number of nf-test shards for the current CI job"
3+
inputs:
4+
max_shards:
5+
description: "Maximum number of shards allowed"
6+
required: true
7+
paths:
8+
description: "Component paths to test"
9+
required: false
10+
tags:
11+
description: "Tags to pass as argument for nf-test --tag parameter"
12+
required: false
13+
outputs:
14+
shard:
15+
description: "Array of shard numbers"
16+
value: ${{ steps.shards.outputs.shard }}
17+
total_shards:
18+
description: "Total number of shards"
19+
value: ${{ steps.shards.outputs.total_shards }}
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Install nf-test
24+
uses: nf-core/setup-nf-test@v1
25+
with:
26+
version: ${{ env.NFT_VER }}
27+
- name: Get number of shards
28+
id: shards
29+
shell: bash
30+
run: |
31+
# Run nf-test with dynamic parameter
32+
nftest_output=$(nf-test test \
33+
--profile +docker \
34+
$(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \
35+
--dry-run \
36+
--ci \
37+
--changed-since HEAD^) || {
38+
echo "nf-test command failed with exit code $?"
39+
echo "Full output: $nftest_output"
40+
exit 1
41+
}
42+
echo "nf-test dry-run output: $nftest_output"
43+
44+
# Default values for shard and total_shards
45+
shard="[]"
46+
total_shards=0
47+
48+
# Check if there are related tests
49+
if echo "$nftest_output" | grep -q 'No tests to execute'; then
50+
echo "No related tests found."
51+
else
52+
# Extract the number of related tests
53+
number_of_shards=$(echo "$nftest_output" | sed -n 's|.*Executed \([0-9]*\) tests.*|\1|p')
54+
if [[ -n "$number_of_shards" && "$number_of_shards" -gt 0 ]]; then
55+
shards_to_run=$(( $number_of_shards < ${{ inputs.max_shards }} ? $number_of_shards : ${{ inputs.max_shards }} ))
56+
shard=$(seq 1 "$shards_to_run" | jq -R . | jq -c -s .)
57+
total_shards="$shards_to_run"
58+
else
59+
echo "Unexpected output format. Falling back to default values."
60+
fi
61+
fi
62+
63+
# Write to GitHub Actions outputs
64+
echo "shard=$shard" >> $GITHUB_OUTPUT
65+
echo "total_shards=$total_shards" >> $GITHUB_OUTPUT
66+
67+
# Debugging output
68+
echo "Final shard array: $shard"
69+
echo "Total number of shards: $total_shards"

0 commit comments

Comments
 (0)