True bam file encoding and viewing as text We all have been using samtools to convert between sam and bam files.  SAM is tab-delimited file. My question resides on the ability to visualize bam files as text.  Is there any way to visualize any bam file as text in linux? 
Why not work only with sam files and we need to convert them to bam?
Why not work only with sam files and we need to convert them to bam?


SAM is for human only, a binary format like BAM is smaller and parsed much faster by a program (and we want speed and optimize spaces for those huge files, don't we ?).

Furthermore, bam files are compressed using a  method that allow them to be accessed using random-access, that is how you can query a sub-part of bam file for a given genomic location.

you can always go back to SAM using samtools.