BMCV / galaxy-image-analysis

Galaxy tools for image analysis
MIT License
14 stars 14 forks source link

Added a new tool and updated an existing tool #30

Closed qgao-hd closed 2 years ago

qgao-hd commented 2 years ago

1, updated tool "image_registration_affine": more options of the image similarity metric; support of RGB(A) images

2, added new tool "3d_tensor_feature_dimension_reduction"

qgao-hd commented 2 years ago

It is weird that the .npz file (compressed array; the only input) cannot be correctly loaded.

Standard Error: Traceback (most recent call last): File "/home/runner/.planemo/planemo_tmp_7m7wh7ts/3d_tensor_feature_dimension_reduction.py", line 39, in feature_dimension_reduction(args.tensor_fn, args.tiff_fn, args.nCh) File "/home/runner/.planemo/planemo_tmp_7m7wh7ts/3d_tensor_feature_dimension_reduction.py", line 19, in feature_dimension_reduction assert isinstance(npobj, np.lib.npyio.NpzFile), 'input must be a npz file' AssertionError: input must be a npz file

bgruening commented 2 years ago

lets see if this works, it can be that numpy needs a proper fileending.

bgruening commented 2 years ago

It does not. Maybe your test file is currupted?

qgao-hd commented 2 years ago

It does not. Maybe your test file is currupted?

I downloaded the test file from my fork and made a test.

It can be loaded and processed on my local machine without any problem.

bgruening commented 2 years ago

different python versoion? I don't know :( Does you local planemo also fail?

qgao-hd commented 2 years ago

Does you local planemo also fail?

I am using Python 3.7.10 on my local machine (MacBook Air M1 chip). I have Planemo installed. But 'planemo test' never works properly ... Don't know why.

I will install Planemo on my Linux PC in the office and try planemo test again on Monday.

bgruening commented 2 years ago

Thanks! No clue how the new OSX does that. Conda needs to work or Docker, maybe that is also the problem?

qgao-hd commented 2 years ago

Thanks! No clue how the new OSX does that. Conda needs to work or Docker, maybe that is also the problem?

I tried planemo test on my Linux PC. Unfortunately I always had the same error as on my Mac "module not found" for all tools with Python script. It seemed some dependency problem of Python packages. But I have no clue at all.

bgruening commented 2 years ago

Thanks! No clue how the new OSX does that. Conda needs to work or Docker, maybe that is also the problem?

I tried planemo test on my Linux PC. Unfortunately I always had the same error as on my Mac "module not found" for all tools with Python script. It seemed some dependency problem of Python packages. But I have no clue at all.

So its also failing for you on Linux?

You can try with docker planemo test --biocontainers

qgao-hd commented 2 years ago

It does not. Maybe your test file is currupted?

I changed the format of input to hdf5 and it works.

But now the error is: Output fn_out: different than expected, difference (using diff): ( /tmp/tmp18dfrl6atensor_r.tif v. /tmp/tmpnjj4fs9ptensor_r.tif ) Binary data detected, not displaying diff

As the output is multi-channel 32bit tiff, I do not know whether the tiff output is not properly saved or Galaxy does not support this tiff format.

qgao-hd commented 2 years ago

So its also failing for you on Linux?

You can try with docker planemo test --biocontainers

Local Planemo (planemo test) fails on both my Linux and Mac with ModuleNotFoundError.

planemo test --biocontainers does not help.

qgao-hd commented 2 years ago

So its also failing for you on Linux?

You can try with docker planemo test --biocontainers

I have miniconda3 with Python3.7 installed. This is how I installed Planemo and run planemo test: $ virtualenv .venv; . .venv/bin/activate $ pip install planemo (my pip=21.1.1) $ planemo lint (this works) $ planemo test (this fails when there is Python script) $ planemo test --biocontainers (also fails)

qgao-hd commented 2 years ago

The output was not correctly saved.

Problems: Output fn_out: different than expected Expected file size was 170000, actual file size was 0 (difference of 20000 accepted)

bgruening commented 2 years ago

That means that no output file is created, or 0 bytes one. So maybe you are really missing a dependency?

I can only look at this, this evening.

qgao-hd commented 2 years ago

That means that no output file is created, or 0 bytes one. So maybe you are really missing a dependency?

I can only look at this, this evening.

Finally all checks passed!

It turned out that file extension should not be changed/updated in Python script like this: tifffile.imwrite(tiff_fn + '.tif', ...)