I am trying to convert SAM file to BAM file after genome alignment using bwa-mem on a cluster. I perform genome alignment on a cluster as well. The SAM file generated from bowtie2 works fine and I do not get error but there is problem when I use bwa-mem. I use following command to align my single end reads using bwa-mem
bwa mem –k 10 –v 3 bwa_index filtered_reads.fastq > SAM_output.sam
I run the following command for conversion of SAM to BAM file:
samtools view -b SAM_output.sam -o BAM_output.bam
It shows following error
[W::sam_read1] parse error at line 1 [main_samview] truncated file
I checked some answers from the similar questions but even then I was unable to solve the problem. Any help would be great.