Skip to content
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
3 changes: 2 additions & 1 deletion .github/workflows/workflow_json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request_target:
branches:
- dev
paths-ignore:
- "assets/workflow_jsons/**"

concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
Expand All @@ -12,7 +14,6 @@ concurrency:
jobs:
generate-workflow-json:
name: Create workflow JSON using bioflow-insight
if: github.actor != 'nf-core-bot'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
Expand Down
2 changes: 1 addition & 1 deletion .nf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ lint:
- .github/CONTRIBUTING.md
actions_schema_validation: false
multiqc_config: false
nf_core_version: 3.5.1
nf_core_version: 3.5.2
repository_type: pipeline
template:
author: Athanasios Baltzis, Jose Espinosa-Carrasco, Harshil Patel
Expand Down
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Enhancements & fixes

- [[PR ##573](https://github.com/nf-core/proteinfold/pull/573)] - Adds affiliations for UNSW Structural Biology Facility (SBF).
- [[PR #588](https://github.com/nf-core/proteinfold/pulls/588)] - Add `--random_seed` for AF2, Boltz, and ColabFold, removing and replacing `--alphafold2_random_seed`.

| Old parameter | New parameter |
| ------------- | ------------- |
| | |
| Old parameter | New parameter |
| -------------------------- | --------------- |
| `--alphafold2_random_seed` | `--random_seed` |

> **NB:** Parameter has been **updated** if both old and new parameter information is present.
> **NB:** Parameter has been **added** if just the new parameter information is present.
Expand Down
96 changes: 48 additions & 48 deletions assets/workflow_jsons/metro_map.json

Large diffs are not rendered by default.

638 changes: 319 additions & 319 deletions assets/workflow_jsons/process_dependency_graph.json

Large diffs are not rendered by default.

12,268 changes: 6,134 additions & 6,134 deletions assets/workflow_jsons/specification_graph.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions conf/modules_alphafold2.config
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ process {
ext.args = [
params.use_gpu ? '--use_gpu_relax=true' : '--use_gpu_relax=false',
params.alphafold2_max_template_date ? "--max_template_date ${params.alphafold2_max_template_date}" : '',
params.alphafold2_random_seed ? "--random_seed=${params.alphafold2_random_seed}" : ''
params.random_seed != null ? "--random_seed=${params.random_seed}" : ''
].join(' ').trim()
publishDir = [
[
Expand Down Expand Up @@ -156,7 +156,7 @@ process {
}
ext.args = [
params.use_gpu ? '--use_gpu_relax=true' : '--use_gpu_relax=false',
params.alphafold2_random_seed ? "--random_seed=${params.alphafold2_random_seed}" : ''
params.random_seed != null ? "--random_seed=${params.random_seed}" : ''
].join(' ').trim()
publishDir = [
[
Expand Down
1 change: 1 addition & 0 deletions conf/modules_boltz.config
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ process {
}
ext.args = [
params.boltz_model ? "--model ${params.boltz_model}" : "",
params.random_seed != null ? "--seed ${params.random_seed}" : "",
params.use_msa_server ? "--use_msa_server" : "",
params.msa_server_url ? "--msa_server_url ${params.msa_server_url}" : "",
params.boltz_use_potentials ? "--use_potentials" : "",
Expand Down
2 changes: 1 addition & 1 deletion conf/modules_colabfold.config
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ process {
if (params.use_gpu) {
accelerator = 1
}

ext.args = [
params.colabfold_use_gpu_relax ? '--use-gpu-relax' : '',
params.colabfold_use_amber ? '--amber' : '',
params.colabfold_use_templates ? '--templates' : '',
params.random_seed != null ? "--random-seed ${params.random_seed}" : '',
params.use_msa_server && params.msa_server_url ? "--host-url ${params.msa_server_url}" : ''
].join(' ').trim()
publishDir = [
Expand Down
12 changes: 12 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ Alternatively, the required data layout for each of the individual modes is desc

> Omitting the `--db` flag will allow the pipeline to download the reference data required to execute the selected modes.

## Random Seeds
Comment thread
jscgh marked this conversation as resolved.

The pipeline-wide `--random_seed` parameter can be used to set the same seed for `alphafold2`, `boltz`, and `colabfold` modes only.

If no seed is explicitly provided, each mode keeps its native default behaviour:

- `alphafold2`: AlphaFold2 generates a random seed internally.
- `boltz`: Boltz leaves the seed unset (`--seed` is not passed).
- `colabfold`: ColabFold defaults to `--random-seed 0`.

For reproducible results between runs, it is recommended to set an explicit seed.

## Foldseek structural similarity search

The pipeline can run an optional Foldseek `easy-search` step on the top-ranked structure for each input/mode combination.
Expand Down
1 change: 0 additions & 1 deletion docs/usage/alphafold2.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ See the [AlphaFold2](https://github.com/google-deepmind/alphafold) documentation
| Parameter | Default | Description |
| -------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--alphafold2_full_dbs` | `false` | bfd is a large environmental sequence database used to identify homologs. small bfd is a redundancy recuced version of the bfd database which can reduce the execution time of homolog search but may reduce the depth of the resulting MSA in some cases. `--alphafold2_full_dbs` ensures that the full version of bfd is used for search. |
| `--alphafold2_random_seed` | `null` | AlphaFold2 model inference is a stochastic process. Fixing a numerical random seed ensures that results are reproducible between runs |
| `--alphafold2_max_template_date` | `2038-01-19` | Structural templates from the PDB are used as additional context when making predictions. Molecules with solved structures in the PDB can be trivially predicted by using these structures as inputs. When benchmarking model performance it can be useful to restrict the use of templates to those deposited before a fixed date to ensure solved structures do not bias predictions. |
| `--alphafold2_params_prefix` | `alphafold_params_2022-12-06` | Specify the alphafold2 params used for prediction |
| `--alphafold2_model_preset` | `monomer_ptm` | Specify the alphafold2 monomer preset used for prediction. |
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ params {
use_msa_server = false
msa_server_url = null
uniref30_prefix = null
random_seed = null

// Alphafold2 parameters
alphafold2_mode = 'split_msa_prediction' // {standard, split_msa_prediction}
alphafold2_max_template_date = '2038-01-19'
alphafold2_full_dbs = null // true full_dbs, false reduced_dbs
alphafold2_model_preset = 'monomer_ptm' // single-entry FASTA only: {monomer, monomer_casp14, monomer_ptm}
alphafold2_db = null
alphafold2_random_seed = null

// Alphafold2 links
alphafold2_bfd_link = null
Expand Down
8 changes: 4 additions & 4 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
"description": "Use the cloud MSA server",
"icon": "fas folder-open"
},
"random_seed": {
"type": "integer",
"description": "Global random seed for modules that natively support explicit seeding: alphafold2, boltz, and colabfold."
},
"msa_server_url": {
"type": "string",
"description": "Specify your custom MMSeqs2 API server url",
Expand Down Expand Up @@ -134,10 +138,6 @@
"enum": ["monomer", "monomer_casp14", "monomer_ptm"],
"fa_icon": "fas fa-stream"
},
"alphafold2_random_seed": {
"type": "integer",
"description": "Random seed to control stochastic alphafold inference."
},
"alphafold2_params_prefix": {
"type": "string",
"default": "alphafold_params_2022-12-06",
Expand Down
22 changes: 21 additions & 1 deletion subworkflows/local/utils_nfcore_proteinfold_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ ${colors.purple} nf-core/proteinfold ${workflow.manifest.version}${colors.reset
nextflow_cli_args
)

validateInputParameters()

//
// Create channel from input file provided through input
//
Expand Down Expand Up @@ -189,9 +191,15 @@ workflow PIPELINE_COMPLETION {
// Check and validate pipeline parameters
//
def validateInputParameters() {
if (params.mode.toLowerCase().split(",").contains("alphafold3")) {
def requestedModes = params.mode.toLowerCase().split(",")*.trim()

if (requestedModes.contains("alphafold3")) {
alphafold3Warn(log)
}

if (params.random_seed != null) {
randomSeedModeWarn(log, requestedModes)
}
}

def modeChannel(ch, mode) {
Expand Down Expand Up @@ -310,3 +318,15 @@ def alphafold3Warn(log) {
" More information here: \"https://github.com/google-deepmind/alphafold3/blob/main/README.md#alphafold-3-source-code-and-model-parameters.\"\n" +
"==================================================================================="
}

def randomSeedModeWarn(log, requestedModes) {
def supportedModes = ['alphafold2', 'boltz', 'colabfold'] as Set
def unsupportedModes = requestedModes.findAll { !supportedModes.contains(it) }.unique().sort()

if (!unsupportedModes.isEmpty()) {
log.warn "=============================================================================\n" +
" The global --random_seed parameter only applies to alphafold2, boltz, and colabfold.\n" +
" It will be ignored for the following selected mode(s): ${unsupportedModes.join(', ')}.\n" +
"==================================================================================="
}
}
Loading