This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Created SAM file using Hisat2 alignment. Now trying to convert to sorted.bam, but samtools just spitting out numerous gzip files

When I used the command:

samtools view -bS [filename].sam > [filename].bam

I get a GZIP file with the name "[filename].bam

I then try to convert to sorted.bam using command:

samtools sort [filename].bam -o [filename].sorted.bam

And I just get a bunch (~11) gzip files, and then my Ubuntu terminal just starts displaying gibberish.

What could be the issue?

rna-seq alignment

Could you give us the command lines you are using (+ your samtools version)? You might have done a small error since samtools view -bS should not give you a gzip file, just a .bam.

What do you mean command lines? I installed samtools from ubuntu software center. When I type "samtools" in terminal, it displays the program information and says it's version 0.1.18.

However, even after uninstalling and reinstalling, it still does the same thing. Could there be something wrong with the sam file that was created from Hisat2? I can't even open my sam file (not even with text editor) and when I right click > properties it says file type is lotus amipro. Does this sound right?

You should be able to open the sam file with a text editor. It is basically a text file with a series of well defined columns (https://samtools.github.io/hts-specs/SAMv1.pdf)

By command line I mean what you typed on in terminal to run HISat and samtools and generate the sam/bam files. Like

samtools sort align/mybamFile.bam align/mybamFile.sorted

Hisat2 command:

hisat2 -x genome_index [input fastq filename].fastq -S [output filename].sam

Samtools commands:

samtools view -bS [input filename].sam > [output filename].bam

0 answers

No answers yet.

Log in to answer this question.