Skip to content

Error parsing SAM file MAPQ must be zero if RNAME is not specified #27

@LouisLeNezet

Description

@LouisLeNezet

Hi,

When creating the nf-test for graphmap2/align command I ran into the following error when trying to extract the read of the generated SAM file:
htsjdk.samtools.SAMFormatException: Error parsing text SAM file. MAPQ must be zero if RNAME is not specified

The command use was

wget https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/genome/genome.fasta
graphmap2 align -I -r genome.fasta

wget https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/nanopore/fastq/test.fastq.gz
graphmap2 align \\
        -r genome.fasta \\
        -i genome.fasta.gmidx \\
        -d test.fastq.gz \\
        -o test.sam

And here is the first read after alignment

@HD	VN:1.0	SO:unknown
@SQ	SN:MT192765.1	LN:29829
@PG	ID:graphmap	PN:graphmap	CL:graphmap2 -t 2 -r genome.fasta -i genome.fasta.gmidx -d test.fastq.gz -o test.sam	VN:v0.6.3 compiled on Nov 15 2019 at 19:39:45
00068f7a-51b3-4933-8fc6-7d6e29181ff9	4	*	0	255	*	*	0	0	TTGTGCTTCGTTTCAGTTACCGTATTGCTAGGTTAACACAAAGACACCGACAACTTTCTTCAGCACCTACAAACTGCCACCATGCAACCCAAAAAACCATGTAATGCCTATTGTCCAGTTCTTTCTACTCCCTTTGCCCTAGGGGACCTTAGGTACTGCTCTTTTCTACCTTCCCTATACCTCTCCCATTCCACCACCATTTCTTTTCTTCAGGACTCAACATGGCAAAGGAAGACCTAGGTGCTGAAGAAGTTGTCGGTGTCTTTGTGTTAACCTTAGCAATACGTAACA	/4,(###)#'%:/(%,%($$$#&%%(&1/3*0**98;7@FFA:?E>7/,00./<=AA<;;691(/89=579:174/*+&&/42,9-0-76@A=42'-**---99:)23736:<=998<=>7=:1+($3789=8:8559;3:19?==98<=199997:6696?AC@6:9?=EH>@<-=847341.-.489A==431,0($%')'())/''*$%94302;46====6596',14--96753670.(-.0-&)',-.'*,&&&$.+./+(5,13/+)*)2+))/(102+*))&'	NM:i:-1	AS:i:-291	H0:i:0	ZE:f:3.40282e+38	ZF:f:0	ZQ:i:291	ZR:i:0

From what I understood the MAPQ should not be set to 255 but to 0, is it normal ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions