-
Notifications
You must be signed in to change notification settings - Fork 34
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
Refactor code and configs #490
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.
Nice changes! Two questions on comparing parameter types
@@ -24,11 +24,12 @@ process { | |||
} | |||
|
|||
withName: '.*CALL_REPEAT_EXPANSIONS:EXPANSIONHUNTER' { | |||
ext.args = { ("${meta.sex}" == 1) ? '--sex male' : '--sex female' } | |||
ext.args = { ("${meta.sex}" == '1') ? '--sex male' : '--sex female' } |
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.
Was this broken? From the schema it looks like sex
needs to be an integer and not a string.
raredisease/assets/schema_input.json
Line 42 in 2be203d
"type": "integer", |
I guess that there is a risk that the old ("${meta.sex}" == 1)
simply checks for the boolean. Anyway, can you confirm that this sets the gender correctly for male and female?
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.
Schema does expect the value to be an integer, but in meta everything is of string type.. I retrieved the type of the values in our meta and this is what it looks like..
[id:java.lang.String, sample:java.lang.String, lane:java.lang.String, sex:java.lang.String, phenotype:java.lang.String, paternal:java.lang.String, maternal:java.lang.String, case_id:java.lang.String, num_lanes:java.lang.String, read_group:java.lang.String, single_end:java.lang.Boolean]
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 see, didn't know that :)
In that case we should look into whether this needs changing this as well
meta.sex.equals(1) ? '--sex male' : '--sex female', |
Worked for my testing previously though
Also it might be worth looking into whether this function needs changing
raredisease/workflows/raredisease.nf
Line 745 in 2be203d
def create_case_channel(List rows) { |
conf/modules/annotate_cadd.config
Outdated
@@ -16,7 +16,7 @@ | |||
// | |||
|
|||
process { | |||
if (params.cadd_resources != null) { | |||
if (!params.cadd_resources != "null") { |
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.
is null a string here? Maybe we can do something like this if we just want to check if cadd_resources
was given.
if (!params.cadd_resources != "null") { | |
if (params.cadd_resources) { |
Would this work?
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 doubt this will work because null here is a string and so the expression might not evaluate to false..
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.
Ah, OK. Struggling a bit to read the double negation here. Seems like we flipped the original logic of the statement 😅
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.
That conditional was not necessary at all so I have removed it.
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! Learned something about nextflow types in this PR 😆
PR checklist
nf-core lint
).nextflow run . -profile test,docker --outdir <OUTDIR>
).nextflow run . -profile test_one_sample,docker --outdir <OUTDIR>
).docs/usage.md
is updated.docs/output.md
is updated.CHANGELOG.md
is updated.README.md
is updated (including new tool citations and authors/contributors).