-
Notifications
You must be signed in to change notification settings - Fork 0
CODE-REVIEW | NF lint : Implement topics, fix statement outside top-level declaration
#232
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
Conversation
| // // Print parameter summary log to screen | ||
| // log.info logo + paramsSummaryLog(workflow) + citation | ||
|
|
||
| WorkflowDeepcsa.initialise(params, log) |
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.
I've commented this out because we do it in the main.nf script - is there any difference between the two?
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.
I honestly have no clue whether there is any difference, if things seem to work we can leave it only there!
I am not sure what it does, but it is probably reporting the parameters or something like this.
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.
Action: remove unecessary java libs and use utils_nfcore_* for pipeline initialization
| // // Input channel definitions | ||
| features_table = Channel.fromPath( params.features_table ?: params.input, checkIfExists: true) | ||
|
|
||
| wgs_trinucs = params.wgs_trinuc_counts | ||
| ? Channel.fromPath( params.wgs_trinuc_counts, checkIfExists: true).first() | ||
| : Channel.empty() | ||
| cosmic_ref = params.cosmic_ref_signatures | ||
| ? Channel.fromPath( params.cosmic_ref_signatures, checkIfExists: true).first() | ||
| : Channel.empty() | ||
| datasets3d = params.datasets3d | ||
| ? Channel.fromPath( params.datasets3d, checkIfExists: true).first() | ||
| : Channel.empty() | ||
| annotations3d = params.annotations3d | ||
| ? Channel.fromPath( params.annotations3d, checkIfExists: true).first() | ||
| : Channel.empty() | ||
| seqinfo_df = params.datasets3d | ||
| ? Channel.fromPath( "${params.datasets3d}/seq_for_mut_prob.tsv", checkIfExists: true).first() | ||
| : Channel.empty() | ||
| cadd_scores = params.cadd_scores | ||
| ? Channel.of([ | ||
| file(params.cadd_scores, checkIfExists : true), | ||
| file(params.cadd_scores_ind, checkIfExists : true) | ||
| ]).first() | ||
| : Channel.empty() |
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.
I don't fully grasp why we are redefining these variables. Is it to have always a channel even if the parameters are null? Also, the checkIfExists is automatically done in the validation of the parameters, maybe it is worth thinking a way to avoid redundancy.
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.
also, wgs_trinucsis never used in the script
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.
then we could remove all the checkIfExists mentions although maybe in some cases
it makes more sense to exclude it from the parameter validation but then have it here, so if no file is provided but that file does not need to be used it should not be a problem
anyway, all these initializations of specific channels are far from optimal, but for now it allowed me to use them in some ways that did not crush things, probably removing some of them would still be fine
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.
Action: All need to be value channel and start the process where they are needed even if empty
| // if the user wants to use custom gene groups, import the gene groups table | ||
| // otherwise I am using the input csv as a dummy value channel | ||
| custom_groups_table = params.custom_groups_file | ||
| ? Channel.fromPath( params.custom_groups_file, checkIfExists: true).first() | ||
| : Channel.fromPath(params.input) | ||
|
|
||
| // if the user wants to use custom BED file for computing the depths, import the BED file | ||
| // otherwise I am using the input csv as a dummy value channel | ||
| custom_bed_file = params.custom_bedfile | ||
| ? Channel.fromPath( params.custom_bedfile, checkIfExists: true).first() | ||
| : Channel.fromPath(params.input) | ||
|
|
||
| // if the user wants to define hotspots for omega, import the hotspots definition BED file | ||
| // otherwise I am using the input csv as a dummy value channel | ||
| hotspots_bed_file = params.omega_hotspots_bedfile | ||
| ? Channel.fromPath( params.omega_hotspots_bedfile, checkIfExists: true).first() | ||
| : Channel.fromPath(params.input) |
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.
I would rethink this logic - I personally don't understand it and whatever the user can do from outside, I think it should be outside of the main script. But maybe there is some underlying reason that I don't know and this is why it's here 😅
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.
I did all this to ensure that the files are "pulled" but if we mount all the disks then it is fine.
A part of me still think that is it worth having it, but I am happy to adapt to whatever is more common sense
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.
Check if the else condition is valid or is it only use to fill the channel and run the process. If yes, remove and make value channel empty.
(the first one needs to be checked for sure)
| if (params.help) { | ||
| def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs) | ||
| def citation = '\n' + WorkflowMain.citation(workflow) + '\n' | ||
| def String command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome GRCh37 -profile docker" |
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.
I don't know if this is ever used, but we should make sure that it is correct, I am not sure this would work right now,
we can leave it for later since it is not crucial
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 works actually, if you run nextflow run main.nf --help it will exactly run that
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.
Fix the typical pipeline command in the help:
def String command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome GRCh37 -profile docker"
FerriolCalvet
left a comment
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.
looks good, I left a couple of comments
topics, fix statement outside top-level declarationtopics, fix statement outside top-level declaration
This pull request includes:
Missing things to tackle:
TOPICS - caveats and implementation
When testing the use of the topic to collect the versions of the software the following happens:
For example this happens if I emit a topic
versionsin CUSTOM_DUMPSOFTWARE, where the input is the same channel.topic. This behaviour is found also in the MULTIQC process.Therefore to fix the problem we cannot emit those versions to the channel - leading to omit the versions of dumpsoftware and mqc.