SciLifeLab / TIDDIT

TIDDIT - structural variant calling
Other
71 stars 13 forks source link

Assertion failed, Abort trap: 6 #107

Closed islekburak closed 1 year ago

islekburak commented 1 year ago

When I run this command on my local:

$ tiddit --sv --bam /Users/islekbro/Desktop/SV/deneme2/variants.bam -o /Users/islekbro/Desktop/SV/deneme2/out --ref /Users/islekbro/Desktop/SV/deneme2/reference.fa --fermi2 /Users/islekbro/miniconda3/bin/fermi2 --ropebwt2 /Users/islekbro/miniconda3/bin/ropebwt2

I got this error:

LIBRARY STATISTICS Pair orientation = Forward-Reverse Average Read length = 150.0 Average insert size = 346.165 Stdev insert size = 50.355182867969674 99.95 percentile insert size = 490.20400000000063

('total', 0.00027108192443847656) Writing signals to file extracted signals in: -0.0012137889862060547 /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3432: RuntimeWarning: Mean of empty slice. return _methods._mean(a, axis=axis, dtype=dtype, /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/_methods.py:190: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) calculated coverage in: 0.0018231868743896484 [M::main_ropebwt2] constructed FM-index in 0.000 sec, 0.000 CPU sec [M::main_ropebwt2] symbol counts: ($, A, C, G, T, N) = (0, 0, 0, 0, 0, 0) [M::main_ropebwt2] rld: (tot, $, A, C, G, T, N) = (0, 0, 0, 0, 0, 0, 0) [M::main] Version: r187 [M::main] CMD: /Users/islekbro/miniconda3/bin/ropebwt2 -dNCr /Users/islekbro/Desktop/SV/deneme2/out_tiddit/clips.fa [M::main] Real time: 0.004 sec; CPU: 0.007 sec Assertion failed: (e->mcnt[1] >= n_threads * 2), function fm6_unitig, file unitig.c, line 414. sh: line 1: 76755 Done /Users/islekbro/miniconda3/bin/ropebwt2 -dNCr /Users/islekbro/Desktop/SV/deneme2/out_tiddit/clips.fa 76756 Abort trap: 6 | /Users/islekbro/miniconda3/bin/fermi2 assemble -t 1 -l 81 - > /Users/islekbro/Desktop/SV/deneme2/out_tiddit/clips.fa.assembly.mag Clip read assembly in: 0.06505513191223145 generated clusters in 0.0006840229034423828 Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/bin/tiddit", line 11, in load_entry_point('tiddit', 'console_scripts', 'tiddit')() File "/Users/islekbro/TIDDIT/tiddit/main.py", line 167, in main variants=tiddit_variant.main(bam_file_name,sv_clusters,args,library,min_mapq,samples,coverage_data,contig_number,max_ins_len) File "tiddit/tiddit_variant.pyx", line 546, in tiddit.tiddit_variant.main File "<__array_function__ internals>", line 180, in percentile File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4166, in percentile return _quantile_unchecked( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4424, in _quantile_unchecked r, k = _ureduce(a, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/lib/function_base.py", line 3725, in _ureduce r = func(a, *kwargs) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4593, in _quantile_ureduce_func result = _quantile(arr, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4699, in _quantile take(arr, indices=-1, axis=DATA_AXIS) File "<__array_function__ internals>", line 180, in take File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 190, in take return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc return bound(args, **kwds) IndexError: cannot do a non-empty take from an empty axes.

I am wondering if I am missing a detail, how can we proceed this run?

J35P312 commented 1 year ago

Hello! Thanks for considering TIDDIT, and sorry for slow reply! I have been away on a hackathon.

I suggest you try running TIDDIT on a bam file containing more reads. For testing TIDDIT, I usually extract +-100 kbp around the breakpoint region of a known SV; or I try the entire mitochondria.

based on the very short run time, I suspect TIDDIT found no (or very few) signals for SV discovery. I will try and replicate this error on my own.

good luck! //jesper

asp8200 commented 1 year ago

Hi @J35P312 : I might be experiencing the same (or at least a similar) issue with tiddit 3.4 and 3.6:

  Traceback (most recent call last):
    File "/usr/local/bin/tiddit", line 11, in <module>
      sys.exit(main())
    File "/usr/local/lib/python3.10/site-packages/tiddit/__main__.py", line 170, in main
      variants=tiddit_variant.main(bam_file_name,sv_clusters,args,library,min_mapq,samples,coverage_data,contig_number,max_ins_len)
    File "tiddit/tiddit_variant.pyx", line 546, in tiddit.tiddit_variant.main
    File "<__array_function__ internals>", line 180, in percentile
  LIBRARY STATISTICS
    Pair orientation = Forward-Reverse
    Average Read length = 100.05202026979028
    Average insert size = 350.362957905455
    Stdev insert size = 146.7253779640919
    99.95 percentile insert size = 602.0

  Collecting signals on contig: chr21
  ('total', 3.040929079055786)
  Writing signals to file
  extracted signals in:
  -3.041951894760132
  calculated coverage in:
  0.22997093200683594
  generated clusters in
  0.00015401840209960938
    File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4166, in percentile
      return _quantile_unchecked(
    File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4424, in _quantile_unchecked
      r, k = _ureduce(a,
    File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 3725, in _ureduce
      r = func(a, **kwargs)
    File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4593, in _quantile_ureduce_func
      result = _quantile(arr,
    File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4699, in _quantile
      take(arr, indices=-1, axis=DATA_AXIS)
    File "<__array_function__ internals>", line 180, in take
    File "/usr/local/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 190, in take
      return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
    File "/usr/local/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
      return bound(*args, **kwds)
  IndexError: cannot do a non-empty take from an empty axes.

The error occurs in Sarek after, locally, updating tiddit and running a standard test:

nextflow run main.nf -profile test_cache,tools_germline,docker --tools tiddit --outdir results

The call to tiddit looks like this:

tiddit --sv \
    --skip_assembly \
    --bam test.paired_end.recalibrated.sorted.cram \
    --ref genome.fasta \
    -o sample1.tiddit

with the cram-file being 27MB and the fasta-file being 46MB. If need be, I can send you the cram and fasta. I suspect that tiddit is crashing because of too few reads or variants in the input cram.

J35P312 commented 1 year ago

Hello! Though luck, but also great to hear that the error is reproducible ;P. It would be great if you can share the bam and reference with me! Then I can fix this easily; can you share through github?

Best regards Jesper

asp8200 commented 1 year ago

Hi Jesper. The compressed files are 37MB, and the limit here on GitHub is 25MB. Perhaps I can send them to you in an email or make a wetransfer to you?

J35P312 commented 1 year ago

That would be great! You can mail it @.!On 18 Jul 2023, at 17:15, Anders Sune Pedersen @.> wrote: Hi Jesper. The compressed files are 37MB. Perhaps I can send them to you in an email or make a wetransfer to you?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

asp8200 commented 1 year ago

Couldn't send it as a regular email; attachment just too large, so I sent it using wetransfer. Let me know if you have any problems retrieving the test-data from wetransfer. Cheers

J35P312 commented 1 year ago

Thanks! I accessed the files and fixed the bug.

I will test it on the NA12878 WGS data as well before pushing. Hopefully this will be done by tommorow!

J35P312 commented 1 year ago

Now it should be fixed! GIve this a try:

https://github.com/SciLifeLab/TIDDIT/releases/tag/TIDDIT-3.6.1

good luck, and thanks for the test data!