DaehwanKimLab / hisat2

Graph-based alignment (Hierarchical Graph FM index)
GNU General Public License v3.0
478 stars 119 forks source link

Samtools format errors #440

Open paulinarosales opened 2 months ago

paulinarosales commented 2 months ago

Hello,

I want to report a bug on HISAT3N output format, when trying to use the SAM output file for sorting or viewing with samtools the following errors appear:

[W::sam_parse1] empty query name and [bam_mating_core] ERROR: Couldn't read header

I checked the lines and the entries seem to have no tab spaces between fields:

❯ cat sample1.sam | head -n 109446607 | tail -n 1 | perl -pe 's/\t/ <tab> /g'
@LH00312:118:222V5FLT1:2:1158:1462:18624 1:N:0:AGTGTTGCAC+CGTGTACCAG%0AGGGCACCGGGGGCACTGAGCGCGGCAGATTCATCACACAGAGTCAGGCGCTCAGGGTGGGGCACAAGGGTGGGCTCAGCCCTCCCTCGGGGGGGGGCCCCCCTTTTGGTCTCTAGTGTTCCTGTTTGCTCCCAGAGGCCCAAGCACCTGG%0A+%0A9IIIIIIIIII9IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII9IIIII-9IIIIII-9III9IIIIII-9IIII9I9III9I99-9III9I9%0A

❯ cat sample2.sam | head -n 3084644 | tail -n 1 | perl -pe 's/\t/ <tab> /g'
@LH00312:118:222V5FLT1:1:1109:38558:12119 1:N:0:CCTGTCTGTC+TCACAACAGT%0ATTTCATGTGTCACATAACTACCGAAGTTTCGGCCCACAATGCAGTGCCAGGTAGGGTTGTACTTCTTGTCAAACTCCTTCTTGATATGGGCCGCAATATCCTTCTCGATGTTGTACTTCTCCAA%0A+%0AIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII%0A

this is the expected output:

LH00312:118:222V5FLT1:1:1101:28396:1401 <tab> 163 <tab> chr9 <tab> 106337602 <tab> 60 <tab> 27M221N118M4S <tab> = <tab> 106337601 <tab> -1 <tab> GAGACTGTAAAGCGAATCCGGGAACAGAGCAGTGCCCGGATCACCATCTCGGAGGGCTCCTGCCCCGAGCGAATCACCACCATCACAGGCTCTACGGCTGCCGTCTTCCACGCAGTCTCCATGATTGCCTTCAAGCTGGATGAGGACCA <tab> IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII9IIIIII9IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII-IIIIIIIIIIIIIIIII <tab> AS:i:-14 <tab> NH:i:1 <tab> XM:i:1 <tab> NM:i:1 <tab> MD:Z:113G31 <tab> YS:i:-12 <tab> YZ:A:+ <tab> Yf:i:0 <tab> Zf:i:26 <tab> XN:i:0 <tab> XO:i:0 <tab> XG:i:0 <tab> XS:A:+

This might be related to a previous issue

316