ngless-toolkit / ngless

NGLess: NGS with less work
https://ngless.embl.de
Other
142 stars 24 forks source link

load_mocat_sample - missing pair.2 fails, missing pair.1 succeeds #120

Closed unode closed 5 years ago

unode commented 5 years ago

If the folder contains:

sample
├── sample.pair.1.fq.bz2
└── sample.single.fq.bz2

using load_mocat_sample() fails with the error:

Cannot find match for file: sample/sample.pair.1.fq.bz2

However in the case of:

sample
├── sample.pair.2.fq.bz2
└── sample.single.fq.bz2

it succeeds with:

(...) load_mocat_sample found single-end sample 'sample/sample.pair.2.fq.bz2'
(...) load_mocat_sample found single-end sample 'sample/sample.single.fq.bz2'

Should we also fail here due to an unpaired pair.2 and be symmetrical with the pair.1 case?

luispedro commented 5 years ago

It's a strange corner case, but I think it could be a good thing to at least issue a warning.

unode commented 5 years ago

Would you oppose making it into an error instead of warning? Rationale being that if it matches pair.X but there's no pair.Y something unexpected happened and the warning might go by unnoticed.

luispedro commented 5 years ago

No objection. Never silently screw up is one of the principles that we try to adhere to and I can see how a warning may be too tame.

unode commented 5 years ago

I'll make it into an error then as soon as I find the time. Thanks for the feedback.

unode commented 5 years ago

As of 68188edd1909fe773f0e60ac72ee63e2b22afeff an error will be raised if pair.2 exists but pair.1 doesn't.