Sorted SAM output

125 views
Skip to first unread message

Vladimir Presnyak

unread,
Nov 23, 2015, 9:45:57 PM11/23/15
to rna-star
Hello all,

I was wondering if there is a way to produce sorted SAM files from STAR. I tried using a --outSAMtype SAM SortedByCoordinate flag, but that seems to produce an unsorted SAM.

Thanks!

Alexander Dobin

unread,
Nov 24, 2015, 11:50:56 AM11/24/15
to rna-star
Hi Vladimir,

there is no way to get sorted SAM directly.
If you use --outSAMtype BAM SortedByCoordinate you will get sorted BAM.
To get the sorted SAM as your output, you can output sorted BAM to stdout, and pipe it into samtools view, i.e.
$ STAR ... --outSAMtype BAM SortedByCoordinate --outStd BAM_SortedByCoordinate | samtools view -h - > Aigned.sorted.sam

Cheers
Alex

Vladimir Presnyak

unread,
Nov 24, 2015, 5:22:32 PM11/24/15
to rna-star
Thanks Alex, I was originally going to sort the sam files at the command line, but this is MUCH faster!

Vlad
Reply all
Reply to author
Forward
0 new messages