WGLab/NanoCaller

TypeError

Closed this issue · 2 comments

I am using this command :

NanoCaller --bam "$Sample"_mapped.bam --ref mtb.fasta --haploid_genome --output "$Sample"_output_nanocaller --mode snps

This is error message :

(nanocaller) root@mtb_nanopore_1# NanoCaller --bam "$Sample"_mapped.bam --ref mtb.fasta --haploid_genome --output "$Sample"_output_nanocaller --mode snps

2023-08-16 08:47:42.214468: Starting NanoCaller.

NanoCaller command and arguments are saved in the following file: ERR3863207_1_output_nanocaller/args

2023-08-16 08:47:42.438961: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
SNP Calling Progress:   0%|                                                                                                                          | 0/9 [00:00<?, ?it/s]Process Process-3:
Traceback (most recent call last):
  File "/root/miniconda3/envs/nanocaller/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/root/miniconda3/envs/nanocaller/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/root/miniconda3/envs/nanocaller/bin/nanocaller_src/snpCaller.py", line 184, in caller
    info_field='PR='+','.join("{:.4f}".format(x) for x in batch_probs[j,[0,3,1,2]])+ ";FQ={:.4f}".format(batch_freq[j])
  File "/root/miniconda3/envs/nanocaller/lib/python3.10/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/root/miniconda3/envs/nanocaller/lib/python3.10/site-packages/tensorflow/python/ops/array_ops.py", line 924, in _check_index
    raise TypeError(_SLICE_TYPE_ERROR + ", got {!r}".format(idx))
TypeError: Only integers, slices (`:`), ellipsis (`...`), tf.newaxis (`None`) and scalar tf.int32/tf.int64 tensors are valid indices, got [0, 3, 1, 2]
SNP Calling Progress:   0%|                                                                                                                          | 0/9 [00:14<?, ?it/s]

2023-08-16 08:47:58.078533: Combining SNP calls.

2023-08-16 08:47:58.079593: Compressing and indexing SNP calls.
Writing to /tmp/bcftools.n8E0wQ
Merging 0 temporary files
Cleaning
Done


2023-08-16 08:47:58.117314: SNP calling completed. Time taken= 14.3334


2023-08-16 08:47:58.117386: Total Time Elapsed: 15.90 seconds
umahsn commented

Hi,

Thank you for pointing this out. I fixed the error that was causing this. Current github commit should run without any problems, and conda/docker v3.4.1 has the fix as well.

Best

Hello ,

Thank you so much and I am really grateful for your quick response.