Deterministic version of getSequenceVariants
Deterministic version of getSequenceVariants

In Python 3, getSequenceVariants is no longer deterministic. Polymorphisms are stored in sets. Since Python 3.3, python randomizes hash keys of sets for a security reason (https://stackoverflow.com/questions/14956313/why-is-dictionary-ordering-non-deterministic). This means that the iteration order might be different every time. 

I propose a simple sort before iteration of alleles so the output of getSequenceVariants becomes deterministic.

There is also a small change in the encode method to fix the edge case where a stop variant is present at the end of the sequence.
In this case, the sequence is SEQUENCEV/ instead of SEQUENCEV/*.
tariqdaouda/pyGeno