medaka icon indicating copy to clipboard operation
medaka copied to clipboard

"Incomplete aux field" when running medaka_consensus for certain fastq files

Open OscarAspelin opened this issue 5 days ago • 1 comments

Describe the bug Running medaka_consensus on certain fastq-files seem to generate a ""Incomplete aux field" error (see provided data). data.zip

Environment

  • No GPU
  • medaka 1.12.0 through pip
  • OS: Ubuntu 22.04.4 LTS, running medaka inside docker library/python:3.10.14-bookworm
  • medaka version 1.12.0
  • Python 3.10.14

Additional context My best guess is that this is related to commit 015306716c536c8c65e670d4248fa379cd96f7cc, where the "-T DT" flag was added, which causes minimap2 to run with the "-y" flag for adding fastq-comments to the output. It seems like the output from minimap2 is truncated or incompatible with SAMtools.

The test-fastq (single read for convenience, originally ENA sample DRR239355 (https://www.ebi.ac.uk/ena/browser/view/DRR239355)) contains a comment of type "4/1" which if removed, solves the issue.

Logging

command: medaka_consensus -t 8 -i read.fastq.gz -d asm.fasta

``` TF_CPP_MIN_LOG_LEVEL is set to '3' Cannot import pyabpoa, some features may not be available. Cannot import pyabpoa, some features may not be available. Attempting to automatically select model version. WARNING: Failed to detect a model version, w data.zip ill use default: 'r1041_e82_400bps_sup_v5.0.0' Checking program versions This is medaka 1.12.0 Cannot import pyabpoa, some features may not be available. Program Version Required Pass
bcftools 1.14 1.11 True
bgzip 1.14 1.11 True
minimap2 2.17 2.11 True
samtools 1.14 1.11 True
tabix 1.14 1.11 True
Cannot import pyabpoa, some features may not be available. [11:43:07 - MdlStrTF] Successfully removed temporary files from /tmp/tmp8kjkzuw8. Cannot import pyabpoa, some features may not be available. [11:43:08 - MdlStrTF] Successfully removed temporary files from /tmp/tmpl7pznswo. Aligning basecalls to draft Using the existing fai index file /usr/src/assembler/test/asm.fasta.fai Using the existing mmi index file /usr/src/assembler/test/asm.fasta.map-ont.mmi [M::main::0.0011.51] loaded/built the index for 1 target sequence(s) [M::mm_mapopt_update::0.0011.47] mid_occ = 2 [M::mm_idx_stat] kmer size: 15; skip: 10; is_hpc: 0; #seq: 1 [M::mm_idx_stat::0.0011.43] distinct minimizers: 51 (100.00% are singletons); average occurrences: 1.000; average spacing: 5.922 [M::worker_pipeline::0.0021.54] mapped 1 sequences [M::main] Version: 2.17-r941 [M::main] CMD: minimap2 -x map-ont --secondary=no -L --MD -y -A 2 -B 4 -O 4,24 -E 2,1 -t 8 -a /usr/src/assembler/test/asm.fasta.map-ont.mmi /usr/src/assembler/test/read.fastq.gz [M::main] Real time: 0.002 sec; CPU: 0.003 sec; Peak RSS: 0.004 GB [E::aux_parse] Incomplete aux field samtools view: error reading file "-" samtools view: error closing "-": -5 Alignment pipeline failed. Failed to run alignment of reads to draft. ```

OscarAspelin avatar Jul 03 '24 11:07 OscarAspelin