DNKonanov / snapper-man-test

Readthedocs manual for Snapper
1 stars 0 forks source link

IndexError #1

Open mmpust opened 2 weeks ago

mmpust commented 2 weeks ago

Dear developers, I would like to run snapper on a set of reference contigs (not whole genomes). I have native and wildtype data.

single_to_multi_fast5 -i "${nativeFAST5}_single" -s "${nativeFAST5}_multi"
single_to_multi_fast5 -i "${wtFAST5}_single" -s "${wtFAST5}_multi"

snapper \
     -sample_fast5dir "${nativeFAST5}_multi" \
     -control_fast5dir "${wtFAST5}_multi" \
     -reference $ref_contigs -k_size 11 -long_k_size 21 \
     -outdir $outDIR -coverage 5 -threads $THREADS

But I am running into the following issue

Processing forward motifs td_618_628_2332_-__IS361...
---The number of k-mers is insufficient for the enrichment process. td_618_628_2332_-__IS361 is skipped.---
cf00_10587_21_863110284 843
Processing reversed motifs cf00_10587_21_863110284 843...

Motif enrichment

Reference indexing...
830
Reference indexing with length of 3...

Reference indexing with length of 4...
Reference indexing with length of 5...
Reference indexing with length of 6...
ITERATION 1 (0 unexplained 11-mers):
        OBSERVING ANCHOR MOTIFS WITH LENGTH OF 3
Process Process-23238:
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/snapper/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/home/user/miniconda3/envs/snapper/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/miniconda3/envs/snapper/lib/python3.7/site-packages/snapper/src/methods.py", line 296, in variant_counts_parallel
    variant_count = extract_template_count(pos_variant, motif_variant, seq_array)
  File "/home/user/miniconda3/envs/snapper/lib/python3.7/site-packages/snapper/src/methods.py", line 103, in extract_template_count
    subseq = subseq[subseq[:,pos_variant[i]] == motif_variant[i]]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Any ideas what the issue is? Thanks

DNKonanov commented 1 week ago

Hello,

Thank you for the using our tool!

I see that you set the --coverage parameter equals 5. I'm afraid it is not enough for the algorithm to cirrectly detect k-mers with significant signal shift, so the list of k-mers with shifted signal is just empty.

Regarding the IndexError, I found a missed condition in the reverse contig processing, it has been fixed, the updated version available in both pip and github.

Sincerely, Dmitry Konanov