-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add documentation for using cross-organisational components #2816
Draft
jvfe
wants to merge
6
commits into
nf-core:main
Choose a base branch
from
sanger-tol:cross-org-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+62
−0
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0d3dd52
tutorials: Add cross-org tutorial
jvfe 42b84a7
tools: Add note about cross-org subwfs in install
jvfe 44777b7
Merge pull request #1 from sanger-tol/cross-org-draft
jvfe 9df0918
Merge branch 'main' into cross-org-docs
jvfe eade522
fix: Use correct quotes in yaml metadata
jvfe 8128927
Apply suggestions from code review
jvfe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
.../src/content/docs/tutorials/external_usage/cross_organisational_subworkflows.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: 'Using subworkflows with modules from multiple organisations' | ||
subtitle: Guidance on how to use nf-core/tools with subworkflows that use modules from more than one organisation. | ||
--- | ||
|
||
In order to use cross-organisational subworkflows, you can specify individual remotes to be used for each module within the `meta.yml` | ||
file in that subworkflow. | ||
|
||
For example, let's say you have a subworkflow in your own organisation's `modules` repository that uses FastQC and fastp. | ||
But, instead of using the fastp module from your own organisation, you want to use nf-core's fastp module. This is the case for the `fastq_trim_fastp_fastqc` subworkflow in the [nf-core-test](https://github.com/nf-core-test/modules/) organization. | ||
|
||
In order to have this subworkflow, with a FastQC module from your organisation and fastp from nf-core, you'd define the | ||
components section of this subworkflow's `meta.yml` file as such: | ||
|
||
```yaml title="meta.yml" {11-12} | ||
name: 'fastq_trim_fastp_fastqc' | ||
description: Read QC, fastp trimming and read qc | ||
keywords: | ||
- qc | ||
- quality_control | ||
- adapters | ||
- trimming | ||
- fastq | ||
components: | ||
- fastqc | ||
- fastp: | ||
git_remote: https://github.com/nf-core/modules.git | ||
``` | ||
|
||
By using the structure above, `nf-core/tools` knows that it should install FastQC from the same repository that the subworkflow is located | ||
in, but fastp should come from the `nf-core/modules` remote. | ||
|
||
:::note | ||
Be aware that to install subworkflows from organisations other than nf-core you must | ||
specify `--git-remote` in the `nf-core subworkflows` command, e.g. `nf-core subworkflows install fastq_trim_fastp_fastqc --git-remote $ORG_NAME{:bash}` | ||
::: | ||
|
||
If you're using cross-organisational subworkflows in your repository, be aware that you must also specify a different JSON schema | ||
to lint the `meta.yml` files for your subworkflows. | ||
To do this, just change the `components` section type to allow both objects and strings. | ||
|
||
```json | ||
"components": { | ||
"type": "array", | ||
"description": "Modules and subworkflows used in the subworkflow", | ||
"items": { | ||
"type": ["object", "string"] | ||
}, | ||
"minItems": 0 | ||
}, | ||
``` | ||
|
||
:::tip | ||
To get the full content for the schema, see the corresponding | ||
file in the [nf-core-test](https://github.com/nf-core-test/modules/) modules repository. | ||
::: |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think it's easier to just add these changes to the schema in the modules repo
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.
It won`t be added to the main modules repo, I believe, but I am adding it to the nf-core-test repo. I can remove this section and just link to the file there.