All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.maizegenetics.dna.snp.score.MaskAlleleProbability Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 6.0.1
Show newest version
/*
 *  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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy