net.maizegenetics.dna.snp.score.MaskAlleleProbability Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tassel6 Show documentation
Show all versions of tassel6 Show documentation
TASSEL 6 is a software package to evaluate traits association. Feature Tables are at the heart of the package where, a feature is a range of positions or a single position. Row in the that table are taxon.
/*
* MaskAlleleProbability
*
* Created on May 7, 2016
*/
package net.maizegenetics.dna.snp.score;
import java.util.Collection;
import net.maizegenetics.dna.snp.MaskMatrix;
import net.maizegenetics.dna.snp.byte2d.Byte2D;
/**
*
* @author Terry Casstevens
*/
public class MaskAlleleProbability extends AlleleProbability {
private final AlleleProbability myProbability;
private final MaskMatrix myMask;
public MaskAlleleProbability(AlleleProbability probability, MaskMatrix mask) {
super(probability.numTaxa(), probability.numSites());
myProbability = probability;
myMask = mask;
}
@Override
public float value(int taxon, int site, SITE_SCORE_TYPE scoreType) {
if (myMask.get(taxon, site)) {
return 0.0f;
} else {
return myProbability.value(taxon, site, scoreType);
}
}
@Override
Collection byteStorage() {
return null;
}
public AlleleProbability base() {
return myProbability;
}
public MaskMatrix mask() {
return myMask;
}
}