lh3 / minimap2

A versatile pairwise aligner for genomic and spliced nucleotide sequences
https://lh3.github.io/minimap2
Other
1.78k stars 407 forks source link

[main_samview] fail to read the header from "111.sam". #1220

Closed Anees-caas closed 3 months ago

Anees-caas commented 3 months ago

I have aligned the Nanopore reads to reference genome command: minimap2 -ax map-ont -t 8 /ref ./111.fastq.gz >111.sam This command generated Sam files. but when I am converting sam to bam samtools view -bS 111.sam > 111.bam I am getting error: fail to read the header from "111.sam". Please assist to solve this issue, Thanks!

Siadjeu commented 3 months ago

Hey, instead of >111.sam, try to run your line code like this: minimap2 -ax map-ont -t 8 /ref ./111.fastq.gz -o 111.sam

Anees-caas commented 3 months ago

Hi, idk why I was getting that error, recently I am using this command it worked minimap2 -ax map-ont -t 8 /ref/genome.fasta ./fastq.gz | samtools sort -o /sorted.bam

Siadjeu commented 3 months ago

Great that you solved it!

lh3 commented 3 months ago

Thank you for the help, @Siadjeu! I am closing the issue.