Psy-Fer / SquiggleKit

SquiggleKit: A toolkit for manipulating nanopore signal data
MIT License
120 stars 23 forks source link

SquigglePlot.py fails for single read from a single multi-fast5 file #29

Closed nickschurch closed 4 years ago

nickschurch commented 4 years ago

Trying to plot a the quiggle for a single read from a single multi-fast5 file fails:

python SquigglePlot.py -i ACD428_pass_35b4027b_1004.fast5 -r read_04588653-de98-4b75-adcb-2ac265a0820e -m
Traceback (most recent call last):
  File "../../Github/SquiggleKit/SquigglePlot.py", line 322, in process_fast5
    c = list(hdf['Raw/Reads'].keys())
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/nfs/home/nschurch/anaconda2/envs/nanopore_metagenomics/lib/python3.7/site-packages/h5py/_hl/group.py", line 264, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: 'Unable to open object (component not found)'
process_fast5():failed to extract events or fastq from: p52_phcl_01/20200120_1651_MN27860_ACD428_c7f96092/fast5_pass/ACD428_pass_35b4027b_1004.fast5main():data not extracted: p52_phcl_01/20200120_1651_MN27860_ACD428_c7f96092/fast5_pass/ACD428_pass_35b4027b_1004.fast5

It seems that specifying -i then ignored the -m flag and uses the single-read processing subroutine process_fast5 rather than using get_multi_fast5_signal.

Specifying -p and looks like it allows the -m flag to be parsed properly and couldbe used to plot the squiggle for the single read, but it forces a parse of all the fast5 files in the path which is slow and unnecessary.

Psy-Fer commented 4 years ago

Thanks Nick. I appreciate the fix

Psy-Fer commented 4 years ago

i've merged the change. Closing this