sarek
sarek copied to clipboard
Fix issue when lane is 0
close #1923
Issue was that with lane being 0 was interpreted as 0 the integer, not 0 the string, so the if statement was false.
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/sarek branch on the nf-core/test-datasets repository.
- [ ] Make sure your code lints (
nf-core pipelines lint). - [ ] Ensure the test suite passes (
nextflow run . -profile test,docker --outdir <OUTDIR>). - [ ] Check for unexpected warnings in debug mode (
nextflow run . -profile debug,test,docker --outdir <OUTDIR>). - [ ] Usage Documentation in
docs/usage.mdis updated. - [ ] Output Documentation in
docs/output.mdis updated. - [ ]
CHANGELOG.mdis updated. - [ ]
README.mdis updated (including new tool citations and authors/contributors).
@maxulysse , what is the functional change here?
@maxulysse , what is the functional change here?
Fixing a bug, that is interpreting a 0 not as a string but as an integer, and so an if statement became false because of a 0 value that is not a false value, but a 0 integer and not a 0 string
Currently the check has been modified to if ((meta.lane || meta.lane == 0) && fastq_2) { .... I wonder if there is a simpler, possibly even more robust way. What is the value of meta.lane when it has not been specified in the sample sheet? Would something like if (meta.lane != "" && fastq_2) { ... work?
Currently the check has been modified to
if ((meta.lane || meta.lane == 0) && fastq_2) { .... I wonder if there is a simpler, possibly even more robust way. What is the value ofmeta.lanewhen it has not been specified in the sample sheet? Would something likeif (meta.lane != "" && fastq_2) { ...work?
yeah, so meta.lane != "" isn't working as expected unfortunately.
Thanks for trying! I used the empty string ("") as test, because I don't know what the value of a missing lane would be (Groovy is not my native language), but thinking about it, there are probably better tests, maybe meta.lane != null, or would something like ! meta.lane.isEmpty() work?
Thanks for trying! I used the empty string (
"") as test, because I don't know what the value of a missing lane would be (Groovy is not my native language), but thinking about it, there are probably better tests, maybemeta.lane != null, or would something like! meta.lane.isEmpty()work?
My main issue is that we rely on the existence of lane quite a lot. So I'm actually more thinking about a refactor of this whole logic
Replaced by #1935