hasindu2008 / slow5tools

Slow5tools is a toolkit for converting (FAST5 <-> SLOW5), compressing, viewing, indexing and manipulating data in SLOW5 format.
https://hasindu2008.github.io/slow5tools
MIT License
94 stars 6 forks source link

f2s error:[add_aux_slow5_attribute::ERROR] #128

Closed peiyihe closed 2 weeks ago

peiyihe commented 3 weeks ago

Hi,

When I am trying to convert a fast5 file to slow5, I meet the error below:

[f2s_main] 1 fast5 files found - took 0.000s
[f2s_main] Just before forking, peak RAM = 0.000 GB
[f2s_iop] 1 proceses will be used.
[add_aux_slow5_attribute::ERROR] Could not initialize the record attribute 'Raw/start_time' in output.fast5
[fast5_attribute_itr::ERROR] Could not add the auxiliary attribute Raw/start_time in output.fast5 to the slow5 record
[read_fast5::ERROR] Bad fast5: Could not iterate over the read groups in the fast5 file output.fast5.
[f2s_child_worker::ERROR] Could not read contents of the fast5 file 'output.fast5'.

The command I use is /slow5tools-v1.2.0$ ./slow5tools f2s output.fast5 -o ecoli.slow5

Have you met this problem before? I think I find a similar issue, but an old version slow5tool I think. Thanks

peiyihe commented 3 weeks ago

And this link is the fast5 I used. https://drive.google.com/file/d/1Znz-rapnt-c1QK3uC_AiSD1lbTpTajpY/view?usp=drive_link

Thanks.

peiyihe commented 3 weeks ago

Anyway, I guess it is still because vbz compression, but actually I add HDF5_PLUGIN_PATH correctly, there is still errors.

I solve this problem by using ont compress_fast5 tool (https://github.com/nanoporetech/ont_fast5_api) to convert vbz compression to gzip compression and then use slow5tool to convert gzip fast5 to slow5 successfully.

Thanks!

hasindu2008 commented 2 weeks ago

Hello,

Sorry for the late response. I was on leave and was vacationing. This is not due to the VBZ. The fast5 file you have shared is bizarre, it is a multi-fast5 with the version datatype being a floating point. The version number being a float is insane and slow5tools could be defaulting to think it is a single-fast5 file. How did you get this fast5 file?

There are two ways you could try:

  1. convert your fast5 file to single-fast5 and let slow5tools convert it:
    multi_to_single_fast5  -i barcode02_r0barcode02b0_0.fast5 -s mess/
    slow5tools f2s mess -o a.blow5 -p1
  2. The method in https://github.com/hasindu2008/slow5tools/issues/104#issuecomment-1822016743 may work as this solution was for a slightly related problem.
peiyihe commented 2 weeks ago

Thanks for your quick response! This dataset is from ERR9127551. The problem has been solved.