I recently used HISAT2 to align my paired-end reads to a reference genome. The command I used was
hisat2 -q -p 4 -x path_to_index -1 reads_1.fastq -2 reads_2.fastq -S out.sam.
This produced a SAM file that was ~14 GB and had headers that matched the ones I looked up online for this type of file.
I am having trouble converting my SAM output file to a BAM file using the following command
samtools view -bS out.sam > out.bam. I should mention that the samtools version I am using is 1.4.1 and the syntax should be ok.
The out.bam file is only 45 bytes and when I try to check it with samtools flagstat
samtools flagstat out.bam, I get the following errors:
[W::sam_read1] parse error at line 1 [bam_flagstat_core] Truncated file? Continue anyway.
I have tried looking into this problem but couldn't find an answer that related specifically to my issue. Any help would be greatly appreciated. Cheers, Fjodor