Hi all
I used the
STAR ... --outSAMtype BAM SortedByCoordinate ...
option while mapping my paired end .fastq files.
I then sorted it using samtools
samtools sort -O bam -o STAR_output.sorted.bam STAR_output.bam
The size of the bam file shrank by 25% from 8G to 6G after sorting with samtools. their default sort is sorts by coordinate (position).
I assume that the sorted bam file from STAR is the same as the samtools sorted bam file. though the latter is more compressed. Is that true?
There are several compression level for bam. Maybe samtools and start using different as default.
But why do you use
samtools sort
if star give you already a coordinate sorted bam file?