Fixing Oxford Nanopore FAST5 files which are missing entries.
The scripts were written by HalfPhoton and provided in a github issue. I am just bringing them together here to make it easier on myself should I come accross this problem again in the future.
The scripts in this repository require pod5 tools to be installed.
python find_fast5_issues.py FOLDER_CONTAINING_FAST5_FILES/
grep -o "read_[0-9a-f-]*" issues.txt > bad_reads.txt
python delete_fast5_reads.py FOLDER_CONTAINING_FAST5_FILES/ bad_reads.txt
python find_fast5_issues.py FOLDER_CONTAINING_FAST5_FILES/ && \
grep -o "read_[0-9a-f-]*" issues.txt > bad_reads.txt && \
python delete_fast5_reads.py FOLDER_CONTAINING_FAST5_FILES/ bad_reads.txt