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

Refactor code and configs #490

Merged
merged 6 commits into from
Jan 31, 2024

Conversation

ramprasadn
Copy link
Collaborator

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/raredisease branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Ensure the test suite passes (nextflow run . -profile test_one_sample,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

Copy link

github-actions bot commented Jan 29, 2024

nf-core lint overall result: Failed ❌

Posted for pipeline commit 74458c1

+| ✅ 176 tests passed       |+
#| ❔   2 tests were ignored |#
!| ❗   2 tests had warnings |!
-| ❌   3 tests failed       |-

❌ Test failures:

  • files_unchanged - .github/PULL_REQUEST_TEMPLATE.md does not match the template
  • files_unchanged - docs/images/nf-core-raredisease_logo_light.png does not match the template
  • files_unchanged - docs/images/nf-core-raredisease_logo_dark.png does not match the template

❗ Test warnings:

  • pipeline_todos - TODO string in WorkflowRaredisease.groovy: Optionally add in-text citation tools to this list.
  • pipeline_todos - TODO string in awsfulltest.yml: You can customise AWS full pipeline tests as required

❔ Tests ignored:

  • files_exist - File is ignored: conf/modules.config
  • files_unchanged - File ignored due to lint config: .gitignore or .prettierignore or pyproject.toml

✅ Tests passed:

Run details

  • nf-core/tools version 2.12
  • Run at 2024-01-31 14:48:13

@ramprasadn ramprasadn marked this pull request as ready for review January 29, 2024 12:52
Copy link
Collaborator

@jemten jemten left a 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' }
Copy link
Collaborator

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.

"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?

Copy link
Collaborator Author

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]

Copy link
Collaborator

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
def create_case_channel(List rows) {

@@ -16,7 +16,7 @@
//

process {
if (params.cadd_resources != null) {
if (!params.cadd_resources != "null") {
Copy link
Collaborator

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.

Suggested change
if (!params.cadd_resources != "null") {
if (params.cadd_resources) {

Would this work?

Copy link
Collaborator Author

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..

Copy link
Collaborator

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 😅

Copy link
Collaborator Author

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.

Copy link
Collaborator

@jemten jemten left a 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 😆

@ramprasadn ramprasadn merged commit 45ad1d8 into nf-core:dev Jan 31, 2024
5 of 6 checks passed
@ramprasadn ramprasadn deleted the minor-fixes branch February 2, 2024 16:56
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.

2 participants