leylabmpi/resmico

bam2feat error: Return code -11

Closed this issue · 6 comments

I think I've managed to install it correctly (v1.2.2 via pip), but I am running into an error with bam2feat as below. I think its a different issue to #21 due to having warnings like Cannot read alignment score at position: .

Do you have any advice? Bam files were created using minimap2.

2024-04-11 15:24:44.558] [svc] [�[32minfo�[m] Processing contig: NODE_16712_length_2673_cov_12.221925
[2024-04-11 15:24:44.559] [svc] [�[32minfo�[m] Getting per-read characteristics
[2024-04-11 15:24:44.558] [svc] [�[32minfo�[m] Processing contig: NODE_212_length_27811_cov_24.420450
[2024-04-11 15:24:44.559] [svc] [�[32minfo�[m] Getting per-read characteristics
[2024-04-11 15:24:44.566] [svc] [�[32minfo�[m] Processing contig: NODE_5071_length_4796_cov_26.411306
[2024-04-11 15:24:44.566] [svc] [�[32minfo�[m] Getting per-read characteristics
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 0
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 1
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 2
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 3
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 4
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 5
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 6
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 7
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 8
[2024-04-11 15:24:44.573] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 9
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 10
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 11
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 12
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 13
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 14
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 15
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 16
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 17
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 18
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 19
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 20
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 21
[2024-04-11 15:24:44.574] [svc] [�[33m�[1mwarning�[m] Cannot read alignment score at position: 22
[2024-04-11 15:24:44.574] [svc] [
Traceback (most recent call last):
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/fee5edea63eb33e4a3eddd1d49648ebd_/bin/resmico", line 10, in <module>
    sys.exit(main())
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/fee5edea63eb33e4a3eddd1d49648ebd_/lib/python3.10/site-packages/resmico/__main__.py", line 52, in main
    args.func(args)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/fee5edea63eb33e4a3eddd1d49648ebd_/lib/python3.10/site-packages/resmico/commands/bam2feat.py", line 80, in main
    bam2feat.main(args)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/fee5edea63eb33e4a3eddd1d49648ebd_/lib/python3.10/site-packages/resmico/bam2feat.py", line 284, in main
    feat_files = run_bam2feat(bam_fasta, exe, args)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/fee5edea63eb33e4a3eddd1d49648ebd_/lib/python3.10/site-packages/resmico/bam2feat.py", line 256, in run_bam2feat
    return [x for x in res]
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/fee5edea63eb33e4a3eddd1d49648ebd_/lib/python3.10/site-packages/resmico/bam2feat.py", line 256, in <listcomp>
    return [x for x in res]
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/fee5edea63eb33e4a3eddd1d49648ebd_/lib/python3.10/site-packages/resmico/bam2feat.py", line 227, in _run_bam2feat
    bam2feat(bam_sub, ref_tmp, outdir_feat, exe['bam2feat'], args)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/fee5edea63eb33e4a3eddd1d49648ebd_/lib/python3.10/site-packages/resmico/bam2feat.py", line 190, in bam2feat
    run_cmd(cmd)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/fee5edea63eb33e4a3eddd1d49648ebd_/lib/python3.10/site-packages/resmico/bam2feat.py", line 99, in run_cmd
    raise ValueError('Return code: {}'.format(rc))
ValueError: Return code: -11

I reinstalled Resmico using the pip from source method and I now get a different error:

[2024-05-07 13:45:32.368] [svc] [�[32minfo�[m] Uncompressed fasta file detected. Using BamTools
[2024-05-07 13:45:32.369] [svc] [�[32minfo�[m] Processing contig: NODE_5091_length_4403_cov_21.562787
[2024-05-07 13:45:32.369] [svc] [�[32minfo�[m] Getting per-read characteristics
[2024-05-07 13:45:32.386] [svc] [�[32minfo�[m] Computing entropy and GC percent

Traceback (most recent call last):
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/bin/resmico", line 10, in <module>
    sys.exit(main())
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/__main__.py", line 52, in main
    args.func(args)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/commands/bam2feat.py", line 80, in main
    bam2feat.main(args)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat.py", line 284, in main
    feat_files = run_bam2feat(bam_fasta, exe, args)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat.py", line 256, in run_bam2feat
    return [x for x in res]
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat.py", line 256, in <listcomp>
    return [x for x in res]
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat.py", line 227, in _run_bam2feat
    bam2feat(bam_sub, ref_tmp, outdir_feat, exe['bam2feat'], args)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat.py", line 190, in bam2feat
    run_cmd(cmd)
  File "/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat.py", line 99, in run_cmd
    raise ValueError('Return code: {}'.format(rc))
ValueError: Return code: -6

Also get this other error outside of the log:

*** stack smashing detected ***: /mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat terminated
======= Backtrace: =========                    
/lib64/libc.so.6(+0x7731f)[0x7f980250631f]                                                             
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f980258f767]                                             
/lib64/libc.so.6(__fortify_fail+0x0)[0x7f980258f730]                                              
/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat(+0x21bba)[0x55f0a412ebba]
/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat(+0x27a56)[0x55f0a4134a56]
/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat(+0x1e667)[0x55f0a412b667]
/pkg/suse12/software/GCCcore/9.3.0/lib64/libgomp.so.1(GOMP_parallel+0x42)[0x7f980294d3d2]                                                                                                                      
/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat(+0x18eef)[0x55f0a4125eef]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f98024b2ac5]                                                                                                                                                       
/mnt/hpccs01/work/microbiome/ibis/SRA/results/benchmarking/20240129/.snakemake/conda/b89c45308a715f067df5b9f1955ffb05_/lib/python3.9/site-packages/resmico/bam2feat(+0x1dfd9)[0x55f0a412afd9]

The contig where it failed (NODE_5091_length_4403_cov_21.562787) has Ns in it. Is that the issue?

The contig where it failed (NODE_5091_length_4403_cov_21.562787) has Ns in it. Is that the issue?

Yeah, that's almost definitely the issue. Why does the contig contain N's? Is it actually a scaffold?

Yep, turns out they were scaffolds. Resmico finishes for me now.
Do you plan on supporting scaffolds in the future?

Do you plan on supporting scaffolds in the future?

Likely not, given that the feature table generation software was highly optimized for contigs (no N values).