novoalab / EpiNano

Detection of RNA modifications from Oxford Nanopore direct RNA sequencing reads (Liu*, Begik* et al., Nature Comm 2019)
GNU General Public License v2.0
109 stars 31 forks source link

Error when running fast5ToEventTbl.py #30

Closed vahidAK closed 4 years ago

vahidAK commented 4 years ago

Hi @Huanle I got this error when I run this command on test data: python ~/Software/EpiNano/scripts/main/fast5ToEventTbl.py ~/Downloads/multifast5_1.fast5 Traceback (most recent call last): File "/home/vakbari/Software/EpiNano/scripts/main/fast5ToEventTbl.py", line 45, in main() File "/home/vakbari/Software/EpiNano/scripts/main/fast5ToEventTbl.py", line 29, in main read_id = get_readid(f5) File "/home/vakbari/Software/EpiNano/scripts/main/fast5ToEventTbl.py", line 16, in get_readid k = h5['Raw/Reads/'].keys()[0] 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 "/projects/vakbari_prj/anaconda3/envs/epinano/lib/python2.7/site-packages/h5py/_hl/group.py", line 177, 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)'

I have installed h5py, numpy , pandas and sklearn before running the script. Do you know what make this error? Many thanks, Vahid.

Huanle commented 4 years ago

Hi @vahidAK , May I ask if you are running the script with a folder or a single fast5 file as input? It seems you have multi-fast5 files available, I will update the pipeline with a script that can process multi-fast5 soon. Thanks for using Epinano and please post if you have any question or run into any errors in the future.

vahidAK commented 4 years ago

Hi @Huanle I am running the script for your example multifast5_1.fast5. And I give the file as input, not the folder

Huanle commented 4 years ago

Hi @vahidAK , Can you run the test with files from 'mod_example_fast5.tar' and those from 'unm_example_fast5.tar'? As these are the single fast5 files.

try the commands below, you will be able to extract the events table from fasst5 files.

tar -xf mod_example_fast5.tar
for i in mod_example_fast5/*.fast5;do python2.7 ../../scripts/main/fast5ToEventTbl.py $i;done

Please Let me know if this works or not.

vahidAK commented 4 years ago

Hi @Huanle I found the problem, my Fast5s do not have event table. I am not an expert with fast5, but I think new versions of fast5 do not have event table to reduce the size. So, do you have any idea how can I generate the event table? Also, it would be helpful if you can add a try/except command to tell the user in case their fast5 did not have event table. Many thanks, Vahid.

Huanle commented 4 years ago

Hi @vahidAK , Based on my experience, albacore 1.7+ will produce fast5 files with event tables.

If you want to include current intensity into your analysis, you can do basecalling with albacore but in the meanwhile stick to the fastq basecalled with the latest tools, such as guppy. Thanks for the suggestion. I will add additional help message to inform users about the fast5 file contents.

vahidAK commented 4 years ago

Hi @Huanle My fast5s are base called by guppy and they do not have event table. So, my question is how can I use them for your script? because the script needs an event table which is not in my fast5s. What was your meaning by "meanwhile stick to the fastq basecalled with the latest tools, such as guppy." fastq?

Thanks, Vahid.

Huanle commented 4 years ago

@vahidAK i mean you can use fastq sequences basecalled by guppy to generate features/metrics other than current intensities. If you want to include current intensity into your analysis, you can do basecalling using albacore.

fbrennen commented 4 years ago

Hi @Huanle -- if you want to pop into the Nanopore Community sometime we could try and figure out a way to get you current intensities without using albacore.

Huanle commented 4 years ago

hi @fbrennen , thanks for willing to help. I believe there is a way to recreate the albacore-generated event table from the 'move' table in guppy base-called fast5 files. Perhaps the 'trace' table is also necessary in case likelihood scores/probabilities are needed to be computed. Anyway, i will open a thread in nanopore community. Thanks again.