-
Notifications
You must be signed in to change notification settings - Fork 0
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 method to store params #43
Conversation
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.
The functionality looks great!
It took me a bit to figure out that I needed to pass a File
object and not a path string, though - this could use a documentation snippet, particularly if we want to standardize how we use this. Modifying a pipeline's methods.config
like so worked well for me and seems like a reasonable standard:
--- a/config/methods.config
+++ b/config/methods.config
@@ -1,5 +1,6 @@
includeConfig "${projectDir}/external/pipeline-Nextflow-config/config/methods/common_methods.config"
includeConfig "${projectDir}/external/pipeline-Nextflow-config/config/schema/schema.config"
+includeConfig "${projectDir}/external/pipeline-Nextflow-config/config/store_params/store_params.config"
methods {
// Set the output and log output dirs here.
@@ -68,5 +69,10 @@ methods {
methods.set_resources_allocation()
methods.set_pipeline_logs()
methods.set_env()
+
+ json_extractor.store_object_json(
+ params,
+ new File("${params.log_output_dir}/parameters.json")
+ )
}
}
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.
This is wonderful! We should have done this already! Just wondering if it's necessary to also store the resources being used? That will be the process
namespace. Also, the manifest
namespace could be usful too, to figure out the pipeline version being used.
We definitely would want to store those, which should be possible with the function to save being general enough to accept any namespace to dump |
Hmm, More seriously,
I'm assuming this is due to there being closures within in |
Hmm probably with the closures yeah, I think we'll want to dump the |
That's a good point, since I just looked at the top README.md and noticed that there is documentation for each config module. I'll be sure to add it before resubmitting this PR for review. |
…ine-Nextflow-config into jsalmingo-store-params
The readme has been added, and the name of the function changed to reflect the new functionality. |
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.
Nicely done! The README usage template worked great on a clean repo.
Adds a function to dump the params object into a json file for later analysis.
Note: I was not able to add the method as a separate class with a static method, nor was I able to just define the method in the config file, and so I added it as a closure.
I have read the code review guidelines and the code review best practice on GitHub check-list.
I have reviewed the Nextflow pipeline standards.
The name of the branch is meaningful and well formatted following the standards, using [AD_username (or 5 letters of AD if AD is too long)]-[brief_description_of_branch].
I have set up or verified the branch protection rule following the github standards before opening this pull request.
I have added my name to the contributors listings in the
metadata.yaml
and themanifest
block in thenextflow.config
as part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)
I have added the changes included in this pull request to the
CHANGELOG.md
under the next release version or unreleased, and updated the date.I have updated the version number in the
metadata.yaml
andmanifest
block of thenextflow.config
file following semver, or the version number has already been updated. (Leave it unchecked if you are unsure about new version number and discuss it with the infrastructure team in this PR.)I have tested the config being added or modified. Outline the tests below.
RNA A-mini-N2
/hot/software/pipeline/pipeline-call-RNAEditingSite/Nextflow/development/unreleased/jsalmingo-check-param-dump/call-RNAEditingSite-A-mini-n2-test.config
/hot/software/pipeline/pipeline-call-RNAEditingSite/Nextflow/development/unreleased/jsalmingo-check-param-dump/output
/hot/software/pipeline/pipeline-call-RNAEditingSite/Nextflow/development/unreleased/jsalmingo-check-param-dump/output/call-RNAEditingSite-6.0.0/CPCG0196-F1-A-mini-n2-strand-correct-false/log-call-RNAEditingSite-6.0.0-20231030T225336Z/nextflow-log/trace.txt