WGLab / DeepMod2

DNA 5mC methylation detection from Dorado or Guppy basecalled Oxford Nanopore reads
MIT License
31 stars 2 forks source link

Example: ValueError: failure when retrieving sequence on 'chr1' #19

Closed hewei-nju closed 4 months ago

hewei-nju commented 4 months ago

I am runing the example commands, but I have got error bellow.

(deepmod2) hew@DNA2:~/GitRepo$ python ${INPUT_DIR}/DeepMod2/deepmod2 detect --model bilstm_r10.4.1_5khz_v4.3 --file_type pod5 --bam  $BAM_INPUT --input  ${INPUT_DIR}/nanopore_raw_data --output ${OUTPUT_DIR}/deepmod2/ --ref ${INPUT_DIR}/GRCh38.fa --threads 8
2024-02-25 17:29:12.625367: Starting DeepMod2.

2024-02-25 17:29:12.989761: 
Command: python data/DeepMod2/deepmod2 detect --model bilstm_r10.4.1_5khz_v4.3 --file_type pod5 --bam mod/aligned.bam --input data/nanopore_raw_data --output mod/deepmod2/ --ref data/GRCh38.fa --threads 8

2024-02-25 17:29:13.031103: Starting Per Read Methylation Detection.
2024-02-25 17:29:13.664148: Getting motif positions from the reference.
[E::fai_retrieve] Failed to retrieve block: unexpected end of file
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/hew/anaconda3/envs/deepmod2/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/hew/anaconda3/envs/deepmod2/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/hew/GitRepo/data/DeepMod2/src/utils.py", line 210, in get_ref_info
    seq=ref_fasta.fetch(chrom).upper()
  File "pysam/libcfaidx.pyx", line 317, in pysam.libcfaidx.FastaFile.fetch
ValueError: failure when retrieving sequence on 'chr1'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/hew/GitRepo/data/DeepMod2/deepmod2", line 147, in <module>
    detect.call_manager(params)
  File "/home/hew/GitRepo/data/DeepMod2/src/detect.py", line 581, in call_manager
    res=pool.map(get_ref_info, zip(repeat(params['ref']), params['chrom_list']))
  File "/home/hew/anaconda3/envs/deepmod2/lib/python3.10/multiprocessing/pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/home/hew/anaconda3/envs/deepmod2/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
ValueError: failure when retrieving sequence on 'chr1'

RUNING ARGS:

Command: python data/DeepMod2/deepmod2 detect --model bilstm_r10.4.1_5khz_v4.3 --file_type pod5 --bam mod/aligned.bam --input data/nanopore_raw_data --output mod/deepmod2/ --ref data/GRCh38.fa --threads 8

------Parameters Used For Running DeepMod2------
print_models: False
option: detect
prefix: output
output: mod/deepmod2/
qscore_cutoff: 0
length_cutoff: 0
mod_t: 0.5
unmod_t: 0.5
include_non_cpg_ref: False
threads: 8
ref: data/GRCh38.fa
model: bilstm_r10.4.1_5khz_v4.3
bam: mod/aligned.bam
file_type: pod5
input: data/nanopore_raw_data
guppy_group: Basecall_1D_000
chrom: None
fast5_move: False
skip_per_site: False
device: None
disable_pruning: False
exclude_ref_features: False
batch_size: 1024
bam_threads: 4
skip_unmapped: False
hewei-nju commented 4 months ago

Solved, personal reasons.