BodenmillerGroup / steinbock

A toolkit for processing multiplexed tissue images
https://bodenmillergroup.github.io/steinbock
MIT License
49 stars 14 forks source link

Print specific Error message for missing ROI #184

Closed nathansteenbuck closed 8 months ago

nathansteenbuck commented 1 year ago

I am analysing a mcd with multiple ROIs and stumbled upon this error:

2023-05-15 15:11:13,563 WARNING steinbock.preprocessing.imc - Error reading acquisition 72 from file /tmp/tmp63oinnto/6483_Immune/6483_Immune.mcd: MCD file '6483_Immune.mcd' corrupted: invalid acquisition image data offsets

However, instead of issues with the image offsets, the .txt-file of ROI 72 doesn`t exist.

My suggestion would be to print a more specific error message catching that exception :)

jwindhager commented 1 year ago

Hi @nathansteenbuck ! Transferring this to the steinbock repo, as the recovery-from-txt functionality is implemented there

jwindhager commented 1 year ago

I understand that the message is not informative in your case, however:

One could of course think of being more verbose and add a message to the log saying that the mcd file is broken AND that no matching txt file has been found for recovery (basically add an else branch to https://github.com/BodenmillerGroup/steinbock/blob/bc10207a5a690254bb4e65089c06004fe3f19b05/steinbock/preprocessing/imc.py#L369C53-L404). I think this would be a good addition @Milad4849