Is STAR deterministic?

697 views
Skip to first unread message

Alex Chitsazan

unread,
Oct 18, 2016, 12:12:32 PM10/18/16
to rna-star
Is STAR deterministic  or do they have some random component to the mapping and/or quantification? I saw this in a post from a while ago (LINK), but recently it has been pointed  out to me that the new 2.5.0 manual has a paragraph saying this:

"By default, the order of the multi-mapping alignments for each read is not truly random. The —outMultimapperOrder Random option outputs multiple alignments for each read in random order, and also also randomizes the choice of the primary alignment from the highest scoring alignments. Parameter —runRNGseed can be used to set the random generator seed. With this option, the ordering of multi-mapping alignments of each read, and the choice of the primary alignment will vary from run to run, unless only one thread is used and the seed is kept constant"

Thanks!

Alex

Alexander Dobin

unread,
Oct 18, 2016, 5:13:13 PM10/18/16
to rna-star
Hi Alex,

STAR alignments are always deterministic, however, the order in which they are output, as well some flags/attrbiutes (primary flag, HI) are not always deterministic.

With default parameters, and running on one thread, STAR is fully deterministic, down to the order of output alignments.
With multiple threads, the order of the reads in the output is not deterministic, as STAR reads/maps/writes reads in chunks.
However, the alignments for each read are completely deterministic.

With --outMultimapperOrder Random, the order of alignments for each read is no longer deterministics, which also affects primary flag and HI attribute.

Cheers
Alex

Anna Esteve

unread,
Oct 19, 2016, 8:32:52 AM10/19/16
to rna-star
Thanks Alex, now it is very clear to me.

mihindu...@gmail.com

unread,
Feb 7, 2018, 11:40:37 AM2/7/18
to rna-star
Hi Alex,

What makes the alignments deterministic for multiple, equal hits?  I am assuming that I want the top hit chosen randomly in this case, but if the algorithm is prioritizing otherwise equal hits in a useful way, it may be better to keep the deterministic top hit.

Thank you for your help,
Kathie

Alexander Dobin

unread,
Feb 8, 2018, 11:52:00 AM2/8/18
to rna-star
Hi Kathie,

With the default --outSAMmultNmax -1 STAR outputs all multimapping alignments, not just one hit. 
If you want to output one alignment per read, you would need --outSAMmultNmax 1 . 
This one alignment is selected deterministically with the default --outMultimapperOrder Old_2.4, if you want it random, you would need
--outMultimapperOrder Random

Cheers
Alex

Carla Moller

unread,
Feb 1, 2019, 9:58:45 AM2/1/19
to rna-star
Hi Alex,

What is the deterministic method for read selection?

Best,
Carla

Alexander Dobin

unread,
Feb 1, 2019, 10:11:32 AM2/1/19
to rna-star
Hi Carla,

it's deterministic in the sense that if you map the same read with the same version of STAR with the same genome index, it will always output the same order of multimappers.
The order is determined by the order of seeds and alignment windows found, but it does not have a simple interpretation.
If you want true deterministic order, I would recommend that you sort the alignments for each multimapper by (multiple) specific fields (such as alignment start/end, strand, CIGAR, etc)

Cheers
Alex
Reply all
Reply to author
Forward
0 new messages