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

initial working version of refgenie integration #1090

Merged
merged 21 commits into from
Jul 6, 2022

Conversation

KevinMenden
Copy link
Contributor

Adding support for automatic updating of nextflow config files with a refgenie database.

If a refgenie database is used and updated, the update_config() function is triggered, which:

  • gets the refgenie configuration file
  • looks for the path to the refgenie_genomes.config file in the refgenie config file or in NXF_REFGENIE environment variable
  • if both are not given, defaults to $NXF_HOME/nf-core/refgenie_genomes.config
  • overwrites the refgenie_genomes.config with the latest refgenie database
  • adds an includeConfig statement to the $NXF_HOME/config file if not already existing

This is still very much a WIP, especially with respect to robustness/bugs.

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@KevinMenden KevinMenden added the WIP Work in progress label May 19, 2021
@codecov
Copy link

codecov bot commented May 19, 2021

Codecov Report

Merging #1090 (8e04b61) into dev (ee54b9f) will increase coverage by 0.22%.
The diff coverage is 76.00%.

@@            Coverage Diff             @@
##              dev    #1090      +/-   ##
==========================================
+ Coverage   64.68%   64.91%   +0.22%     
==========================================
  Files          55       56       +1     
  Lines        6338     6428      +90     
==========================================
+ Hits         4100     4173      +73     
- Misses       2238     2255      +17     
Impacted Files Coverage Δ
nf_core/refgenie.py 76.00% <76.00%> (ø)
nf_core/modules/modules_command.py 87.80% <0.00%> (+4.87%) ⬆️
nf_core/modules/module_test.py 54.79% <0.00%> (+6.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee54b9f...8e04b61. Read the comment docs.

@KevinMenden KevinMenden linked an issue May 20, 2021 that may be closed by this pull request
@nsheff
Copy link

nsheff commented May 21, 2021

Hey, this is great! One suggestion is to add a note into the NF_CFG_TEMPLATE, something like:

NF_CFG_TEMPLATE = """
# This is a read-only config file managed by refgenie. Manual changes to this file will be overwritten
# To make changes here, use refgenie to update the reference genome data
params {{
  genomes {{
{content}
  }}
}}
"""

@KevinMenden
Copy link
Contributor Author

Good idea thanks!

@KevinMenden KevinMenden marked this pull request as ready for review May 21, 2021 07:46
@ewels
Copy link
Member

ewels commented Jun 17, 2022

TODO:

  • Fix merge conficts
  • Get CI to pass
  • Test functionality
  • Merge ✅

Copy link
Member

@mirpedrol mirpedrol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with:

  1. Initialize refgenie: refgenie init -c refgenie-config.yml
    refgenie_genomes.config is created at ~/.nextflow/nf-core/refgenie_genomes.config
    an includeConfig statement is added at ~/.nextflow/config
  2. Download a new asset: refgenie pull t7/fasta -c refgenie-config.yml
    refgenie_genomes.config file is updated with the genome path

@ewels
Copy link
Member

ewels commented Jul 4, 2022

an includeConfig statement is added at ~/.nextflow/nf-core/config

I think this should be ~/.nextflow/config, no?

cf. https://www.nextflow.io/docs/latest/config.html#configuration-file

The config file $HOME/.nextflow/config

@mirpedrol
Copy link
Member

I think this should be ~/.nextflow/config, no?

It is! It was a typo in my comment. I edit the comment to avoid confusion, thanks for spotting it!

nf_core/refgenie.py Outdated Show resolved Hide resolved
nf_core/refgenie.py Outdated Show resolved Hide resolved
nf_core/refgenie.py Outdated Show resolved Hide resolved
nf_core/refgenie.py Outdated Show resolved Hide resolved
@ewels
Copy link
Member

ewels commented Jul 4, 2022

It is! It was a typo in my comment.

Yes I was looking for the error in the code and couldn't see it, so was beginning to wonder! 😅

@ewels
Copy link
Member

ewels commented Jul 5, 2022

Follow-on PR needed to document usage here: https://nf-co.re/docs/usage/reference_genomes

@mirpedrol mirpedrol removed the WIP Work in progress label Jul 6, 2022
@mirpedrol mirpedrol merged commit 65cb765 into nf-core:dev Jul 6, 2022
@ewels
Copy link
Member

ewels commented Jul 6, 2022

awesome

Can't believe it's finally merged! 👏🏻 🚀 🤩

Awesome work @KevinMenden @mirpedrol 😀

mirpedrol added a commit that referenced this pull request Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RefGenie - build local Nextflow config
5 participants