nf-core / mcmicro

An end-to-end processing pipeline that transforms multi-channel whole-slide images into single-cell data.
https://nf-co.re/mcmicro
MIT License
4 stars 12 forks source link

input_sample code path does not explicitly sort input image filenames #28

Open jmuhlich opened 2 months ago

jmuhlich commented 2 months ago

Description of the bug

When using input_sample, the image directory files are collected via Groovy's File.eachFileRecurse which does not yield the results in any sorted order. The results must be collected and then sorted explicitly by filename. In addition it's probably better not to recurse and require all files are provided at the top level, as user expectations will vary on how files in subdirectories should be sorted relative to each other. This is as simple as replacing eachFileRecurse with eachFile. Or eachFileMatch could be used to perform the .ome.tif filename match as well.

Command used and terminal output

No response

Relevant files

No response

System information

No response

RobJY commented 2 months ago

I have a fix for this in my repo in branch issue_28 using eachFileMatch and an explicit sort as you mentioned. I'll make a PR for it once PR #29 has been merged.