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

net.maizegenetics.dna.pd.SiteAnnotation Maven / Gradle / Ivy

package net.maizegenetics.dna.pd;

import java.util.List;
import java.util.Set;
import java.util.TreeMap;

/**
 * User: dkroon
 * Date: 6/26/13
 * Time: 2:07 PM
 */
public class SiteAnnotation {

    private int site;
    private int chromosome;
    private int position;
    private TreeMap gwasResults;
    public TreeMap annotations;

    public SiteAnnotation(int aSite, int aChromosome, int aPosition ){
        site = aSite;
        chromosome = aChromosome;
        position = aPosition;
    }


    public void setGwasResults(TreeMap gwasResultsIn){
        gwasResults = gwasResultsIn;
    }

    public void setAnnotations(TreeMap annotationsIn){
        annotations = annotationsIn;
    }

    /**
     * Obtain complete listing of all available traits for which GWAS traits may be available
     * @return
     */
    public List getGWASTraits(){
        List list = null;
        Set traits = this.gwasResults.keySet();

        if(traits != null){
            list.addAll(traits);
        }
        return list;
    }

    /**
     * Obtain GWAS result value for given trait
     * @param trait
     * @return
     */
    public Double getGWASResult(String trait){
        Double result = null;
        if(this.gwasResults.containsKey(trait)){
            result = this.gwasResults.get(trait);
        }
        return result;
    }

    /**
     * Obtain complete listing of all annotations types available. Examples: Minor Allele Frequency
     * @return
     */
    public List getAnnotationTypes(){
        List annotationTypes = null;

        Set annotations = this.annotations.keySet();

        if(annotations != null){
            annotationTypes.addAll(annotations);
        }
        return annotationTypes;
    }


    /**
     *
     * @param annotationType
     * @return
     */
    public Double getAnnotationValue(String annotationType){
        Double value = null;
        if(this.annotations.containsKey(annotationType)){
            value = annotations.get(annotationType);
        }
        return value;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy