Major determinism fix for UG and RankSumTest

-- Now these routines all iterate in sample name order (genotypes.iterateInSampleNameOrder) so that the results of UG and the annotator do not depend on the particular order of samples we see for the exact model and the RankSumTest
This commit is contained in:
Mark DePristo 2011-11-17 15:31:45 -05:00
parent 7e66677769
commit 473b860312
2 changed files with 6 additions and 6 deletions

View File

@ -43,7 +43,7 @@ public abstract class RankSumTest extends InfoFieldAnnotation implements Standar
if (vc.isSNP() && vc.isBiallelic()) {
// todo - no current support for multiallelic snps
for ( final Genotype genotype : genotypes ) {
for ( final Genotype genotype : genotypes.iterateInSampleNameOrder() ) {
final AlignmentContext context = stratifiedContexts.get(genotype.getSampleName());
if ( context == null ) {
continue;
@ -53,7 +53,7 @@ public abstract class RankSumTest extends InfoFieldAnnotation implements Standar
}
else if (vc.isIndel() || vc.isMixed()) {
for ( final Genotype genotype : genotypes ) {
for ( final Genotype genotype : genotypes.iterateInSampleNameOrder() ) {
final AlignmentContext context = stratifiedContexts.get(genotype.getSampleName());
if ( context == null ) {
continue;

View File

@ -98,7 +98,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
ArrayList<double[]> genotypeLikelihoods = new ArrayList<double[]>();
genotypeLikelihoods.add(new double[]{0.0,0.0,0.0}); // dummy
for ( Genotype sample : GLs ) {
for ( Genotype sample : GLs.iterateInSampleNameOrder() ) {
if ( sample.hasLikelihoods() ) {
double[] gls = sample.getLikelihoods().getAsVector();
@ -290,12 +290,12 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
// todo = can't deal with optimal dynamic programming solution with multiallelic records
if (SIMPLE_GREEDY_GENOTYPER || !vc.isBiallelic()) {
sampleIndices.addAll(GLs.getSampleNames());
sampleIndices.addAll(GLs.getSampleNamesOrderedByName());
sampleIdx = GLs.size();
}
else {
for ( final Genotype genotype : GLs ) {
for ( final Genotype genotype : GLs.iterateInSampleNameOrder() ) {
if ( !genotype.hasLikelihoods() )
continue;
@ -419,7 +419,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
}
for ( final Genotype genotype : GLs ) {
for ( final Genotype genotype : GLs.iterateInSampleNameOrder() ) {
if ( !genotype.hasLikelihoods() )
continue;
Genotype g = GLs.get(genotype.getSampleName());