Skip to content
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 stub and update test #16

Merged
merged 22 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ Please use the pre-filled template to save time.
However, don't be put off by this template - other more general issues and suggestions are welcome!
Contributions to the code are even more welcome ;)

:::info
If you need help using or modifying nf-core/reportho then the best place to ask is on the nf-core Slack [#reportho](https://nfcore.slack.com/channels/reportho) channel ([join our Slack here](https://nf-co.re/join/slack)).
:::
> [!NOTE]
> If you need help using or modifying nf-core/reportho then the best place to ask is on the nf-core Slack [#reportho](https://nfcore.slack.com/channels/reportho) channel ([join our Slack here](https://nf-co.re/join/slack)).

## Contribution workflow

Expand All @@ -27,8 +26,11 @@ If you're not used to this workflow with git, you can start with some [docs from

## Tests

You can optionally test your changes by running the pipeline locally. Then it is recommended to use the `debug` profile to
receive warnings about process selectors and other debug info. Example: `nextflow run . -profile debug,test,docker --outdir <OUTDIR>`.
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:

```bash
nf-test test --profile debug,test,docker --verbose
```

When you create a pull request with changes, [GitHub Actions](https://github.com/features/actions) will run automatic tests.
Typically, pull-requests are only fully reviewed when these tests are passing, though of course we can help out before then.
Expand Down Expand Up @@ -90,7 +92,7 @@ Once there, use `nf-core schema build` to add to `nextflow_schema.json`.

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/master/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.

The process resources can be passed on to the tool dynamically within the process with the `${task.cpu}` and `${task.memory}` variables in the `script:` block.
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.

### Naming schemes

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/repo
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/reportho/tree/master/.github/CONTRIBUTING.md)
- [ ] If necessary, also make a PR on the nf-core/reportho _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
- [ ] Make sure your code lints (`nf-core lint`).
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
- [ ] Ensure the test suite passes (`nf-test test main.nf.test -profile test,docker`).
- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir <OUTDIR>`).
- [ ] Usage Documentation in `docs/usage.md` is updated.
- [ ] Output Documentation in `docs/output.md` is updated.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install Nextflow
uses: nf-core/setup-nextflow@b9f764e8ba5c76b712ace14ecbfcef0e40ae2dd8 # v1
uses: nf-core/setup-nextflow@v1

- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnSave": true
}
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ process {
]
}

withName: 'FETCH_INSPECTOR_GROUP_LOCAL|FETCH_INSPECTOR_GROUP_ONLINE' {
withName: 'FETCH_INSPECTOR_GROUP_ONLINE' {
publishDir = [
path: { "${params.outdir}/orthologs/orthoinspector" },
mode: params.publish_dir_mode,
Expand Down
1 change: 1 addition & 0 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ params {
skip_iqtree = true
fastme_bootstrap = 0
}

Binary file modified docs/images/nf-core-reportho_logo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"utils_nfcore_pipeline": {
"branch": "master",
"git_sha": "262b17ed2aad591039f914951659177e6c39a8d8",
"git_sha": "92de218a329bfc9a9033116eb5f65fd270e72ba3",
"installed_by": ["subworkflows"]
},
"utils_nfvalidation_plugin": {
Expand Down
12 changes: 12 additions & 0 deletions modules/local/convert_fasta.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,16 @@ process CONVERT_FASTA {
Biopython: \$(pip show biopython | grep Version | cut -d ' ' -f 2)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.fa

cat <<- END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -d ' ' -f 2)
Biopython: \$(pip show biopython | grep Version | cut -d ' ' -f 2)
END_VERSIONS
"""
}
12 changes: 12 additions & 0 deletions modules/local/convert_phylip.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,16 @@ process CONVERT_PHYLIP {
Biopython: \$(pip show biopython | grep Version | cut -d ' ' -f 2)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.phy

cat <<- END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -d ' ' -f 2)
Biopython: \$(pip show biopython | grep Version | cut -d ' ' -f 2)
END_VERSIONS
"""
}
5 changes: 4 additions & 1 deletion modules/local/create_tcoffeetemplate.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ process CREATE_TCOFFEETEMPLATE {
prefix = task.ext.prefix ?: "${meta.id}"
"""
# Prep templates
for structure in \$(ls *.pdb); do id=`echo \$structure| awk {'gsub(".pdb", "", \$0); print'}`; echo -e ">"\$id "_P_" "\${id}" >>${prefix}_template.txt ; done
for structure in \$(ls *.pdb); do
id=`echo \$structure | awk {'gsub(".pdb", "", \$0); print'}`;
echo -e ">"\$id "_P_" "\${id}" >> ${prefix}_template.txt;
done
"""

stub:
Expand Down
26 changes: 19 additions & 7 deletions modules/local/dump_params.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ process DUMP_PARAMS {

input:
tuple val(meta), path(exact)
val uniprot_query
val use_structures
val use_centroid
val min_score
val skip_downstream
val use_iqtree
val use_fastme

output:
tuple val(meta), path("params.yml"), emit: params
Expand All @@ -19,14 +26,19 @@ process DUMP_PARAMS {
"""
cat <<- END_PARAMS > params.yml
id: ${meta.id}
uniprot_query: ${params.uniprot_query}
uniprot_query: ${uniprot_query}
exact_match: \$(cat $exact)
use_structures: ${params.use_structures}
use_centroid: ${params.use_centroid}
min_score: ${params.min_score}
skip_downstream: ${params.skip_downstream}
use_iqtree: ${params.use_iqtree}
use_fastme: ${params.use_fastme}
use_structures: ${use_structures}
use_centroid: ${use_centroid}
min_score: ${min_score}
skip_downstream: ${skip_downstream}
use_iqtree: ${use_iqtree}
use_fastme: ${use_fastme}
END_PARAMS
"""

stub:
"""
touch params.yml
"""
}
12 changes: 12 additions & 0 deletions modules/local/fetch_afdb_structures.nf
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,16 @@ process FETCH_AFDB_STRUCTURES {
Python Requests: \$(pip show requests | grep Version | cut -d ' ' -f 2)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.phy

cat <<- END_VERSIONS > versions.yml
"${task.process}"
Python: \$(python --version | cut -d ' ' -f 2)
Python Requests: \$(pip show requests | grep Version | cut -d ' ' -f 2)
END_VERSIONS
"""
}
16 changes: 16 additions & 0 deletions modules/local/fetch_eggnog_group_local.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ process FETCH_EGGNOG_GROUP_LOCAL {
tag "$meta.id"
label 'process_single'

conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' :
'biocontainers/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' }"

conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' :
Expand Down Expand Up @@ -33,4 +38,15 @@ process FETCH_EGGNOG_GROUP_LOCAL {
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_eggnog_group.txt
touch ${prefix}_eggnog_group.csv

cat <<- END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -f2)
END_VERSIONS
"""
}
13 changes: 13 additions & 0 deletions modules/local/fetch_inspector_group_online.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,17 @@ process FETCH_INSPECTOR_GROUP_ONLINE {
OrthoInspector Database: $inspector_version
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_inspector_group.csv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -d ' ' -f 2)
Python Requests: \$(pip show requests | grep Version | cut -d ' ' -f 2)
OrthoInspector Database: $inspector_version
END_VERSIONS
"""
}
15 changes: 15 additions & 0 deletions modules/local/fetch_oma_group_local.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ process FETCH_OMA_GROUP_LOCAL {
tag "$meta.id"
label 'process_single'

conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' :
'biocontainers/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' }"

conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' :
Expand Down Expand Up @@ -36,4 +41,14 @@ process FETCH_OMA_GROUP_LOCAL {
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_oma_group.csv

cat <<- END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -f2)
END_VERSIONS
"""
}
13 changes: 13 additions & 0 deletions modules/local/fetch_oma_group_online.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,17 @@ process FETCH_OMA_GROUP_ONLINE {
\$(get_oma_version.py)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_oma_group.csv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -d ' ' -f 2)
Python Requests: \$(pip show requests | grep Version | cut -d ' ' -f 2)
\$(get_oma_version.py)
END_VERSIONS
"""
}
16 changes: 16 additions & 0 deletions modules/local/fetch_panther_group_local.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ process FETCH_PANTHER_GROUP_LOCAL {
'https://depot.galaxyproject.org/singularity/python:3.10' :
'biocontainers/python:3.10' }"

conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' :
'biocontainers/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' }"

input:
tuple val(meta), path(uniprot_id), path(taxid), path(exact)
path panther_db
Expand All @@ -30,4 +35,15 @@ process FETCH_PANTHER_GROUP_LOCAL {
Python: \$(python --version | cut -f2)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_panther_group.csv

cat <<- END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -f2)
END_VERSIONS
"""
}
13 changes: 13 additions & 0 deletions modules/local/fetch_panther_group_online.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,17 @@ process FETCH_PANTHER_GROUP_ONLINE {
Panther Database: \$(cat panther_version.txt)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_panther_group.csv

cat <<- END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -d ' ' -f 2)
Python Requests: \$(pip show requests | grep Version | cut -d ' ' -f 2)
Panther Database: \$(cat panther_version.txt)
END_VERSIONS
"""
}
15 changes: 15 additions & 0 deletions modules/local/fetch_sequences_online.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,19 @@ process FETCH_SEQUENCES_ONLINE {
\$(get_oma_version.py)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_orthologs.fa
touch ${prefix}_seq_hits.txt
touch ${prefix}_seq_misses.txt

cat <<- END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -d ' ' -f 2)
Python Requests: \$(pip show requests | grep Version | cut -d ' ' -f 2)
\$(get_oma_version.py)
END_VERSIONS
"""
}
16 changes: 16 additions & 0 deletions modules/local/filter_fasta.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ process FILTER_FASTA {
tag "$meta.id"
label 'process_single'

conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' :
'biocontainers/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' }"

conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' :
Expand All @@ -27,4 +32,15 @@ process FILTER_FASTA {
Python: \$(python --version | cut -d ' ' -f 2)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_filtered.fa

cat <<- END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -f2)
END_VERSIONS
"""
}
13 changes: 13 additions & 0 deletions modules/local/filter_hits.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,17 @@ process FILTER_HITS {
Python: \$(python --version | cut -d ' ' -f 2)
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_minscore_000.txt
touch ${prefix}_centroid.txt
touch ${prefix}_filtered_hits.txt

cat <<- END_VERSIONS > versions.yml
"${task.process}":
Python: \$(python --version | cut -f2)
END_VERSIONS
"""
}
Loading
Loading