nf-core / nf-core/proteinfold

PREPARE_COMMON_DBS() - simplify main.nf by ~30%

Open
#575 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
HTML
Stars
115
Forks
75
PR merge metrics
No merged PRs in 30d

Description

Description of feature

Currently main.nf is dominated by PREPARE_[MODE]_DBS() subworkflows that share lots of commonality in used databases (shown after the jump).

If there was a PREPARE_COMMON_DBS() run once at the top, you can:

  1. Make main.nf easier for new contributors to read
  2. Highlight exactly where different modes differ in custom DB requirements
  3. Massively shrink the size of the actual /subworkflows/local/prepare_[mode]_db.nf files to again just what's required from that database.

So we now have

PREPARE_COMMON_DBS(uniref30, uniref90, mgnify, pdb_mmcif, bfd, pdb_seqres, uniprot, pdb100)
PREPARE_ALPHAFOLD2_DBS(COMMON_DBS.out,  params.alphafold2_small_bfd_path, params.alphafold2_pdb70_path, ....)
PREPARE_HELIXFOLD3_DBS(COMMON_DBS.out, params.helixfold3_rfam_path, params.helixfold3_maxit_src_link ...)

More compact, less code to add new modes, but also highlights what's unique and might need custom handling.

If #203 is implemented, then we have fewer lines of code to look at downstream.
Hard support for a separate database DL subworkflow, it's time-consuming and should be separate from prediction.


main.nf DB subworkflow repetition

 PREPARE_ALPHAFOLD2_DBS (
            params.alphafold2_db,
            params.alphafold2_full_dbs,
            params.alphafold2_bfd_path,
            params.alphafold2_small_bfd_path,
            params.alphafold2_params_path,
            params.alphafold2_mgnify_path,
            params.alphafold2_pdb70_path,
            params.alphafold2_pdb_mmcif_path,
            params.alphafold2_pdb_obsolete_path,
            params.alphafold2_uniref30_path,
            params.alphafold2_uniref90_path,
            params.alphafold2_pdb_seqres_path,
            params.alphafold2_uniprot_path,
            params.alphafold2_bfd_link,
            params.alphafold2_small_bfd_link,
            params.alphafold2_params_link,
            params.alphafold2_mgnify_link,
            params.alphafold2_pdb70_link,
            params.alphafold2_pdb_mmcif_link,
            params.alphafold2_pdb_obsolete_link,
            params.alphafold2_uniref30_link,
            params.alphafold2_uniref90_link,
            params.alphafold2_pdb_seqres_link,
            params.alphafold2_uniprot_sprot_link,
            params.alphafold2_uniprot_trembl_link
        )
 PREPARE_HELIXFOLD3_DBS (
            params.helixfold3_db,
            params.helixfold3_uniclust30_link,
            params.helixfold3_ccd_preprocessed_link,
            params.helixfold3_rfam_link,
            params.helixfold3_init_models_link,
            params.helixfold3_bfd_link,
            params.helixfold3_small_bfd_link,
            params.helixfold3_uniprot_sprot_link,
            params.helixfold3_uniprot_trembl_link,
            params.helixfold3_pdb_seqres_link,
            params.helixfold3_uniref90_link,
            params.helixfold3_mgnify_link,
            params.helixfold3_pdb_mmcif_link,
            params.helixfold3_obsolete_link,
            params.helixfold3_maxit_src_link,
            params.helixfold3_uniclust30_path,
            params.helixfold3_ccd_preprocessed_path,
            params.helixfold3_rfam_path,
            params.helixfold3_init_models_path,
            params.helixfold3_bfd_path,
            params.helixfold3_small_bfd_path,
            params.helixfold3_uniprot_path,
            params.helixfold3_pdb_seqres_path,
            params.helixfold3_uniref90_path,
            params.helixfold3_mgnify_path,
            params.helixfold3_pdb_mmcif_path,
            params.helixfold3_obsolete_path,
            params.helixfold3_maxit_src_path
        )

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in main.nf by comparing the repeated PREPARE_[MODE]DBS() calls and then inspect /subworkflows/local/prepare[mode]_db.nf for shared database handling. Refactor the common inputs into PREPARE_COMMON_DBS() and pass its output to each mode-specific subworkflow, leaving only custom database requirements in those files; done means main.nf and the mode subworkflows are substantially smaller without losing required inputs.

Written by the indexing model from the issue text.

Assessment

Domain
bioinformatics
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.