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

net.maizegenetics.dna.snp.score.Dosage 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
/*
 *  Dosage
 */
package net.maizegenetics.dna.snp.score;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import net.maizegenetics.dna.snp.byte2d.Byte2D;

/**
 *
 * @author Terry Casstevens
 */
public class Dosage implements SiteScore {

    private final Byte2D myStorage;
    private final int myNumTaxa;
    private final int myNumSites;

    Dosage(Byte2D value) {
        myStorage = value;
        myNumTaxa = myStorage.numTaxa();
        myNumSites = myStorage.numSites();
    }

    Dosage(int numTaxa, int numSites) {
        myStorage = null;
        myNumTaxa = numTaxa;
        myNumSites = numSites;
    }

    public byte value(int taxon, int site) {
        return myStorage.valueForAllele(taxon, site);
    }

    Byte2D byteStorage() {
        return myStorage;
    }

    @Override
    public Set siteScoreTypes() {
        return new HashSet<>(Arrays.asList(SITE_SCORE_TYPE.Dosage));
    }

    @Override
    public int numTaxa() {
        return myNumTaxa;
    }

    @Override
    public int numSites() {
        return myNumSites;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy